@c8y/ngx-components 1021.25.5 → 1021.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/alarms/alarm-details.component.d.ts +8 -13
- package/alarms/alarm-details.component.d.ts.map +1 -1
- package/alarms/alarm-details.service.d.ts +3 -20
- package/alarms/alarm-details.service.d.ts.map +1 -1
- package/alarms/alarm-info.component.d.ts +0 -1
- package/alarms/alarm-info.component.d.ts.map +1 -1
- package/branding/shared/data/branding-version.service.d.ts.map +1 -1
- package/branding/shared/lazy/branding-theme-form/branding-theme-form.component.d.ts.map +1 -1
- package/core/bootstrap/bootstrap.component.d.ts.map +1 -1
- package/core/common/geo.service.d.ts.map +1 -1
- package/core/common/inter-app.service.d.ts +1 -0
- package/core/common/inter-app.service.d.ts.map +1 -1
- package/core/plugins/plugins.model.d.ts +3 -1
- package/core/plugins/plugins.model.d.ts.map +1 -1
- package/core/plugins/plugins.service.d.ts.map +1 -1
- package/device-map/bounds-resolver.service.d.ts +12 -0
- package/device-map/bounds-resolver.service.d.ts.map +1 -0
- package/device-map/c8y-ngx-components-device-map.d.ts.map +1 -0
- package/device-map/device-map-navigation.factory.d.ts +9 -0
- package/device-map/device-map-navigation.factory.d.ts.map +1 -0
- package/device-map/device-map.component.d.ts +10 -0
- package/device-map/device-map.component.d.ts.map +1 -0
- package/device-map/device-map.feature.d.ts +3 -0
- package/device-map/device-map.feature.d.ts.map +1 -0
- package/device-map/index.d.ts +6 -0
- package/device-map/index.d.ts.map +1 -0
- package/device-map/location-resolver.service.d.ts +8 -0
- package/device-map/location-resolver.service.d.ts.map +1 -0
- package/ecosystem/application-plugins/application-plugins.component.d.ts.map +1 -1
- package/ecosystem/application-plugins/orphaned-status-cell-renderer.component.d.ts.map +1 -1
- package/esm2022/alarms/alarm-details.component.mjs +14 -30
- package/esm2022/alarms/alarm-details.service.mjs +5 -25
- package/esm2022/alarms/alarm-info.component.mjs +1 -1
- package/esm2022/branding/shared/data/branding-version.service.mjs +9 -5
- package/esm2022/branding/shared/lazy/branding-theme-form/branding-theme-form.component.mjs +5 -2
- package/esm2022/core/bootstrap/bootstrap.component.mjs +4 -3
- package/esm2022/core/common/geo.service.mjs +2 -5
- package/esm2022/core/common/inter-app.service.mjs +3 -2
- package/esm2022/core/plugins/plugins.model.mjs +2 -1
- package/esm2022/core/plugins/plugins.service.mjs +7 -5
- package/esm2022/core/version/websdk-plugin-version.factory.mjs +2 -2
- package/esm2022/device-map/bounds-resolver.service.mjs +21 -0
- package/esm2022/device-map/c8y-ngx-components-device-map.mjs +5 -0
- package/esm2022/device-map/device-map-navigation.factory.mjs +25 -0
- package/esm2022/device-map/device-map.component.mjs +30 -0
- package/esm2022/device-map/device-map.feature.mjs +15 -0
- package/esm2022/device-map/index.mjs +6 -0
- package/esm2022/device-map/location-resolver.service.mjs +25 -0
- package/esm2022/ecosystem/application-plugins/application-plugins.component.mjs +66 -22
- package/esm2022/ecosystem/application-plugins/orphaned-status-cell-renderer.component.mjs +7 -1
- package/esm2022/location/location.component.mjs +3 -3
- package/esm2022/map/map-status.component.mjs +20 -7
- package/esm2022/map/map.component.mjs +15 -7
- package/esm2022/map/map.model.mjs +2 -2
- package/esm2022/map/map.module.mjs +25 -4
- package/esm2022/map/map.service.mjs +73 -7
- package/esm2022/repository/firmware/list/firmware-list.component.mjs +10 -10
- package/esm2022/repository/software/list/software-list.component.mjs +10 -10
- package/esm2022/tracking/tracking-marker-popup.component.mjs +10 -3
- package/esm2022/tracking/tracking.component.mjs +3 -4
- package/esm2022/tracking/tracking.service.mjs +6 -3
- package/fesm2022/c8y-ngx-components-alarms.mjs +18 -54
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-branding-shared-data.mjs +8 -4
- package/fesm2022/c8y-ngx-components-branding-shared-data.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs +4 -1
- package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-map.mjs +106 -0
- package/fesm2022/c8y-ngx-components-device-map.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs +71 -21
- package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem.mjs +71 -21
- package/fesm2022/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-location.mjs +2 -2
- package/fesm2022/c8y-ngx-components-location.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-map.mjs +122 -14
- package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs +9 -9
- package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-repository-software.mjs +9 -9
- package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-tracking.mjs +16 -7
- package/fesm2022/c8y-ngx-components-tracking.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +14 -12
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/de.po +13 -1
- package/locales/es.po +13 -1
- package/locales/fr.po +13 -1
- package/locales/ja_JP.po +15 -3
- package/locales/ko.po +13 -1
- package/locales/locales.pot +12 -0
- package/locales/nl.po +13 -1
- package/locales/pl.po +13 -1
- package/locales/pt_BR.po +13 -1
- package/locales/zh_CN.po +13 -1
- package/locales/zh_TW.po +13 -1
- package/map/map-status.component.d.ts +3 -1
- package/map/map-status.component.d.ts.map +1 -1
- package/map/map.component.d.ts +2 -1
- package/map/map.component.d.ts.map +1 -1
- package/map/map.model.d.ts +1 -0
- package/map/map.model.d.ts.map +1 -1
- package/map/map.module.d.ts +2 -1
- package/map/map.module.d.ts.map +1 -1
- package/map/map.service.d.ts +27 -2
- package/map/map.service.d.ts.map +1 -1
- package/package.json +1 -1
- package/repository/firmware/list/firmware-list.component.d.ts.map +1 -1
- package/repository/software/list/software-list.component.d.ts.map +1 -1
- package/tracking/tracking-marker-popup.component.d.ts +5 -1
- package/tracking/tracking-marker-popup.component.d.ts.map +1 -1
- package/tracking/tracking.component.d.ts.map +1 -1
- package/tracking/tracking.service.d.ts.map +1 -1
|
@@ -233,11 +233,11 @@ class LocationComponent {
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: LocationComponent, deps: [{ token: i1$1.ContextRouteService }, { token: i3.ActivatedRoute }, { token: i1.InventoryService }, { token: i1$1.Permissions }, { token: i1$1.OptionsService }, { token: i1$1.AlertService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
236
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: LocationComponent, selector: "c8y-location", viewQueries: [{ propertyName: "map", first: true, predicate: MapComponent, descendants: true }], ngImport: i0, template: "<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (\u00B0)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (\u00B0)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (\u00B0)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (\u00B0)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstra\u00DFe 13, D\u00FCsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n", dependencies: [{ kind: "component", type: i4$1.MapComponent, selector: "c8y-map", inputs: ["config", "assets", "polyline$", "polylineOptions"], outputs: ["onRealtimeUpdate", "onMove", "onMoveEnd", "onZoomStart", "onZoomEnd", "onMap", "onInit"] }, { kind: "component", type: i1$1.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: i1$1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i1$1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.MinValidationDirective, selector: "[min]", inputs: ["min"] }, { kind: "directive", type: i1$1.MaxValidationDirective, selector: "[max]", inputs: ["max"] }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i6.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i1$1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: i1$1.MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: i1$1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i1$1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }] }); }
|
|
236
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: LocationComponent, selector: "c8y-location", viewQueries: [{ propertyName: "map", first: true, predicate: MapComponent, descendants: true }], ngImport: i0, template: "<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (\u00B0)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (\u00B0)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (\u00B0)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (\u00B0)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstra\u00DFe 13, D\u00FCsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n", dependencies: [{ kind: "component", type: i4$1.MapComponent, selector: "c8y-map", inputs: ["config", "assets", "polyline$", "polylineOptions"], outputs: ["onRealtimeUpdate", "onMove", "onMoveEnd", "onZoomStart", "onZoomEnd", "onMap", "onInit"] }, { kind: "component", type: i1$1.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: i1$1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i1$1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.MinValidationDirective, selector: "[min]", inputs: ["min"] }, { kind: "directive", type: i1$1.MaxValidationDirective, selector: "[max]", inputs: ["max"] }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i6.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i6.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i1$1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: i1$1.MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: i1$1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i1$1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }] }); }
|
|
237
237
|
}
|
|
238
238
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: LocationComponent, decorators: [{
|
|
239
239
|
type: Component,
|
|
240
|
-
args: [{ selector: 'c8y-location', template: "<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (\u00B0)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (\u00B0)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (\u00B0)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (\u00B0)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstra\u00DFe 13, D\u00FCsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n" }]
|
|
240
|
+
args: [{ selector: 'c8y-location', template: "<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (\u00B0)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (\u00B0)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (\u00B0)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (\u00B0)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (\u00B0)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180\u00B0.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180\u00B0.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstra\u00DFe 13, D\u00FCsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n" }]
|
|
241
241
|
}], ctorParameters: () => [{ type: i1$1.ContextRouteService }, { type: i3.ActivatedRoute }, { type: i1.InventoryService }, { type: i1$1.Permissions }, { type: i1$1.OptionsService }, { type: i1$1.AlertService }], propDecorators: { map: [{
|
|
242
242
|
type: ViewChild,
|
|
243
243
|
args: [MapComponent]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-location.mjs","sources":["../../location/add-location.component.ts","../../location/add-location.component.html","../../location/add-location.factory.ts","../../location/location-tab.factory.ts","../../location/location.component.ts","../../location/location.component.html","../../location/location.module.ts","../../location/c8y-ngx-components-location.ts"],"sourcesContent":["import {\n Component,\n Inject,\n OnInit,\n Optional,\n TemplateRef,\n ViewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { IManagedObject, InventoryService } from '@c8y/client';\nimport { AlertService, ContextRouteService } from '@c8y/ngx-components';\nimport type { MapDefaultConfig } from '@c8y/options';\nimport { Router } from '@angular/router';\nimport { MAP_DEFAULT_CONFIG, defaultMapConfig } from '@c8y/ngx-components/map';\nimport { Observable, of } from 'rxjs';\nimport { first } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-add-location',\n templateUrl: './add-location.component.html'\n})\nexport class AddLocationComponent implements OnInit {\n @ViewChild('templateCopy', { read: TemplateRef, static: true }) templateCopy;\n\n constructor(\n private inventoryService: InventoryService,\n private contextRouteService: ContextRouteService,\n @Optional()\n @Inject(MAP_DEFAULT_CONFIG)\n private defaultConfig$: Observable<MapDefaultConfig>,\n private router: Router,\n private alertService: AlertService,\n private vcRef: ViewContainerRef\n ) {}\n\n ngOnInit() {\n this.vcRef.createEmbeddedView(this.templateCopy);\n }\n\n onClick(): void {\n const mapConfig$ = this.defaultConfig$ || of(defaultMapConfig);\n mapConfig$.pipe(first()).subscribe(async config => {\n const context = this.contextRouteService.activatedContextData;\n context.contextData.c8y_Position = {\n lat: config.center[0],\n lng: config.center[1]\n };\n try {\n await this.inventoryService.update(context.contextData as IManagedObject);\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n\n const route = this.contextRouteService.getContextRoute(context);\n this.contextRouteService.refreshContext();\n this.router.navigateByUrl(route + '/location');\n });\n }\n}\n","<ng-template #templateCopy>\n <button\n class=\"btn btn-link\"\n [title]=\"'Add location' | translate\"\n (click)=\"onClick()\"\n >\n <i c8yIcon=\"location-arrow\"></i>\n <span translate>Add location</span>\n </button>\n</ng-template>\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n ActionBarFactory,\n ActionBarItem,\n ContextRouteService,\n ViewContext\n} from '@c8y/ngx-components';\nimport { AddLocationComponent } from './add-location.component';\nimport { isUndefined } from 'lodash-es';\n\n@Injectable({ providedIn: 'root' })\nexport class AddLocationFactory implements ActionBarFactory {\n private action: ActionBarItem = {\n component: AddLocationComponent,\n placement: 'more'\n };\n\n constructor(private contextRouteService: ContextRouteService) {}\n\n get(activatedRoute?: ActivatedRoute): ActionBarItem {\n const routeData = this.contextRouteService.getContextData(activatedRoute);\n if (!routeData) {\n return;\n }\n if (\n routeData.context === ViewContext.Device &&\n isUndefined(routeData.contextData.c8y_Position)\n ) {\n return this.action;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n ContextRouteService,\n Tab,\n ViewContext,\n ExtensionFactory,\n gettext\n} from '@c8y/ngx-components';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationTabFactory implements ExtensionFactory<Tab> {\n constructor(private contextRouteService: ContextRouteService) {}\n\n get(activatedRoute: ActivatedRoute): Tab[] {\n const contextData = this.contextRouteService.getContextData(activatedRoute);\n const isDeviceOrGroupWithPosition =\n (contextData?.context === ViewContext.Device || contextData?.context === ViewContext.Group) &&\n contextData?.contextData.c8y_Position;\n if (isDeviceOrGroupWithPosition) {\n return [\n {\n label: gettext('Location'),\n icon: 'location-arrow',\n path: `${this.contextRouteService.getContextRoute(contextData)}/location`\n }\n ];\n }\n return [];\n }\n}\n","import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { MapComponent, MapConfig, PositionManagedObject } from '@c8y/ngx-components/map';\nimport {\n AlertService,\n ContextRouteService,\n OptionsService,\n Permissions,\n gettext\n} from '@c8y/ngx-components';\nimport { ActivatedRoute } from '@angular/router';\nimport { InventoryService } from '@c8y/client';\nimport { isUndefined, cloneDeep } from 'lodash-es';\nimport { takeUntil } from 'rxjs/operators';\nimport { Subject } from 'rxjs';\n\n@Component({\n selector: 'c8y-location',\n templateUrl: './location.component.html'\n})\nexport class LocationComponent implements OnInit, OnDestroy {\n position: PositionManagedObject;\n originalPosition: PositionManagedObject;\n isEdit = false;\n canEdit = true;\n config: MapConfig = { realtime: false, follow: true, zoomLevel: 12 };\n addressSearchTerm = '';\n hideAddressSearchFeature = false;\n\n private destroy$ = new Subject<void>();\n private mapNominatimUrl = 'https://nominatim.openstreetmap.org/search?format=json&q={searchTerm}';\n\n @ViewChild(MapComponent)\n map: MapComponent;\n\n constructor(\n private contextRouteService: ContextRouteService,\n private activatedRoute: ActivatedRoute,\n private inventoryService: InventoryService,\n private permissions: Permissions,\n private optionsService: OptionsService,\n private alertService: AlertService\n ) {}\n\n ngOnInit(): void {\n this.activatedRoute.url.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateMap();\n });\n }\n\n async updateMap() {\n const { contextData } = this.contextRouteService.getContextData(this.activatedRoute);\n this.position = contextData as PositionManagedObject;\n this.canEdit = await this.permissions.canEdit(\n [Permissions.ROLE_INVENTORY_ADMIN, Permissions.ROLE_INVENTORY_CREATE],\n contextData\n );\n\n const hasCustomSetting = !isUndefined(this.optionsService.mapNominatimUrl);\n this.hideAddressSearchFeature = hasCustomSetting && !this.optionsService.mapNominatimUrl;\n\n if (hasCustomSetting) {\n this.mapNominatimUrl = this.optionsService.mapNominatimUrl;\n }\n\n this.map.refresh();\n }\n\n toggleRealtime() {\n this.config = { ...this.config, realtime: !this.config.realtime };\n }\n\n disableRealtime() {\n this.config = { ...this.config, realtime: false };\n }\n\n centerMap() {\n this.config = {\n ...this.config,\n center: [this.position.c8y_Position.lat, this.position.c8y_Position.lng]\n };\n }\n\n edit() {\n this.originalPosition = cloneDeep(this.position);\n this.enableMarkerDragging();\n this.disableRealtime();\n this.isEdit = true;\n }\n\n cancel() {\n this.position = this.originalPosition;\n this.isEdit = false;\n this.map.markers[0]?.dragging.disable();\n this.centerMap();\n }\n\n async save() {\n try {\n const { data } = await this.inventoryService.update({\n id: this.position.id,\n c8y_Position: this.position.c8y_Position\n });\n this.position = data as PositionManagedObject;\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n this.map.markers[0]?.dragging.disable();\n this.centerMap();\n this.isEdit = false;\n }\n\n positionChanged(position: PositionManagedObject) {\n this.position = position;\n }\n\n async searchAddress(searchTerm: string) {\n const fetchResponse = await fetch(this.mapNominatimUrl.replace('{searchTerm}', searchTerm));\n if (fetchResponse.status !== 200) {\n this.alertService.danger(gettext('Failed to search for address.'));\n return;\n }\n const data: Array<{ lat: string | number; lon: string | number; licence?: string }> =\n await fetchResponse.json();\n const latLng = data[0];\n if (!latLng) {\n this.alertService.warning(gettext('Address could not be found.'));\n return;\n }\n this.position.c8y_Position.lat = Number(latLng.lat);\n this.position.c8y_Position.lng = Number(latLng.lon);\n this.updateMarkerPosition();\n if (latLng.licence) {\n this.map.map.attributionControl.addAttribution(latLng.licence);\n }\n }\n\n updateMarkerPosition() {\n this.map.refreshMarkers();\n this.enableMarkerDragging();\n this.centerMap();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n }\n\n private enableMarkerDragging() {\n const marker = this.map.markers[0];\n if (marker) {\n marker.dragging.enable();\n marker.on('dragend', () => {\n const latlng = marker.getLatLng();\n this.position.c8y_Position = {\n ...this.position.c8y_Position,\n lat: latlng.lat,\n lng: latlng.lng\n };\n this.centerMap();\n });\n }\n }\n}\n","<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (°)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (°)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (°)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (°)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90°.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90°.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (°)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (°)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180°.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180°.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstraße 13, Düsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CoreModule, hookActionBar, hookRoute, hookTab, ViewContext } from '@c8y/ngx-components';\nimport { MapModule } from '@c8y/ngx-components/map';\nimport { AddLocationComponent } from './add-location.component';\nimport { AddLocationFactory } from './add-location.factory';\nimport { LocationTabFactory } from './location-tab.factory';\nimport { LocationComponent } from './location.component';\nimport { LocationConfiguration } from './location.model';\n\n@NgModule({\n declarations: [LocationComponent],\n imports: [MapModule, CoreModule, RouterModule],\n exports: [LocationComponent],\n providers: [\n hookRoute({\n path: 'location',\n component: LocationComponent,\n context: ViewContext.Device,\n tabs: []\n }),\n hookRoute({\n path: 'location',\n component: LocationComponent,\n context: ViewContext.Group,\n tabs: []\n })\n ]\n})\nexport class LocationRouteModule {}\n\n@NgModule({\n imports: [LocationRouteModule],\n providers: [hookTab(LocationTabFactory)]\n})\nexport class LocationTabModule {}\n\n/**\n * @deprecated has been splitted into `LocationTabModule` and `AddLocationModule`.\n */\n@NgModule({\n imports: [LocationTabModule]\n})\nexport class LocationModule {\n /**\n *\n * @deprecated use the `LocationTabModule` and optionally `AddLocationModule` instead.\n */\n static config(\n config: LocationConfiguration = { addLocation: false }\n ): ModuleWithProviders<LocationModule> {\n return {\n ngModule: LocationModule,\n providers: config.addLocation ? [hookActionBar(AddLocationFactory)] : []\n };\n }\n}\n\n@NgModule({\n imports: [CoreModule, LocationRouteModule],\n declarations: [AddLocationComponent],\n exports: [AddLocationComponent],\n providers: [hookActionBar(AddLocationFactory)]\n})\nexport class AddLocationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","i1","i3","i4"],"mappings":";;;;;;;;;;;;;;;;MAqBa,oBAAoB,CAAA;IAG/B,WACU,CAAA,gBAAkC,EAClC,mBAAwC,EAGxC,cAA4C,EAC5C,MAAc,EACd,YAA0B,EAC1B,KAAuB,EAAA;QAPvB,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;QAClC,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB,CAAqB;QAGxC,IAAc,CAAA,cAAA,GAAd,cAAc,CAA8B;QAC5C,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAC1B,IAAK,CAAA,KAAA,GAAL,KAAK,CAAkB;KAC7B;IAEJ,QAAQ,GAAA;QACN,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAClD;IAED,OAAO,GAAA;QACL,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;AAC/D,QAAA,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,OAAM,MAAM,KAAG;AAChD,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC;AAC9D,YAAA,OAAO,CAAC,WAAW,CAAC,YAAY,GAAG;AACjC,gBAAA,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AACrB,gBAAA,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;aACtB,CAAC;AACF,YAAA,IAAI;gBACF,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,WAA6B,CAAC,CAA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ACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAC/B,oBAAA,SAAS,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;AAC/C,iBAAA,CAAA;;;AC/DD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-location.mjs","sources":["../../location/add-location.component.ts","../../location/add-location.component.html","../../location/add-location.factory.ts","../../location/location-tab.factory.ts","../../location/location.component.ts","../../location/location.component.html","../../location/location.module.ts","../../location/c8y-ngx-components-location.ts"],"sourcesContent":["import {\n Component,\n Inject,\n OnInit,\n Optional,\n TemplateRef,\n ViewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { IManagedObject, InventoryService } from '@c8y/client';\nimport { AlertService, ContextRouteService } from '@c8y/ngx-components';\nimport type { MapDefaultConfig } from '@c8y/options';\nimport { Router } from '@angular/router';\nimport { MAP_DEFAULT_CONFIG, defaultMapConfig } from '@c8y/ngx-components/map';\nimport { Observable, of } from 'rxjs';\nimport { first } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-add-location',\n templateUrl: './add-location.component.html'\n})\nexport class AddLocationComponent implements OnInit {\n @ViewChild('templateCopy', { read: TemplateRef, static: true }) templateCopy;\n\n constructor(\n private inventoryService: InventoryService,\n private contextRouteService: ContextRouteService,\n @Optional()\n @Inject(MAP_DEFAULT_CONFIG)\n private defaultConfig$: Observable<MapDefaultConfig>,\n private router: Router,\n private alertService: AlertService,\n private vcRef: ViewContainerRef\n ) {}\n\n ngOnInit() {\n this.vcRef.createEmbeddedView(this.templateCopy);\n }\n\n onClick(): void {\n const mapConfig$ = this.defaultConfig$ || of(defaultMapConfig);\n mapConfig$.pipe(first()).subscribe(async config => {\n const context = this.contextRouteService.activatedContextData;\n context.contextData.c8y_Position = {\n lat: config.center[0],\n lng: config.center[1]\n };\n try {\n await this.inventoryService.update(context.contextData as IManagedObject);\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n\n const route = this.contextRouteService.getContextRoute(context);\n this.contextRouteService.refreshContext();\n this.router.navigateByUrl(route + '/location');\n });\n }\n}\n","<ng-template #templateCopy>\n <button\n class=\"btn btn-link\"\n [title]=\"'Add location' | translate\"\n (click)=\"onClick()\"\n >\n <i c8yIcon=\"location-arrow\"></i>\n <span translate>Add location</span>\n </button>\n</ng-template>\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n ActionBarFactory,\n ActionBarItem,\n ContextRouteService,\n ViewContext\n} from '@c8y/ngx-components';\nimport { AddLocationComponent } from './add-location.component';\nimport { isUndefined } from 'lodash-es';\n\n@Injectable({ providedIn: 'root' })\nexport class AddLocationFactory implements ActionBarFactory {\n private action: ActionBarItem = {\n component: AddLocationComponent,\n placement: 'more'\n };\n\n constructor(private contextRouteService: ContextRouteService) {}\n\n get(activatedRoute?: ActivatedRoute): ActionBarItem {\n const routeData = this.contextRouteService.getContextData(activatedRoute);\n if (!routeData) {\n return;\n }\n if (\n routeData.context === ViewContext.Device &&\n isUndefined(routeData.contextData.c8y_Position)\n ) {\n return this.action;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n ContextRouteService,\n Tab,\n ViewContext,\n ExtensionFactory,\n gettext\n} from '@c8y/ngx-components';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationTabFactory implements ExtensionFactory<Tab> {\n constructor(private contextRouteService: ContextRouteService) {}\n\n get(activatedRoute: ActivatedRoute): Tab[] {\n const contextData = this.contextRouteService.getContextData(activatedRoute);\n const isDeviceOrGroupWithPosition =\n (contextData?.context === ViewContext.Device || contextData?.context === ViewContext.Group) &&\n contextData?.contextData.c8y_Position;\n if (isDeviceOrGroupWithPosition) {\n return [\n {\n label: gettext('Location'),\n icon: 'location-arrow',\n path: `${this.contextRouteService.getContextRoute(contextData)}/location`\n }\n ];\n }\n return [];\n }\n}\n","import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { MapComponent, MapConfig, PositionManagedObject } from '@c8y/ngx-components/map';\nimport {\n AlertService,\n ContextRouteService,\n OptionsService,\n Permissions,\n gettext\n} from '@c8y/ngx-components';\nimport { ActivatedRoute } from '@angular/router';\nimport { InventoryService } from '@c8y/client';\nimport { isUndefined, cloneDeep } from 'lodash-es';\nimport { takeUntil } from 'rxjs/operators';\nimport { Subject } from 'rxjs';\n\n@Component({\n selector: 'c8y-location',\n templateUrl: './location.component.html'\n})\nexport class LocationComponent implements OnInit, OnDestroy {\n position: PositionManagedObject;\n originalPosition: PositionManagedObject;\n isEdit = false;\n canEdit = true;\n config: MapConfig = { realtime: false, follow: true, zoomLevel: 12 };\n addressSearchTerm = '';\n hideAddressSearchFeature = false;\n\n private destroy$ = new Subject<void>();\n private mapNominatimUrl = 'https://nominatim.openstreetmap.org/search?format=json&q={searchTerm}';\n\n @ViewChild(MapComponent)\n map: MapComponent;\n\n constructor(\n private contextRouteService: ContextRouteService,\n private activatedRoute: ActivatedRoute,\n private inventoryService: InventoryService,\n private permissions: Permissions,\n private optionsService: OptionsService,\n private alertService: AlertService\n ) {}\n\n ngOnInit(): void {\n this.activatedRoute.url.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateMap();\n });\n }\n\n async updateMap() {\n const { contextData } = this.contextRouteService.getContextData(this.activatedRoute);\n this.position = contextData as PositionManagedObject;\n this.canEdit = await this.permissions.canEdit(\n [Permissions.ROLE_INVENTORY_ADMIN, Permissions.ROLE_INVENTORY_CREATE],\n contextData\n );\n\n const hasCustomSetting = !isUndefined(this.optionsService.mapNominatimUrl);\n this.hideAddressSearchFeature = hasCustomSetting && !this.optionsService.mapNominatimUrl;\n\n if (hasCustomSetting) {\n this.mapNominatimUrl = this.optionsService.mapNominatimUrl;\n }\n\n this.map.refresh();\n }\n\n toggleRealtime() {\n this.config = { ...this.config, realtime: !this.config.realtime };\n }\n\n disableRealtime() {\n this.config = { ...this.config, realtime: false };\n }\n\n centerMap() {\n this.config = {\n ...this.config,\n center: [this.position.c8y_Position.lat, this.position.c8y_Position.lng]\n };\n }\n\n edit() {\n this.originalPosition = cloneDeep(this.position);\n this.enableMarkerDragging();\n this.disableRealtime();\n this.isEdit = true;\n }\n\n cancel() {\n this.position = this.originalPosition;\n this.isEdit = false;\n this.map.markers[0]?.dragging.disable();\n this.centerMap();\n }\n\n async save() {\n try {\n const { data } = await this.inventoryService.update({\n id: this.position.id,\n c8y_Position: this.position.c8y_Position\n });\n this.position = data as PositionManagedObject;\n } catch (ex) {\n this.alertService.addServerFailure(ex);\n }\n this.map.markers[0]?.dragging.disable();\n this.centerMap();\n this.isEdit = false;\n }\n\n positionChanged(position: PositionManagedObject) {\n this.position = position;\n }\n\n async searchAddress(searchTerm: string) {\n const fetchResponse = await fetch(this.mapNominatimUrl.replace('{searchTerm}', searchTerm));\n if (fetchResponse.status !== 200) {\n this.alertService.danger(gettext('Failed to search for address.'));\n return;\n }\n const data: Array<{ lat: string | number; lon: string | number; licence?: string }> =\n await fetchResponse.json();\n const latLng = data[0];\n if (!latLng) {\n this.alertService.warning(gettext('Address could not be found.'));\n return;\n }\n this.position.c8y_Position.lat = Number(latLng.lat);\n this.position.c8y_Position.lng = Number(latLng.lon);\n this.updateMarkerPosition();\n if (latLng.licence) {\n this.map.map.attributionControl.addAttribution(latLng.licence);\n }\n }\n\n updateMarkerPosition() {\n this.map.refreshMarkers();\n this.enableMarkerDragging();\n this.centerMap();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n }\n\n private enableMarkerDragging() {\n const marker = this.map.markers[0];\n if (marker) {\n marker.dragging.enable();\n marker.on('dragend', () => {\n const latlng = marker.getLatLng();\n this.position.c8y_Position = {\n ...this.position.c8y_Position,\n lat: latlng.lat,\n lng: latlng.lng\n };\n this.centerMap();\n });\n }\n }\n}\n","<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link c8y-realtime\"\n title=\"{{ 'Toggle realtime' | translate }}\"\n type=\"button\"\n (click)=\"toggleRealtime()\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{ active: config.realtime, inactive: !config.realtime }\"\n ></span>\n <span translate>Realtime</span>\n </button>\n</c8y-action-bar-item>\n<c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-clean\"\n title=\"{{ 'Center`verb`' | translate }}\"\n (click)=\"centerMap()\"\n >\n <i [c8yIcon]=\"'target1'\"></i>\n <span translate>Center`verb`</span>\n </button>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map\n [assets]=\"[position]\"\n [config]=\"config\"\n (onRealtimeUpdate)=\"positionChanged($event)\"\n ></c8y-map>\n </div>\n\n <form\n class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\"\n #positionForm=\"ngForm\"\n (ngSubmit)=\"save()\"\n >\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Device location\n </span>\n </div>\n <div class=\"inner-scroll\">\n <div\n class=\"m-16\"\n *ngIf=\"!isEdit\"\n >\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Latitude (°)\n </div>\n {{ position.c8y_Position.lat }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Longitude (°)\n </div>\n {{ position.c8y_Position.lng }}\n </div>\n <div class=\"p-b-40\">\n <div\n class=\"text-bold\"\n translate\n >\n Altitude (m)\n </div>\n {{ position.c8y_Position.alt }}\n </div>\n </div>\n <div\n class=\"m-16\"\n *ngIf=\"isEdit\"\n >\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Latitude (°)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Latitude (°)' | translate\"\n id=\"lat\"\n name=\"lat\"\n type=\"number\"\n required\n min=\"-90\"\n max=\"90\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lat\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum latitude value is -90°.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum latitude value is 90°.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"lat\"\n translate\n >\n Longitude (°)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Longitude (°)' | translate\"\n id=\"lng\"\n name=\"lng\"\n type=\"number\"\n required\n min=\"-180\"\n max=\"180\"\n (blur)=\"positionForm.valid && updateMarkerPosition()\"\n [(ngModel)]=\"position.c8y_Position.lng\"\n />\n <c8y-messages>\n <c8y-message\n name=\"min\"\n [text]=\"'The minimum longitude value is -180°.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"max\"\n [text]=\"'The maximum longitude value is 180°.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n <c8y-form-group>\n <label\n for=\"alt\"\n translate\n >\n Altitude (m)\n </label>\n\n <input\n class=\"form-control\"\n [title]=\"'Altitude (m)' | translate\"\n id=\"alt\"\n name=\"alt\"\n type=\"number\"\n [(ngModel)]=\"position.c8y_Position.alt\"\n />\n </c8y-form-group>\n </div>\n\n <form\n class=\"card-block bg-level-1\"\n #addressSearch=\"ngForm\"\n novalidate\n (submit)=\"searchAddress(addressSearchTerm)\"\n *ngIf=\"isEdit && !hideAddressSearchFeature\"\n >\n <div class=\"form-group\">\n <label\n for=\"searchAddress\"\n translate\n >\n Find lat/long by address\n </label>\n <div class=\"input-group input-group-search\">\n <input\n class=\"form-control\"\n id=\"searchAddress\"\n name=\"addressSearchTerm\"\n type=\"text\"\n [placeholder]=\"'e.g. Speditionstraße 13, Düsseldorf`LOCALIZE`' | translate\"\n [(ngModel)]=\"addressSearchTerm\"\n />\n <span class=\"input-group-btn\">\n <button\n class=\"btn btn-dot\"\n [title]=\"'Search' | translate\"\n type=\"submit\"\n >\n <i\n class=\"dlt-c8y-icon-search\"\n c8y-icon=\"search\"\n ></i>\n </button>\n </span>\n </div>\n </div>\n </form>\n </div>\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Edit location' | translate\"\n type=\"button\"\n *ngIf=\"canEdit && !isEdit\"\n (click)=\"edit()\"\n translate\n >\n Edit location\n </button>\n <button\n class=\"btn btn-default\"\n [title]=\"'Cancel' | translate\"\n type=\"button\"\n (click)=\"cancel()\"\n *ngIf=\"isEdit\"\n translate\n >\n Cancel\n </button>\n <button\n class=\"btn btn-primary\"\n [title]=\"'Save' | translate\"\n type=\"submit\"\n *ngIf=\"isEdit\"\n translate\n [disabled]=\"!positionForm.valid\"\n >\n Save\n </button>\n </div>\n </form>\n</div>\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { CoreModule, hookActionBar, hookRoute, hookTab, ViewContext } from '@c8y/ngx-components';\nimport { MapModule } from '@c8y/ngx-components/map';\nimport { AddLocationComponent } from './add-location.component';\nimport { AddLocationFactory } from './add-location.factory';\nimport { LocationTabFactory } from './location-tab.factory';\nimport { LocationComponent } from './location.component';\nimport { LocationConfiguration } from './location.model';\n\n@NgModule({\n declarations: [LocationComponent],\n imports: [MapModule, CoreModule, RouterModule],\n exports: [LocationComponent],\n providers: [\n hookRoute({\n path: 'location',\n component: LocationComponent,\n context: ViewContext.Device,\n tabs: []\n }),\n hookRoute({\n path: 'location',\n component: LocationComponent,\n context: ViewContext.Group,\n tabs: []\n })\n ]\n})\nexport class LocationRouteModule {}\n\n@NgModule({\n imports: [LocationRouteModule],\n providers: [hookTab(LocationTabFactory)]\n})\nexport class LocationTabModule {}\n\n/**\n * @deprecated has been splitted into `LocationTabModule` and `AddLocationModule`.\n */\n@NgModule({\n imports: [LocationTabModule]\n})\nexport class LocationModule {\n /**\n *\n * @deprecated use the `LocationTabModule` and optionally `AddLocationModule` instead.\n */\n static config(\n config: LocationConfiguration = { addLocation: false }\n ): ModuleWithProviders<LocationModule> {\n return {\n ngModule: LocationModule,\n providers: config.addLocation ? [hookActionBar(AddLocationFactory)] : []\n };\n }\n}\n\n@NgModule({\n imports: [CoreModule, LocationRouteModule],\n declarations: [AddLocationComponent],\n exports: [AddLocationComponent],\n providers: [hookActionBar(AddLocationFactory)]\n})\nexport class AddLocationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","i1","i3","i4"],"mappings":";;;;;;;;;;;;;;;;MAqBa,oBAAoB,CAAA;IAG/B,WACU,CAAA,gBAAkC,EAClC,mBAAwC,EAGxC,cAA4C,EAC5C,MAAc,EACd,YAA0B,EAC1B,KAAuB,EAAA;QAPvB,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;QAClC,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB,CAAqB;QAGxC,IAAc,CAAA,cAAA,GAAd,cAAc,CAA8B;QAC5C,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAC1B,IAAK,CAAA,KAAA,GAAL,KAAK,CAAkB;KAC7B;IAEJ,QAAQ,GAAA;QACN,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAClD;IAED,OAAO,GAAA;QACL,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;AAC/D,QAAA,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,OAAM,MAAM,KAAG;AAChD,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC;AAC9D,YAAA,OAAO,CAAC,WAAW,CAAC,YAAY,GAAG;AACjC,gBAAA,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AACrB,gBAAA,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;aACtB,CAAC;AACF,YAAA,I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O,EAAE,CAAC,UAAU,EAAE,mBAAmB,CAAC;oBAC1C,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAC/B,oBAAA,SAAS,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;AAC/C,iBAAA,CAAA;;;AC/DD;;AAEG;;;;"}
|
|
@@ -7,10 +7,13 @@ import * as i4 from 'rxjs';
|
|
|
7
7
|
import { of, combineLatest, defer, NEVER, BehaviorSubject, Subject, fromEvent, EMPTY, merge, from } from 'rxjs';
|
|
8
8
|
import { map, first, takeUntil, scan, filter, switchMap, tap, mergeMap, catchError, debounceTime, skip } from 'rxjs/operators';
|
|
9
9
|
import * as i1 from '@c8y/client';
|
|
10
|
-
import {
|
|
10
|
+
import { latLng, latLngBounds } from 'leaflet';
|
|
11
|
+
import { get, remove, isUndefined, flatten, every, isNull, isEmpty, cloneDeep } from 'lodash-es';
|
|
11
12
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
12
13
|
import * as i1$2 from '@angular/common';
|
|
13
14
|
import { CommonModule } from '@angular/common';
|
|
15
|
+
import * as i3$1 from 'ngx-bootstrap/tooltip';
|
|
16
|
+
import { TooltipModule } from 'ngx-bootstrap/tooltip';
|
|
14
17
|
import { FormsModule } from '@angular/forms';
|
|
15
18
|
|
|
16
19
|
function getC8yMarker(marker, asset, event) {
|
|
@@ -39,7 +42,7 @@ const defaultLayer = {
|
|
|
39
42
|
maxZoom: 18,
|
|
40
43
|
minZoom: 2,
|
|
41
44
|
attribution: '©<a href="http://www.openstreetmap.org/copyright" rel="noreferrer nofollow">OpenStreetMap</a>',
|
|
42
|
-
noWrap:
|
|
45
|
+
noWrap: false
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
const defaultMapConfig = {
|
|
@@ -166,12 +169,20 @@ class MapService {
|
|
|
166
169
|
return this.getPositionMOsFromBound(bound, byGroupIdMO, true);
|
|
167
170
|
}
|
|
168
171
|
async getPositionMOsFromBound(bound, byGroupIdMO, count = false) {
|
|
169
|
-
const { lat: latMin, lng:
|
|
170
|
-
const { lat: latMax, lng:
|
|
172
|
+
const { lat: latMin, lng: lngMinRaw } = bound.getSouthWest();
|
|
173
|
+
const { lat: latMax, lng: lngMaxRaw } = bound.getNorthEast();
|
|
174
|
+
const lngMin = lngMaxRaw - lngMinRaw > 360 ? -180 : this.normalizeLongitude(lngMinRaw);
|
|
175
|
+
const lngMax = lngMaxRaw - lngMinRaw > 360 ? 180 : this.normalizeLongitude(lngMaxRaw);
|
|
171
176
|
const byGroupIdFilter = byGroupIdMO
|
|
172
177
|
? `(bygroupid(${byGroupIdMO.id}) or id eq '${byGroupIdMO.id}') and `
|
|
173
178
|
: '';
|
|
174
|
-
|
|
179
|
+
let boundFilter = `$filter=${byGroupIdFilter}has(c8y_Position) and c8y_Position.lat gt ${latMin}d and c8y_Position.lat lt ${latMax}d`;
|
|
180
|
+
if (lngMin < lngMax) {
|
|
181
|
+
boundFilter = `${boundFilter} and c8y_Position.lng gt ${lngMin}d and c8y_Position.lng lt ${lngMax}d`;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
boundFilter = `${boundFilter} and (c8y_Position.lng gt ${lngMin}d or c8y_Position.lng lt ${lngMax}d)`;
|
|
185
|
+
}
|
|
175
186
|
const { paging, data } = await this.inventory.list({
|
|
176
187
|
pageSize: count ? 1 : this.MAX_DEVICE_PER_CLUSTER,
|
|
177
188
|
withTotalPages: count,
|
|
@@ -180,7 +191,9 @@ class MapService {
|
|
|
180
191
|
if (count) {
|
|
181
192
|
return paging.totalPages;
|
|
182
193
|
}
|
|
183
|
-
return data
|
|
194
|
+
return data.map((pmo) => bound.contains(latLng(pmo.c8y_Position.lat, pmo.c8y_Position.lng))
|
|
195
|
+
? pmo
|
|
196
|
+
: this.denormalizePMO(pmo, bound));
|
|
184
197
|
}
|
|
185
198
|
/**
|
|
186
199
|
* Returns all devices with c8y_Position.
|
|
@@ -221,6 +234,31 @@ class MapService {
|
|
|
221
234
|
data: data
|
|
222
235
|
};
|
|
223
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Determines a rectangular geographical area based on the positions of all devices.
|
|
239
|
+
*
|
|
240
|
+
* @returns A [[LatLngBounds]] object fitting all devices' geo positions.
|
|
241
|
+
*/
|
|
242
|
+
async getAllDevicesBounds() {
|
|
243
|
+
const filter = (coord, order) => ({
|
|
244
|
+
pageSize: 1,
|
|
245
|
+
q: `$filter=has(c8y_Position) $orderby=c8y_Position.${coord} ${order}`
|
|
246
|
+
});
|
|
247
|
+
const filterReverse = (op, order) => ({
|
|
248
|
+
pageSize: 1,
|
|
249
|
+
q: `$filter=has(c8y_Position) and c8y_Position.lng ${op} 0d $orderby=c8y_Position.lng ${order}`
|
|
250
|
+
});
|
|
251
|
+
const [latMin, latMax, lngMin, lngMax, lngRevMin, lngRevMax] = await Promise.all([
|
|
252
|
+
this.inventory.list(filter('lat', 'asc')),
|
|
253
|
+
this.inventory.list(filter('lat', 'desc')),
|
|
254
|
+
this.inventory.list(filter('lng', 'asc')),
|
|
255
|
+
this.inventory.list(filter('lng', 'desc')),
|
|
256
|
+
this.inventory.list(filterReverse('gt', 'asc')),
|
|
257
|
+
this.inventory.list(filterReverse('lt', 'desc'))
|
|
258
|
+
]).then(result => result.map(r => get(r.data, '[0].c8y_Position')));
|
|
259
|
+
const shiftWorld = (lngRevMin?.lng ?? 0) - (lngRevMax?.lng ?? 0) > 180;
|
|
260
|
+
return latLngBounds(latLng(latMin?.lat, shiftWorld ? lngRevMin?.lng : lngMin?.lng), latLng(latMax?.lat, shiftWorld ? lngRevMax?.lng + 360 : lngMax?.lng));
|
|
261
|
+
}
|
|
224
262
|
/**
|
|
225
263
|
* Returns the cluster size for clustered maps. Counting the position MOs in a bounding
|
|
226
264
|
* and if it reach a threshold, returning a [[ClusterSize]].
|
|
@@ -247,6 +285,35 @@ class MapService {
|
|
|
247
285
|
return config;
|
|
248
286
|
}));
|
|
249
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Shifts longitudes received from Leaflet.js in the [-180 - k*360; 180 + k*360] rangewhen
|
|
290
|
+
* `noWrap` is enabled to the [-180; 180] range expected for values of the c8y_Position fragment.
|
|
291
|
+
*
|
|
292
|
+
* @param lng Longitude to shift.
|
|
293
|
+
* @returns Longitude value in the [-180; 180] range
|
|
294
|
+
*/
|
|
295
|
+
normalizeLongitude(lng) {
|
|
296
|
+
return ((((lng + 180) % 360) + 360) % 360) - 180;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Shifts longitudes in the [-180; 180] range expected for values of the c8y_Position fragment
|
|
300
|
+
* the the [-180 - k*360; 180 + k*360] range expected from Leaflet.js when `noWrap` is enabled.
|
|
301
|
+
*
|
|
302
|
+
* The method naively adds/subtracts 360 degrees to the original value until the position fits in the expected bounds.
|
|
303
|
+
*
|
|
304
|
+
* @param pmo A managed object with a `c8y_Position` fragment
|
|
305
|
+
* @param bounds The bounds where the position should fit
|
|
306
|
+
* @returns A managed object whose `c8y_Position`'s `lng` values has been shifted to fit in bounds
|
|
307
|
+
*/
|
|
308
|
+
denormalizePMO(pmo, bounds) {
|
|
309
|
+
let { lng } = pmo.c8y_Position;
|
|
310
|
+
const shiftFactor = lng > bounds.getEast() ? -1 : 1;
|
|
311
|
+
while (!bounds.contains(latLng(pmo.c8y_Position.lat, lng))) {
|
|
312
|
+
lng += shiftFactor * 360;
|
|
313
|
+
}
|
|
314
|
+
pmo.c8y_Position.lng = lng;
|
|
315
|
+
return pmo;
|
|
316
|
+
}
|
|
250
317
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: MapService, deps: [{ token: i1.InventoryService }, { token: i1$1.OptionsService }, { token: i1$1.ServiceRegistry }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
251
318
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: MapService, providedIn: 'root' }); }
|
|
252
319
|
}
|
|
@@ -390,6 +457,7 @@ class MapComponent {
|
|
|
390
457
|
this.onInit = new EventEmitter();
|
|
391
458
|
this.unsubscribeTrigger$ = new Subject();
|
|
392
459
|
this.destroy$ = new Subject();
|
|
460
|
+
this.markerTitle = gettext('Marker at position {{lat}}, {{lng}}');
|
|
393
461
|
this.initOutputs();
|
|
394
462
|
}
|
|
395
463
|
startRealtime() {
|
|
@@ -440,8 +508,10 @@ class MapComponent {
|
|
|
440
508
|
return;
|
|
441
509
|
}
|
|
442
510
|
const icon = this.getAssetIcon(asset);
|
|
511
|
+
const { lat, lng } = asset.c8y_Position;
|
|
443
512
|
const leafletMarker = this.leaflet.marker(this.geo.getLatLong(asset), {
|
|
444
|
-
icon
|
|
513
|
+
icon,
|
|
514
|
+
title: this.translateService.instant(this.markerTitle, { lat, lng })
|
|
445
515
|
});
|
|
446
516
|
const marker = getC8yMarker(leafletMarker, asset);
|
|
447
517
|
this.bindPopup(marker, asset);
|
|
@@ -452,7 +522,11 @@ class MapComponent {
|
|
|
452
522
|
return;
|
|
453
523
|
}
|
|
454
524
|
const icon = this.getTrackingIcon();
|
|
455
|
-
const
|
|
525
|
+
const { lat, lng } = event.c8y_Position;
|
|
526
|
+
const leafletMarker = this.leaflet.marker(this.geo.getLatLong(event), {
|
|
527
|
+
icon,
|
|
528
|
+
title: this.translateService.instant(this.markerTitle, { lat, lng })
|
|
529
|
+
});
|
|
456
530
|
const marker = getC8yMarker(leafletMarker, null, event);
|
|
457
531
|
this.bindPopup(marker, event);
|
|
458
532
|
return marker;
|
|
@@ -568,13 +642,15 @@ class MapComponent {
|
|
|
568
642
|
const defaultOptions = {
|
|
569
643
|
center: this.config.center || defaultConfig.center,
|
|
570
644
|
zoomSnap: 0,
|
|
571
|
-
zoom: this.config.zoomLevel || defaultConfig.zoomLevel
|
|
645
|
+
zoom: this.config.zoomLevel || defaultConfig.zoomLevel,
|
|
646
|
+
worldCopyJump: true
|
|
572
647
|
};
|
|
573
648
|
if (this.map) {
|
|
574
649
|
this.map.remove();
|
|
575
650
|
}
|
|
576
651
|
this.map = this.leaflet.map(this.mapElement.nativeElement, defaultOptions);
|
|
577
652
|
this.map.attributionControl.setPrefix('');
|
|
653
|
+
this.fitBounds(this.config.bounds);
|
|
578
654
|
this.addLayers(layers);
|
|
579
655
|
this.handleMobile();
|
|
580
656
|
this.onMap.next(this.map);
|
|
@@ -1040,6 +1116,7 @@ class MapStatusComponent {
|
|
|
1040
1116
|
this.onUnfollow = new EventEmitter();
|
|
1041
1117
|
this.buttonsConfig = {};
|
|
1042
1118
|
this.centerMapButtonDisabled = true;
|
|
1119
|
+
this.refreshPaused = false;
|
|
1043
1120
|
this.destroy$ = new Subject();
|
|
1044
1121
|
}
|
|
1045
1122
|
ngOnInit() {
|
|
@@ -1072,6 +1149,17 @@ class MapStatusComponent {
|
|
|
1072
1149
|
};
|
|
1073
1150
|
this.configChange.emit(this.config);
|
|
1074
1151
|
}
|
|
1152
|
+
toggleAutoRefresh($event) {
|
|
1153
|
+
$event.preventDefault();
|
|
1154
|
+
$event.stopPropagation();
|
|
1155
|
+
this.refreshPaused = !this.refreshPaused;
|
|
1156
|
+
if (this.refreshPaused) {
|
|
1157
|
+
this.countdownIntervalComp.stop(true);
|
|
1158
|
+
}
|
|
1159
|
+
else {
|
|
1160
|
+
this.countdownIntervalComp.start();
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1075
1163
|
unfollow() {
|
|
1076
1164
|
this.config = {
|
|
1077
1165
|
...this.clusterMap.config,
|
|
@@ -1118,11 +1206,11 @@ class MapStatusComponent {
|
|
|
1118
1206
|
};
|
|
1119
1207
|
}
|
|
1120
1208
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: MapStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1121
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: MapStatusComponent, selector: "c8y-map-status", inputs: { config: "config", clusterMap: "clusterMap", buttonsConfig: "buttonsConfig" }, outputs: { configChange: "configChange", onUnfollow: "onUnfollow" }, viewQueries: [{ propertyName: "countdownIntervalComp", first: true, predicate: CountdownIntervalComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <
|
|
1209
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: MapStatusComponent, selector: "c8y-map-status", inputs: { config: "config", clusterMap: "clusterMap", buttonsConfig: "buttonsConfig" }, outputs: { configChange: "configChange", onUnfollow: "onUnfollow" }, viewQueries: [{ propertyName: "countdownIntervalComp", first: true, predicate: CountdownIntervalComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <label\n class=\"toggle-countdown vertical\"\n [attr.aria-label]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n [tooltip]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n placement=\"left\"\n *ngIf=\"\n !config.widgetInstanceGlobalAutoRefreshContext &&\n clusterMap?.config.refreshInterval &&\n !clusterMap?.config.follow\n \"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"1000\"\n >\n <input\n type=\"checkbox\"\n (click)=\"toggleAutoRefresh($event)\"\n />\n <c8y-countdown-interval\n [hidden]=\"refreshPaused\"\n [countdownInterval]=\"clusterMap?.config.refreshInterval\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"refreshPaused\"\n ></i>\n </label>\n\n <button\n title=\"{{ 'Cancel reload' | translate }}\"\n type=\"button\"\n *ngIf=\"(clusterMap?.isLoading$ | async) && !config.widgetInstanceGlobalAutoRefreshContext\"\n (click)=\"cancelReload()\"\n >\n <i\n class=\"icon-spin\"\n c8yIcon=\"refresh\"\n ></i>\n </button>\n <button\n [title]=\"'Reload' | translate\"\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime &&\n !clusterMap?.assets &&\n !(clusterMap?.isLoading$ | async) &&\n !config.widgetInstanceGlobalAutoRefreshContext\n \"\n (click)=\"reload()\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n title=\"{{ 'Center map' | translate }}\"\n type=\"button\"\n (click)=\"center()\"\n [disabled]=\"centerMapButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n title=\"{{ 'Unfollow' | translate }}\"\n type=\"button\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n title=\"{{ 'Follow' | translate }}\"\n type=\"button\"\n *ngIf=\"initConfig.follow && !clusterMap?.config.follow\"\n (click)=\"follow()\"\n >\n <i c8yIcon=\"marker\"></i>\n </button>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: i1$1.CountdownIntervalComponent, selector: "c8y-countdown-interval", inputs: ["countdownInterval"], outputs: ["countdownEnded"] }, { kind: "directive", type: i3$1.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }] }); }
|
|
1122
1210
|
}
|
|
1123
1211
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: MapStatusComponent, decorators: [{
|
|
1124
1212
|
type: Component,
|
|
1125
|
-
args: [{ selector: 'c8y-map-status', template: "<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <
|
|
1213
|
+
args: [{ selector: 'c8y-map-status', template: "<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <label\n class=\"toggle-countdown vertical\"\n [attr.aria-label]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n [tooltip]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n placement=\"left\"\n *ngIf=\"\n !config.widgetInstanceGlobalAutoRefreshContext &&\n clusterMap?.config.refreshInterval &&\n !clusterMap?.config.follow\n \"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"1000\"\n >\n <input\n type=\"checkbox\"\n (click)=\"toggleAutoRefresh($event)\"\n />\n <c8y-countdown-interval\n [hidden]=\"refreshPaused\"\n [countdownInterval]=\"clusterMap?.config.refreshInterval\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"refreshPaused\"\n ></i>\n </label>\n\n <button\n title=\"{{ 'Cancel reload' | translate }}\"\n type=\"button\"\n *ngIf=\"(clusterMap?.isLoading$ | async) && !config.widgetInstanceGlobalAutoRefreshContext\"\n (click)=\"cancelReload()\"\n >\n <i\n class=\"icon-spin\"\n c8yIcon=\"refresh\"\n ></i>\n </button>\n <button\n [title]=\"'Reload' | translate\"\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime &&\n !clusterMap?.assets &&\n !(clusterMap?.isLoading$ | async) &&\n !config.widgetInstanceGlobalAutoRefreshContext\n \"\n (click)=\"reload()\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n title=\"{{ 'Center map' | translate }}\"\n type=\"button\"\n (click)=\"center()\"\n [disabled]=\"centerMapButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n title=\"{{ 'Unfollow' | translate }}\"\n type=\"button\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n title=\"{{ 'Follow' | translate }}\"\n type=\"button\"\n *ngIf=\"initConfig.follow && !clusterMap?.config.follow\"\n (click)=\"follow()\"\n >\n <i c8yIcon=\"marker\"></i>\n </button>\n </div>\n </div>\n</div>\n" }]
|
|
1126
1214
|
}], propDecorators: { config: [{
|
|
1127
1215
|
type: Input
|
|
1128
1216
|
}], configChange: [{
|
|
@@ -1140,7 +1228,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
1140
1228
|
|
|
1141
1229
|
class MapModule {
|
|
1142
1230
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: MapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1143
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.9", ngImport: i0, type: MapModule, declarations: [MapComponent, MapStatusComponent, ClusterMapComponent, MapPopupDirective], imports: [CommonModule,
|
|
1231
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.9", ngImport: i0, type: MapModule, declarations: [MapComponent, MapStatusComponent, ClusterMapComponent, MapPopupDirective], imports: [CommonModule,
|
|
1232
|
+
FormsModule,
|
|
1233
|
+
CommonModule$1,
|
|
1234
|
+
FormsModule$1,
|
|
1235
|
+
RealtimeModule,
|
|
1236
|
+
CoreModule,
|
|
1237
|
+
TooltipModule], exports: [MapComponent, MapStatusComponent, ClusterMapComponent, MapPopupDirective] }); }
|
|
1144
1238
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: MapModule, providers: [
|
|
1145
1239
|
{
|
|
1146
1240
|
provide: MAP_TILE_LAYER,
|
|
@@ -1156,13 +1250,27 @@ class MapModule {
|
|
|
1156
1250
|
},
|
|
1157
1251
|
deps: [MapService]
|
|
1158
1252
|
}
|
|
1159
|
-
], imports: [CommonModule,
|
|
1253
|
+
], imports: [CommonModule,
|
|
1254
|
+
FormsModule,
|
|
1255
|
+
CommonModule$1,
|
|
1256
|
+
FormsModule$1,
|
|
1257
|
+
RealtimeModule,
|
|
1258
|
+
CoreModule,
|
|
1259
|
+
TooltipModule] }); }
|
|
1160
1260
|
}
|
|
1161
1261
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: MapModule, decorators: [{
|
|
1162
1262
|
type: NgModule,
|
|
1163
1263
|
args: [{
|
|
1164
1264
|
declarations: [MapComponent, MapStatusComponent, ClusterMapComponent, MapPopupDirective],
|
|
1165
|
-
imports: [
|
|
1265
|
+
imports: [
|
|
1266
|
+
CommonModule,
|
|
1267
|
+
FormsModule,
|
|
1268
|
+
CommonModule$1,
|
|
1269
|
+
FormsModule$1,
|
|
1270
|
+
RealtimeModule,
|
|
1271
|
+
CoreModule,
|
|
1272
|
+
TooltipModule
|
|
1273
|
+
],
|
|
1166
1274
|
exports: [MapComponent, MapStatusComponent, ClusterMapComponent, MapPopupDirective],
|
|
1167
1275
|
providers: [
|
|
1168
1276
|
{
|