@c8y/ngx-components 1018.503.1 → 1018.503.23
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/core/common/ApplicationOptions.d.ts +4 -2
- package/core/common/files.service.d.ts +10 -2
- package/core/common/global-config.service.d.ts +1 -1
- package/core/common/permissions.service.d.ts +69 -2
- package/core/common/tenant-ui.service.d.ts +1 -1
- package/core/i18n/pattern-messages.data.d.ts +20 -20
- package/esm2020/assets-navigator/asset-node.service.mjs +11 -4
- package/esm2020/auth-configuration/auth-configuration.guard.mjs +5 -2
- package/esm2020/auth-configuration/factories/navigation.factory.mjs +3 -3
- package/esm2020/cockpit-config/cockpit-config.guard.mjs +2 -2
- package/esm2020/cockpit-config/cockpit-config.service.mjs +2 -2
- package/esm2020/context-dashboard/add-dashboard.factory.mjs +13 -3
- package/esm2020/context-dashboard/context-dashboard.component.mjs +2 -2
- package/esm2020/context-dashboard/context-dashboard.service.mjs +11 -3
- package/esm2020/context-dashboard/dashboard-detail.component.mjs +7 -2
- package/esm2020/context-dashboard/report-dashboard/report-dashboard-list.component.mjs +5 -3
- package/esm2020/core/bottom-drawer/bottom-drawer.service.mjs +1 -1
- package/esm2020/core/common/ApplicationOptions.mjs +1 -1
- package/esm2020/core/common/files.service.mjs +20 -4
- package/esm2020/core/common/global-config.service.mjs +7 -2
- package/esm2020/core/common/permissions.service.mjs +69 -2
- package/esm2020/core/common/tenant-ui.service.mjs +3 -2
- package/esm2020/core/common/user-preferences/user-preferences.service.mjs +10 -2
- package/esm2020/core/docs/support-outlet/support-outlet.component.mjs +3 -2
- package/esm2020/core/drop-area/drop-area.component.mjs +3 -1
- package/esm2020/core/i18n/pattern-messages.data.mjs +21 -21
- package/esm2020/core/setup/setup.service.mjs +2 -2
- package/esm2020/core/user/user-edit.component.mjs +1 -1
- package/esm2020/ecosystem/application-properties/application-properties.component.mjs +2 -2
- package/esm2020/ecosystem/application-properties/subscription-modal/subscription-modal.component.mjs +3 -3
- package/esm2020/ecosystem/ecosystem-navigation.factory.mjs +3 -3
- package/esm2020/ecosystem/packages/package-list/packages-list.component.mjs +2 -2
- package/esm2020/ecosystem/packages/package-versions/package-versions-list/package-versions-list.component.mjs +2 -2
- package/esm2020/files-repository/files-repository.guard.mjs +6 -3
- package/esm2020/location/location.component.mjs +20 -13
- package/esm2020/map/cluster-map.component.mjs +19 -11
- package/esm2020/map/cluster-map.mjs +8 -3
- package/esm2020/map/map-status.component.mjs +19 -5
- package/esm2020/map/map.component.mjs +10 -10
- package/esm2020/map/map.model.mjs +1 -19
- package/esm2020/map/map.service.mjs +24 -1
- package/esm2020/protocol-lwm2m/components/bootstrap-parameters/lwm2m-bootstrap-parameters.component.mjs +2 -2
- package/esm2020/protocol-lwm2m/components/configuration/typed-forms/form-wrapper-base.component.mjs +2 -2
- package/esm2020/register-device/register-device-navigation.factory.mjs +3 -3
- package/esm2020/replace-device/replace-device.service.mjs +15 -7
- package/esm2020/reports/export-schedules.component.mjs +3 -3
- package/esm2020/repository/configuration/device-tab/configuration-preview.component.mjs +14 -6
- package/esm2020/sms-gateway/sms-gateway.guard.mjs +2 -2
- package/esm2020/sms-gateway/sms-gateway.module.mjs +6 -6
- package/esm2020/sub-assets/add-group/add-group.component.mjs +7 -2
- package/esm2020/sub-assets/asset-properties-item.component.mjs +6 -6
- package/esm2020/sub-assets/groups.component.mjs +5 -2
- package/esm2020/sub-assets/sub-assets.component.mjs +7 -2
- package/esm2020/sub-assets/sub-assets.service.mjs +22 -10
- package/esm2020/tenants/tenant-list/tenant-list.component.mjs +12 -7
- package/esm2020/upgrade/ng1/downgraded.services.mjs +3 -2
- package/esm2020/upgrade/ng1/index.mjs +4 -3
- package/esm2020/widgets/cockpit/index.mjs +1 -1
- package/esm2020/widgets/device-management/index.mjs +1 -1
- package/fesm2015/c8y-ngx-components-assets-navigator.mjs +10 -3
- package/fesm2015/c8y-ngx-components-assets-navigator.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-auth-configuration.mjs +7 -4
- package/fesm2015/c8y-ngx-components-auth-configuration.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-cockpit-config.mjs +3 -3
- package/fesm2015/c8y-ngx-components-cockpit-config.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-context-dashboard.mjs +35 -10
- package/fesm2015/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-ecosystem.mjs +8 -8
- package/fesm2015/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-files-repository.mjs +6 -3
- package/fesm2015/c8y-ngx-components-files-repository.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-location.mjs +20 -13
- package/fesm2015/c8y-ngx-components-location.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-map.mjs +174 -142
- package/fesm2015/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-protocol-lwm2m-components-bootstrap-parameters.mjs +2 -2
- package/fesm2015/c8y-ngx-components-protocol-lwm2m-components-bootstrap-parameters.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-protocol-lwm2m-components-configuration.mjs +1 -1
- package/fesm2015/c8y-ngx-components-protocol-lwm2m-components-configuration.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-register-device.mjs +3 -3
- package/fesm2015/c8y-ngx-components-register-device.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-replace-device.mjs +16 -8
- package/fesm2015/c8y-ngx-components-replace-device.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-reports.mjs +2 -2
- package/fesm2015/c8y-ngx-components-reports.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-repository-configuration.mjs +13 -5
- package/fesm2015/c8y-ngx-components-repository-configuration.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-sms-gateway.mjs +6 -6
- package/fesm2015/c8y-ngx-components-sms-gateway.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-sub-assets.mjs +43 -18
- package/fesm2015/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-tenants.mjs +11 -6
- package/fesm2015/c8y-ngx-components-tenants.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-upgrade.mjs +4 -2
- package/fesm2015/c8y-ngx-components-upgrade.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-widgets-cockpit.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components-widgets-device-management.mjs.map +1 -1
- package/fesm2015/c8y-ngx-components.mjs +126 -29
- package/fesm2015/c8y-ngx-components.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-assets-navigator.mjs +10 -3
- package/fesm2020/c8y-ngx-components-assets-navigator.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-auth-configuration.mjs +7 -4
- package/fesm2020/c8y-ngx-components-auth-configuration.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-cockpit-config.mjs +3 -3
- package/fesm2020/c8y-ngx-components-cockpit-config.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-context-dashboard.mjs +35 -10
- package/fesm2020/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-ecosystem.mjs +8 -8
- package/fesm2020/c8y-ngx-components-ecosystem.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-files-repository.mjs +6 -3
- package/fesm2020/c8y-ngx-components-files-repository.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-location.mjs +20 -13
- package/fesm2020/c8y-ngx-components-location.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-map.mjs +174 -142
- package/fesm2020/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-protocol-lwm2m-components-bootstrap-parameters.mjs +2 -2
- package/fesm2020/c8y-ngx-components-protocol-lwm2m-components-bootstrap-parameters.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-protocol-lwm2m-components-configuration.mjs +1 -1
- package/fesm2020/c8y-ngx-components-protocol-lwm2m-components-configuration.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-register-device.mjs +3 -3
- package/fesm2020/c8y-ngx-components-register-device.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-replace-device.mjs +16 -8
- package/fesm2020/c8y-ngx-components-replace-device.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-reports.mjs +2 -2
- package/fesm2020/c8y-ngx-components-reports.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-repository-configuration.mjs +13 -5
- package/fesm2020/c8y-ngx-components-repository-configuration.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-sms-gateway.mjs +6 -6
- package/fesm2020/c8y-ngx-components-sms-gateway.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-sub-assets.mjs +43 -18
- package/fesm2020/c8y-ngx-components-sub-assets.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-tenants.mjs +11 -6
- package/fesm2020/c8y-ngx-components-tenants.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-upgrade.mjs +4 -2
- package/fesm2020/c8y-ngx-components-upgrade.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-widgets-cockpit.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-widgets-device-management.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components.mjs +126 -29
- package/fesm2020/c8y-ngx-components.mjs.map +1 -1
- package/locales/locales.pot +3 -0
- package/location/location.component.d.ts +2 -2
- package/map/cluster-map.component.d.ts +3 -1
- package/map/map-status.component.d.ts +12 -1
- package/map/map.component.d.ts +1 -1
- package/map/map.model.d.ts +0 -1
- package/map/map.service.d.ts +6 -0
- package/package.json +1 -1
- package/replace-device/replace-device.service.d.ts +3 -1
- package/tenants/tenant-list/tenant-list.component.d.ts +4 -2
- package/upgrade/ng1/downgraded.services.d.ts +1 -0
- package/widgets/cockpit/index.d.ts +2 -1
- package/widgets/device-management/index.d.ts +2 -1
|
@@ -1,36 +1,18 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken,
|
|
3
|
+
import { InjectionToken, Injectable, Directive, EventEmitter, Component, Inject, ViewChild, ContentChild, Input, Output, SimpleChange, NgModule } from '@angular/core';
|
|
4
4
|
import * as i1$1 from '@c8y/ngx-components';
|
|
5
5
|
import { gettext, sortByPriority, ManagedObjectRealtimeService, CommonModule as CommonModule$1, FormsModule as FormsModule$1, RealtimeModule } from '@c8y/ngx-components';
|
|
6
6
|
import * as i4 from 'rxjs';
|
|
7
7
|
import { from, Subject, combineLatest, fromEvent, BehaviorSubject, NEVER, interval, of, merge } from 'rxjs';
|
|
8
|
-
import { map, first, takeUntil, switchMap, tap, filter,
|
|
9
|
-
import { isUndefined, flatten, cloneDeep } from 'lodash-es';
|
|
8
|
+
import { map, first, takeUntil, switchMap, tap, filter, mergeMap, debounceTime } from 'rxjs/operators';
|
|
10
9
|
import * as i1 from '@c8y/client';
|
|
10
|
+
import { isUndefined, flatten, cloneDeep } from 'lodash-es';
|
|
11
11
|
import * as i3 from '@ngx-translate/core';
|
|
12
12
|
import * as i1$2 from '@angular/common';
|
|
13
13
|
import { CommonModule } from '@angular/common';
|
|
14
14
|
import { FormsModule } from '@angular/forms';
|
|
15
15
|
|
|
16
|
-
function getStatus(device) {
|
|
17
|
-
if (!device.c8y_ActiveAlarmsStatus) {
|
|
18
|
-
return 'text-primary';
|
|
19
|
-
}
|
|
20
|
-
if (device.c8y_ActiveAlarmsStatus.critical) {
|
|
21
|
-
return 'status critical';
|
|
22
|
-
}
|
|
23
|
-
if (device.c8y_ActiveAlarmsStatus.major) {
|
|
24
|
-
return 'status major';
|
|
25
|
-
}
|
|
26
|
-
if (device.c8y_ActiveAlarmsStatus.warning) {
|
|
27
|
-
return 'status warning';
|
|
28
|
-
}
|
|
29
|
-
if (device.c8y_ActiveAlarmsStatus.minor) {
|
|
30
|
-
return 'status minor';
|
|
31
|
-
}
|
|
32
|
-
return 'text-primary';
|
|
33
|
-
}
|
|
34
16
|
function getC8yMarker(marker, asset) {
|
|
35
17
|
marker.asset = asset;
|
|
36
18
|
return marker;
|
|
@@ -64,110 +46,30 @@ const defaultMapConfig = {
|
|
|
64
46
|
zoomLevel: 2
|
|
65
47
|
};
|
|
66
48
|
|
|
67
|
-
class
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (this._rect) {
|
|
77
|
-
this._rect.remove();
|
|
49
|
+
class MapService {
|
|
50
|
+
/**
|
|
51
|
+
* Returns asset icon status for highest alarm severity found in device object.
|
|
52
|
+
* @param device Device that contains alarms information.
|
|
53
|
+
* @returns Status string according to alarm severity
|
|
54
|
+
*/
|
|
55
|
+
static getStatus(device) {
|
|
56
|
+
if (!device.c8y_ActiveAlarmsStatus) {
|
|
57
|
+
return 'text-muted';
|
|
78
58
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
get rect() {
|
|
82
|
-
return this._rect;
|
|
83
|
-
}
|
|
84
|
-
constructor(iterable, addAssetCallback, translateService) {
|
|
85
|
-
this.iterable = iterable;
|
|
86
|
-
this.addAssetCallback = addAssetCallback;
|
|
87
|
-
this.translateService = translateService;
|
|
88
|
-
this.markers = [];
|
|
89
|
-
this.positions = [];
|
|
90
|
-
this.iterableDiffer = this.iterable.find(this.positions).create(this.trackBy);
|
|
91
|
-
}
|
|
92
|
-
render(map) {
|
|
93
|
-
if (this._rect) {
|
|
94
|
-
this._rect.addTo(map);
|
|
59
|
+
if (device.c8y_ActiveAlarmsStatus.critical) {
|
|
60
|
+
return 'status critical';
|
|
95
61
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
this._clusterMarker.addTo(map);
|
|
62
|
+
if (device.c8y_ActiveAlarmsStatus.major) {
|
|
63
|
+
return 'status major';
|
|
99
64
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.removeClusterToBigMarker();
|
|
103
|
-
this._rect.remove();
|
|
104
|
-
this.positions = [];
|
|
105
|
-
this.updateChanges(map);
|
|
106
|
-
}
|
|
107
|
-
removeClusterToBigMarker() {
|
|
108
|
-
if (this._clusterMarker) {
|
|
109
|
-
this._clusterMarker.remove();
|
|
110
|
-
this._clusterMarker = null;
|
|
65
|
+
if (device.c8y_ActiveAlarmsStatus.minor) {
|
|
66
|
+
return 'status minor';
|
|
111
67
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const marker = this.addAssetCallback(device);
|
|
115
|
-
this.markers.push(marker);
|
|
116
|
-
marker.addTo(map);
|
|
117
|
-
}
|
|
118
|
-
setClusterToBigMarker(map, count, leaflet) {
|
|
119
|
-
const bound = this.rect.getBounds();
|
|
120
|
-
const text = this.translateService.instant(gettext('Zoom in'));
|
|
121
|
-
const divMarker = leaflet.divIcon({
|
|
122
|
-
html: `<div class="c8y-map-marker-count" data-count="${count}" title="${text}"></div>`
|
|
123
|
-
});
|
|
124
|
-
const labelIcon = leaflet.marker(bound.getCenter(), {
|
|
125
|
-
icon: divMarker
|
|
126
|
-
});
|
|
127
|
-
labelIcon.addTo(map);
|
|
128
|
-
labelIcon.on('click', () => {
|
|
129
|
-
map.fitBounds(bound);
|
|
130
|
-
});
|
|
131
|
-
this.clusterMarker = labelIcon;
|
|
132
|
-
}
|
|
133
|
-
updateChanges(map) {
|
|
134
|
-
const changes = this.iterableDiffer.diff(this.positions);
|
|
135
|
-
if (changes) {
|
|
136
|
-
changes.forEachRemovedItem((record) => {
|
|
137
|
-
this.removeMarkerFromMap(record.item);
|
|
138
|
-
});
|
|
139
|
-
changes.forEachAddedItem((record) => {
|
|
140
|
-
this.addMarkerToMap(record.item, map);
|
|
141
|
-
});
|
|
68
|
+
if (device.c8y_ActiveAlarmsStatus.warning) {
|
|
69
|
+
return 'status warning';
|
|
142
70
|
}
|
|
71
|
+
return 'text-muted';
|
|
143
72
|
}
|
|
144
|
-
trackBy(index, item) {
|
|
145
|
-
const trackItems = [item.id, item.c8y_Position.lat, item.c8y_Position.lng, getStatus(item)];
|
|
146
|
-
return trackItems.join('');
|
|
147
|
-
}
|
|
148
|
-
removeMarkerFromMap(device) {
|
|
149
|
-
const markers = this.markers.filter((marker) => { var _a; return ((_a = marker.asset) === null || _a === void 0 ? void 0 : _a.id) === device.id; });
|
|
150
|
-
markers.forEach(marker => marker.remove());
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
class MapPopupDirective {
|
|
155
|
-
constructor(template, elementRef, viewContainer) {
|
|
156
|
-
this.template = template;
|
|
157
|
-
this.elementRef = elementRef;
|
|
158
|
-
this.viewContainer = viewContainer;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
MapPopupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapPopupDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
162
|
-
MapPopupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: MapPopupDirective, selector: "[c8yMapPopup]", ngImport: i0 });
|
|
163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapPopupDirective, decorators: [{
|
|
164
|
-
type: Directive,
|
|
165
|
-
args: [{
|
|
166
|
-
selector: '[c8yMapPopup]'
|
|
167
|
-
}]
|
|
168
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }]; } });
|
|
169
|
-
|
|
170
|
-
class MapService {
|
|
171
73
|
/**
|
|
172
74
|
* @ignore: Only DI.
|
|
173
75
|
*/
|
|
@@ -332,6 +234,114 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
332
234
|
}]
|
|
333
235
|
}], ctorParameters: function () { return [{ type: i1.InventoryService }, { type: i1$1.OptionsService }]; } });
|
|
334
236
|
|
|
237
|
+
class ClusterMap {
|
|
238
|
+
set clusterMarker(item) {
|
|
239
|
+
this.removeClusterToBigMarker();
|
|
240
|
+
this._clusterMarker = item;
|
|
241
|
+
}
|
|
242
|
+
get clusterMarker() {
|
|
243
|
+
return this._clusterMarker;
|
|
244
|
+
}
|
|
245
|
+
set rect(item) {
|
|
246
|
+
if (this._rect) {
|
|
247
|
+
this._rect.remove();
|
|
248
|
+
}
|
|
249
|
+
this._rect = item;
|
|
250
|
+
}
|
|
251
|
+
get rect() {
|
|
252
|
+
return this._rect;
|
|
253
|
+
}
|
|
254
|
+
constructor(iterable, addAssetCallback, translateService) {
|
|
255
|
+
this.iterable = iterable;
|
|
256
|
+
this.addAssetCallback = addAssetCallback;
|
|
257
|
+
this.translateService = translateService;
|
|
258
|
+
this.markers = [];
|
|
259
|
+
this.positions = [];
|
|
260
|
+
this.iterableDiffer = this.iterable.find(this.positions).create(this.trackBy);
|
|
261
|
+
}
|
|
262
|
+
render(map) {
|
|
263
|
+
if (this._rect) {
|
|
264
|
+
this._rect.addTo(map);
|
|
265
|
+
}
|
|
266
|
+
this.updateChanges(map);
|
|
267
|
+
if (this._clusterMarker) {
|
|
268
|
+
this._clusterMarker.addTo(map);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
clear(map) {
|
|
272
|
+
this.removeClusterToBigMarker();
|
|
273
|
+
this._rect.remove();
|
|
274
|
+
this.positions = [];
|
|
275
|
+
this.updateChanges(map);
|
|
276
|
+
}
|
|
277
|
+
removeClusterToBigMarker() {
|
|
278
|
+
if (this._clusterMarker) {
|
|
279
|
+
this._clusterMarker.remove();
|
|
280
|
+
this._clusterMarker = null;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
addMarkerToMap(device, map) {
|
|
284
|
+
const marker = this.addAssetCallback(device);
|
|
285
|
+
this.markers.push(marker);
|
|
286
|
+
marker.addTo(map);
|
|
287
|
+
}
|
|
288
|
+
setClusterToBigMarker(map, count, leaflet) {
|
|
289
|
+
const bound = this.rect.getBounds();
|
|
290
|
+
const text = this.translateService.instant(gettext('Zoom in'));
|
|
291
|
+
const divMarker = leaflet.divIcon({
|
|
292
|
+
html: `<div class="c8y-map-marker-count" data-count="${count}" title="${text}"></div>`
|
|
293
|
+
});
|
|
294
|
+
const labelIcon = leaflet.marker(bound.getCenter(), {
|
|
295
|
+
icon: divMarker
|
|
296
|
+
});
|
|
297
|
+
labelIcon.addTo(map);
|
|
298
|
+
labelIcon.on('click', () => {
|
|
299
|
+
map.fitBounds(bound);
|
|
300
|
+
});
|
|
301
|
+
this.clusterMarker = labelIcon;
|
|
302
|
+
}
|
|
303
|
+
updateChanges(map) {
|
|
304
|
+
const changes = this.iterableDiffer.diff(this.positions);
|
|
305
|
+
if (changes) {
|
|
306
|
+
changes.forEachRemovedItem((record) => {
|
|
307
|
+
this.removeMarkerFromMap(record.item);
|
|
308
|
+
});
|
|
309
|
+
changes.forEachAddedItem((record) => {
|
|
310
|
+
this.addMarkerToMap(record.item, map);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
trackBy(index, item) {
|
|
315
|
+
const trackItems = [
|
|
316
|
+
item.id,
|
|
317
|
+
item.c8y_Position.lat,
|
|
318
|
+
item.c8y_Position.lng,
|
|
319
|
+
MapService.getStatus(item)
|
|
320
|
+
];
|
|
321
|
+
return trackItems.join('');
|
|
322
|
+
}
|
|
323
|
+
removeMarkerFromMap(device) {
|
|
324
|
+
const markers = this.markers.filter((marker) => { var _a; return ((_a = marker.asset) === null || _a === void 0 ? void 0 : _a.id) === device.id; });
|
|
325
|
+
markers.forEach(marker => marker.remove());
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
class MapPopupDirective {
|
|
330
|
+
constructor(template, elementRef, viewContainer) {
|
|
331
|
+
this.template = template;
|
|
332
|
+
this.elementRef = elementRef;
|
|
333
|
+
this.viewContainer = viewContainer;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
MapPopupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapPopupDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
337
|
+
MapPopupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: MapPopupDirective, selector: "[c8yMapPopup]", ngImport: i0 });
|
|
338
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapPopupDirective, decorators: [{
|
|
339
|
+
type: Directive,
|
|
340
|
+
args: [{
|
|
341
|
+
selector: '[c8yMapPopup]'
|
|
342
|
+
}]
|
|
343
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }]; } });
|
|
344
|
+
|
|
335
345
|
class MapComponent {
|
|
336
346
|
constructor(moRealtimeService, mapService, layers$, defaultConfig$, translateService) {
|
|
337
347
|
this.moRealtimeService = moRealtimeService;
|
|
@@ -354,7 +364,7 @@ class MapComponent {
|
|
|
354
364
|
this.onZoomEnd = new EventEmitter();
|
|
355
365
|
this.onRealtimeUpdate = new EventEmitter();
|
|
356
366
|
this.onInit = new EventEmitter();
|
|
357
|
-
this.
|
|
367
|
+
this.unsubscribeTrigger$ = new Subject();
|
|
358
368
|
}
|
|
359
369
|
startRealtime() {
|
|
360
370
|
if (!this.assets || (Array.isArray(this.assets) && this.assets.length > 1)) {
|
|
@@ -429,7 +439,7 @@ class MapComponent {
|
|
|
429
439
|
getAssetIcon(asset) {
|
|
430
440
|
var _a;
|
|
431
441
|
const assetTypeIcon = this.config.icon || ((_a = asset.icon) === null || _a === void 0 ? void 0 : _a.name);
|
|
432
|
-
const status = getStatus(asset);
|
|
442
|
+
const status = MapService.getStatus(asset);
|
|
433
443
|
const color = this.config.color ? `style='color: ${this.config.color};'` : '';
|
|
434
444
|
const icon = this.leaflet.divIcon({
|
|
435
445
|
html: `<div class="dlt-c8y-icon-marker icon-3x ${status}" ${color}><i class="dlt-c8y-icon-${assetTypeIcon || 'data-transfer'}" /></div>`,
|
|
@@ -470,7 +480,7 @@ class MapComponent {
|
|
|
470
480
|
return __awaiter(this, void 0, void 0, function* () {
|
|
471
481
|
this.leaflet = yield this.mapService.getLeaflet();
|
|
472
482
|
combineLatest([this.layers$, this.defaultConfig$])
|
|
473
|
-
.pipe(first(), takeUntil(this.
|
|
483
|
+
.pipe(first(), takeUntil(this.unsubscribeTrigger$))
|
|
474
484
|
.subscribe(([layers, defaultConfig]) => {
|
|
475
485
|
this.initMap(layers, defaultConfig);
|
|
476
486
|
this.refreshMarkers();
|
|
@@ -490,7 +500,7 @@ class MapComponent {
|
|
|
490
500
|
this.unsubscribeAllListeners();
|
|
491
501
|
}
|
|
492
502
|
unsubscribeAllListeners() {
|
|
493
|
-
this.
|
|
503
|
+
this.unsubscribeTrigger$.next();
|
|
494
504
|
this.stopRealtime();
|
|
495
505
|
}
|
|
496
506
|
initMap(layers, defaultConfig) {
|
|
@@ -507,16 +517,16 @@ class MapComponent {
|
|
|
507
517
|
this.addLayers(layers);
|
|
508
518
|
this.handleMobile();
|
|
509
519
|
fromEvent(this.map, 'moveend')
|
|
510
|
-
.pipe(takeUntil(this.
|
|
520
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
511
521
|
.subscribe(event => this.onMoveEnd.emit(event));
|
|
512
522
|
fromEvent(this.map, 'move')
|
|
513
|
-
.pipe(takeUntil(this.
|
|
523
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
514
524
|
.subscribe(event => this.onMove.emit(event));
|
|
515
525
|
fromEvent(this.map, 'zoomend')
|
|
516
|
-
.pipe(takeUntil(this.
|
|
526
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
517
527
|
.subscribe(event => this.onZoomEnd.emit(event));
|
|
518
528
|
fromEvent(this.map, 'zoomstart')
|
|
519
|
-
.pipe(takeUntil(this.
|
|
529
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
520
530
|
.subscribe(event => this.onZoomStart.emit(event));
|
|
521
531
|
this.isInit = true;
|
|
522
532
|
this.onInit.emit(this.leaflet);
|
|
@@ -733,7 +743,7 @@ class ClusterMapComponent extends MapComponent {
|
|
|
733
743
|
this.leaflet = yield this.mapService.getLeaflet();
|
|
734
744
|
}
|
|
735
745
|
combineLatest([this.layers$, this.defaultConfig$])
|
|
736
|
-
.pipe(takeUntil(this.
|
|
746
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
737
747
|
.subscribe(([layers, defaultConfig]) => {
|
|
738
748
|
this.initMap(layers, defaultConfig);
|
|
739
749
|
this.changeRootNode(this.rootNode);
|
|
@@ -753,17 +763,17 @@ class ClusterMapComponent extends MapComponent {
|
|
|
753
763
|
cancelReload() {
|
|
754
764
|
this.reloadTrigger$.next(false);
|
|
755
765
|
}
|
|
756
|
-
|
|
766
|
+
listenToClusterAndIntervalChanges() {
|
|
757
767
|
const timerStart$ = new Subject();
|
|
758
768
|
const timerEnd$ = new Subject();
|
|
759
|
-
const documentHiddenEvent$ = fromEvent(document, 'visibilitychange').pipe(takeUntil(this.
|
|
769
|
+
const documentHiddenEvent$ = fromEvent(document, 'visibilitychange').pipe(takeUntil(this.unsubscribeTrigger$));
|
|
760
770
|
const interval$ = timerStart$.pipe(map(() => this.config.refreshInterval), switchMap(configInterval => {
|
|
761
771
|
if (!configInterval) {
|
|
762
772
|
return NEVER;
|
|
763
773
|
}
|
|
764
774
|
return interval(1000).pipe(map(value => value * 1000), tap(value => this.msUntilRefresh$.next(configInterval - value)), filter(value => value >= this.MIN_INTERVAL && value >= configInterval), first(), takeUntil(timerEnd$));
|
|
765
|
-
}), switchMap(() => (document.hidden ? documentHiddenEvent$ : of(true))), takeUntil(this.
|
|
766
|
-
const mapChange$ =
|
|
775
|
+
}), switchMap(() => (document.hidden ? documentHiddenEvent$ : of(true))), takeUntil(this.unsubscribeTrigger$));
|
|
776
|
+
const mapChange$ = this.getMapChangeObservable();
|
|
767
777
|
merge(this.reloadTrigger$, mapChange$, interval$)
|
|
768
778
|
.pipe(tap(() => {
|
|
769
779
|
timerEnd$.next(true);
|
|
@@ -771,7 +781,7 @@ class ClusterMapComponent extends MapComponent {
|
|
|
771
781
|
this.isLoading$.next(true);
|
|
772
782
|
}), switchMap(value => value === false
|
|
773
783
|
? of([])
|
|
774
|
-
: from(this.mapService.getClusterSize(this.map.getBounds())).pipe(mergeMap((clusterSize) => this.getClusterRects(clusterSize, this.map.getBounds())), mergeMap(rects => this.createOrUpdateCluster(rects)))), takeUntil(this.
|
|
784
|
+
: from(this.mapService.getClusterSize(this.map.getBounds())).pipe(mergeMap((clusterSize) => this.getClusterRects(clusterSize, this.map.getBounds())), mergeMap(rects => this.createOrUpdateCluster(rects)))), takeUntil(this.unsubscribeTrigger$))
|
|
775
785
|
.subscribe((clusters) => {
|
|
776
786
|
clusters.forEach(cluster => cluster.render(this.map));
|
|
777
787
|
this.isLoading$.next(false);
|
|
@@ -779,6 +789,9 @@ class ClusterMapComponent extends MapComponent {
|
|
|
779
789
|
this.msUntilRefresh$.next(this.config.refreshInterval);
|
|
780
790
|
});
|
|
781
791
|
}
|
|
792
|
+
listenToClusterMapChanges() {
|
|
793
|
+
this.getMapChangeObservable().subscribe();
|
|
794
|
+
}
|
|
782
795
|
refreshMarkers() {
|
|
783
796
|
if (this.assets) {
|
|
784
797
|
super.refreshMarkers();
|
|
@@ -797,11 +810,13 @@ class ClusterMapComponent extends MapComponent {
|
|
|
797
810
|
if (isPositionDevice) {
|
|
798
811
|
this.assets = mo;
|
|
799
812
|
this.refreshMarkers();
|
|
800
|
-
|
|
813
|
+
this.listenToClusterMapChanges();
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
this.assets = null;
|
|
817
|
+
this.listenToClusterAndIntervalChanges();
|
|
818
|
+
this.reload();
|
|
801
819
|
}
|
|
802
|
-
this.assets = null;
|
|
803
|
-
this.listenToClusterChanges();
|
|
804
|
-
this.reload();
|
|
805
820
|
}
|
|
806
821
|
getClusterRects(levelThreshold = ClusterSize.FOUR, viewBounds, level = 0) {
|
|
807
822
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -896,6 +911,9 @@ class ClusterMapComponent extends MapComponent {
|
|
|
896
911
|
});
|
|
897
912
|
return Promise.all(updatePromise);
|
|
898
913
|
}
|
|
914
|
+
getMapChangeObservable() {
|
|
915
|
+
return merge(fromEvent(this.map, 'move'), fromEvent(this.map, 'moveend')).pipe(debounceTime(this.EVENT_THROTTLE_TIME), tap(event => this.mapChange.emit(event)), takeUntil(this.unsubscribeTrigger$));
|
|
916
|
+
}
|
|
899
917
|
}
|
|
900
918
|
ClusterMapComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ClusterMapComponent, deps: [{ token: i1$1.ManagedObjectRealtimeService }, { token: MapService }, { token: MAP_TILE_LAYER }, { token: MAP_DEFAULT_CONFIG }, { token: i3.TranslateService }, { token: i0.IterableDiffers }, { token: i1$1.ColorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
901
919
|
ClusterMapComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: ClusterMapComponent, selector: "c8y-cluster-map", inputs: { config: "config", rootNode: "rootNode", assets: ["asset", "assets"], showClusterColor: "showClusterColor" }, outputs: { mapChange: "mapChange" }, providers: [ManagedObjectRealtimeService], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"c8y-map\">\n <div #map></div>\n</div>\n<ng-content></ng-content>\n" });
|
|
@@ -928,7 +946,7 @@ class MapStatusComponent {
|
|
|
928
946
|
this.configChange = new EventEmitter();
|
|
929
947
|
this.onUnfollow = new EventEmitter();
|
|
930
948
|
this.buttonsConfig = {};
|
|
931
|
-
this.
|
|
949
|
+
this.centerMapButtonDisabled = true;
|
|
932
950
|
this.destroy$ = new Subject();
|
|
933
951
|
}
|
|
934
952
|
ngOnInit() {
|
|
@@ -972,10 +990,24 @@ class MapStatusComponent {
|
|
|
972
990
|
var _a, _b;
|
|
973
991
|
if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.center) && ((_b = event.sourceTarget) === null || _b === void 0 ? void 0 : _b.getBounds)) {
|
|
974
992
|
const bounds = event.sourceTarget.getBounds();
|
|
975
|
-
this.
|
|
993
|
+
this.centerMapButtonDisabled = this.shouldDisableCenterButton(bounds);
|
|
976
994
|
}
|
|
977
995
|
});
|
|
978
996
|
}
|
|
997
|
+
/**
|
|
998
|
+
* Checks if Center button should be disabled according to provided bounds.
|
|
999
|
+
* Provided bounds contain coordinates of current map rectangle corners.
|
|
1000
|
+
* Center button should be disabled if distance between center coordinates (from config) and center of current bounds
|
|
1001
|
+
* is less than 1/4 of bounds dimensions.
|
|
1002
|
+
* To achieve it we just need to check if center coordinates (from config) are contained in the boundaries of
|
|
1003
|
+
* current bounds shrunk by 25%.
|
|
1004
|
+
* @param bounds Current map view boundaries.
|
|
1005
|
+
* @returns True if distance between config center and current boundaries center is bigger than 1/4 of boundaries dimensions
|
|
1006
|
+
*/
|
|
1007
|
+
shouldDisableCenterButton(bounds) {
|
|
1008
|
+
const shrunkBounds = bounds.pad(-0.25);
|
|
1009
|
+
return shrunkBounds.contains(this.config.center);
|
|
1010
|
+
}
|
|
979
1011
|
defaultButtonsConfig() {
|
|
980
1012
|
return {
|
|
981
1013
|
realtime: { show: this.config.realtime || this.clusterMap.config.follow, disabled: false }
|
|
@@ -983,10 +1015,10 @@ class MapStatusComponent {
|
|
|
983
1015
|
}
|
|
984
1016
|
}
|
|
985
1017
|
MapStatusComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
986
|
-
MapStatusComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: MapStatusComponent, selector: "c8y-map-status", inputs: { config: "config", clusterMap: "clusterMap", buttonsConfig: "buttonsConfig" }, outputs: { configChange: "configChange", onUnfollow: "onUnfollow" }, 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 type=\"button\"\n title=\"{{ 'Realtime' | translate }}\"\n class=\"c8y-realtime\"\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 <button\n type=\"button\"\n class=\"time-ellapsed\"\n *ngIf=\"\n clusterMap?.config.refreshInterval &&\n (secondsUntilRefresh$ | async) &&\n !clusterMap?.config.follow\n \"\n disabled=\"disabled\"\n title=\"{{ secondsUntilRefresh$ | async }}s / {{\n clusterMap?.config.refreshInterval / 1000\n }}s\"\n [style.--timescope]=\"clusterMap?.config.refreshInterval + 1000 + 'ms'\"\n >\n <svg\n [ngClass]=\"{ 'time-on': !(clusterMap?.isLoading$ | async) }\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"15.8\"\n stroke=\"var(--c8y-brand-primary)\"\n stroke-width=\"6\"\n />\n </svg>\n\n <span>{{ secondsUntilRefresh$ | async }}</span>\n </button>\n <button\n type=\"button\"\n *ngIf=\"clusterMap?.isLoading$ | async\"\n title=\"{{ 'Cancel reload' | translate }}\"\n (click)=\"cancelReload()\"\n >\n <i\n c8yIcon=\"refresh\"\n class=\"icon-spin\"\n ></i>\n </button>\n <button\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime && !clusterMap?.assets && !(clusterMap?.isLoading$ | async)\n \"\n (click)=\"reload()\"\n [title]=\"'Reload' | translate\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n type=\"button\"\n (click)=\"center()\"\n title=\"{{ 'Center map' | translate }}\"\n [disabled]=\"
|
|
1018
|
+
MapStatusComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: MapStatusComponent, selector: "c8y-map-status", inputs: { config: "config", clusterMap: "clusterMap", buttonsConfig: "buttonsConfig" }, outputs: { configChange: "configChange", onUnfollow: "onUnfollow" }, 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 type=\"button\"\n title=\"{{ 'Realtime' | translate }}\"\n class=\"c8y-realtime\"\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 <button\n type=\"button\"\n class=\"time-ellapsed\"\n *ngIf=\"\n clusterMap?.config.refreshInterval &&\n (secondsUntilRefresh$ | async) &&\n !clusterMap?.config.follow\n \"\n disabled=\"disabled\"\n title=\"{{ secondsUntilRefresh$ | async }}s / {{\n clusterMap?.config.refreshInterval / 1000\n }}s\"\n [style.--timescope]=\"clusterMap?.config.refreshInterval + 1000 + 'ms'\"\n >\n <svg\n [ngClass]=\"{ 'time-on': !(clusterMap?.isLoading$ | async) }\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"15.8\"\n stroke=\"var(--c8y-brand-primary)\"\n stroke-width=\"6\"\n />\n </svg>\n\n <span>{{ secondsUntilRefresh$ | async }}</span>\n </button>\n <button\n type=\"button\"\n *ngIf=\"clusterMap?.isLoading$ | async\"\n title=\"{{ 'Cancel reload' | translate }}\"\n (click)=\"cancelReload()\"\n >\n <i\n c8yIcon=\"refresh\"\n class=\"icon-spin\"\n ></i>\n </button>\n <button\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime && !clusterMap?.assets && !(clusterMap?.isLoading$ | async)\n \"\n (click)=\"reload()\"\n [title]=\"'Reload' | translate\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n type=\"button\"\n (click)=\"center()\"\n title=\"{{ 'Center map' | translate }}\"\n [disabled]=\"centerMapButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n type=\"button\"\n title=\"{{ 'Unfollow' | translate }}\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n type=\"button\"\n title=\"{{ 'Follow' | translate }}\"\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: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }] });
|
|
987
1019
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapStatusComponent, decorators: [{
|
|
988
1020
|
type: Component,
|
|
989
|
-
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 type=\"button\"\n title=\"{{ 'Realtime' | translate }}\"\n class=\"c8y-realtime\"\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 <button\n type=\"button\"\n class=\"time-ellapsed\"\n *ngIf=\"\n clusterMap?.config.refreshInterval &&\n (secondsUntilRefresh$ | async) &&\n !clusterMap?.config.follow\n \"\n disabled=\"disabled\"\n title=\"{{ secondsUntilRefresh$ | async }}s / {{\n clusterMap?.config.refreshInterval / 1000\n }}s\"\n [style.--timescope]=\"clusterMap?.config.refreshInterval + 1000 + 'ms'\"\n >\n <svg\n [ngClass]=\"{ 'time-on': !(clusterMap?.isLoading$ | async) }\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"15.8\"\n stroke=\"var(--c8y-brand-primary)\"\n stroke-width=\"6\"\n />\n </svg>\n\n <span>{{ secondsUntilRefresh$ | async }}</span>\n </button>\n <button\n type=\"button\"\n *ngIf=\"clusterMap?.isLoading$ | async\"\n title=\"{{ 'Cancel reload' | translate }}\"\n (click)=\"cancelReload()\"\n >\n <i\n c8yIcon=\"refresh\"\n class=\"icon-spin\"\n ></i>\n </button>\n <button\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime && !clusterMap?.assets && !(clusterMap?.isLoading$ | async)\n \"\n (click)=\"reload()\"\n [title]=\"'Reload' | translate\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n type=\"button\"\n (click)=\"center()\"\n title=\"{{ 'Center map' | translate }}\"\n [disabled]=\"
|
|
1021
|
+
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 type=\"button\"\n title=\"{{ 'Realtime' | translate }}\"\n class=\"c8y-realtime\"\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 <button\n type=\"button\"\n class=\"time-ellapsed\"\n *ngIf=\"\n clusterMap?.config.refreshInterval &&\n (secondsUntilRefresh$ | async) &&\n !clusterMap?.config.follow\n \"\n disabled=\"disabled\"\n title=\"{{ secondsUntilRefresh$ | async }}s / {{\n clusterMap?.config.refreshInterval / 1000\n }}s\"\n [style.--timescope]=\"clusterMap?.config.refreshInterval + 1000 + 'ms'\"\n >\n <svg\n [ngClass]=\"{ 'time-on': !(clusterMap?.isLoading$ | async) }\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"15.8\"\n stroke=\"var(--c8y-brand-primary)\"\n stroke-width=\"6\"\n />\n </svg>\n\n <span>{{ secondsUntilRefresh$ | async }}</span>\n </button>\n <button\n type=\"button\"\n *ngIf=\"clusterMap?.isLoading$ | async\"\n title=\"{{ 'Cancel reload' | translate }}\"\n (click)=\"cancelReload()\"\n >\n <i\n c8yIcon=\"refresh\"\n class=\"icon-spin\"\n ></i>\n </button>\n <button\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime && !clusterMap?.assets && !(clusterMap?.isLoading$ | async)\n \"\n (click)=\"reload()\"\n [title]=\"'Reload' | translate\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n type=\"button\"\n (click)=\"center()\"\n title=\"{{ 'Center map' | translate }}\"\n [disabled]=\"centerMapButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n type=\"button\"\n title=\"{{ 'Unfollow' | translate }}\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n type=\"button\"\n title=\"{{ 'Follow' | translate }}\"\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" }]
|
|
990
1022
|
}], propDecorators: { config: [{
|
|
991
1023
|
type: Input
|
|
992
1024
|
}], configChange: [{
|
|
@@ -1048,5 +1080,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1048
1080
|
* Generated bundle index. Do not edit.
|
|
1049
1081
|
*/
|
|
1050
1082
|
|
|
1051
|
-
export { ClusterMap, ClusterMapComponent, ClusterSize, MAP_DEFAULT_CONFIG, MAP_TILE_LAYER, MapComponent, MapModule, MapPopupDirective, MapService, MapStatusComponent, MapTenantOptionKeys, defaultLayer, defaultMapConfig, getC8yMarker
|
|
1083
|
+
export { ClusterMap, ClusterMapComponent, ClusterSize, MAP_DEFAULT_CONFIG, MAP_TILE_LAYER, MapComponent, MapModule, MapPopupDirective, MapService, MapStatusComponent, MapTenantOptionKeys, defaultLayer, defaultMapConfig, getC8yMarker };
|
|
1052
1084
|
//# sourceMappingURL=c8y-ngx-components-map.mjs.map
|