@c8y/ngx-components 1018.503.1 → 1018.503.22
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 +67 -0
- 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 +5 -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 +6 -3
- package/esm2020/context-dashboard/context-dashboard.component.mjs +2 -2
- package/esm2020/context-dashboard/context-dashboard.service.mjs +3 -3
- package/esm2020/context-dashboard/dashboard-detail.component.mjs +2 -2
- package/esm2020/context-dashboard/report-dashboard/report-dashboard-list.component.mjs +3 -3
- 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 +68 -1
- package/esm2020/core/common/tenant-ui.service.mjs +3 -2
- package/esm2020/core/common/user-preferences/user-preferences.service.mjs +6 -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/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 +5 -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 +5 -5
- package/esm2020/reports/export-schedules.component.mjs +3 -3
- package/esm2020/repository/configuration/device-tab/configuration-preview.component.mjs +4 -4
- 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 +2 -2
- package/esm2020/sub-assets/asset-properties-item.component.mjs +6 -6
- package/esm2020/sub-assets/groups.component.mjs +2 -2
- package/esm2020/sub-assets/sub-assets.component.mjs +2 -2
- package/esm2020/sub-assets/sub-assets.service.mjs +16 -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 +4 -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 +12 -9
- 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 +5 -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 +5 -5
- 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 +3 -3
- 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 +24 -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 +121 -28
- package/fesm2015/c8y-ngx-components.mjs.map +1 -1
- package/fesm2020/c8y-ngx-components-assets-navigator.mjs +4 -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 +12 -9
- 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 +5 -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 +5 -5
- 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 +3 -3
- 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 +24 -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 +121 -28
- 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/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,35 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken,
|
|
2
|
+
import { InjectionToken, Injectable, Directive, EventEmitter, Component, Inject, ViewChild, ContentChild, Input, Output, SimpleChange, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@c8y/ngx-components';
|
|
4
4
|
import { gettext, sortByPriority, ManagedObjectRealtimeService, CommonModule as CommonModule$1, FormsModule as FormsModule$1, RealtimeModule } from '@c8y/ngx-components';
|
|
5
5
|
import * as i3 from '@ngx-translate/core';
|
|
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 i1$2 from '@angular/common';
|
|
12
12
|
import { CommonModule } from '@angular/common';
|
|
13
13
|
import { FormsModule } from '@angular/forms';
|
|
14
14
|
|
|
15
|
-
function getStatus(device) {
|
|
16
|
-
if (!device.c8y_ActiveAlarmsStatus) {
|
|
17
|
-
return 'text-primary';
|
|
18
|
-
}
|
|
19
|
-
if (device.c8y_ActiveAlarmsStatus.critical) {
|
|
20
|
-
return 'status critical';
|
|
21
|
-
}
|
|
22
|
-
if (device.c8y_ActiveAlarmsStatus.major) {
|
|
23
|
-
return 'status major';
|
|
24
|
-
}
|
|
25
|
-
if (device.c8y_ActiveAlarmsStatus.warning) {
|
|
26
|
-
return 'status warning';
|
|
27
|
-
}
|
|
28
|
-
if (device.c8y_ActiveAlarmsStatus.minor) {
|
|
29
|
-
return 'status minor';
|
|
30
|
-
}
|
|
31
|
-
return 'text-primary';
|
|
32
|
-
}
|
|
33
15
|
function getC8yMarker(marker, asset) {
|
|
34
16
|
marker.asset = asset;
|
|
35
17
|
return marker;
|
|
@@ -63,110 +45,30 @@ const defaultMapConfig = {
|
|
|
63
45
|
zoomLevel: 2
|
|
64
46
|
};
|
|
65
47
|
|
|
66
|
-
class
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (this._rect) {
|
|
76
|
-
this._rect.remove();
|
|
48
|
+
class MapService {
|
|
49
|
+
/**
|
|
50
|
+
* Returns asset icon status for highest alarm severity found in device object.
|
|
51
|
+
* @param device Device that contains alarms information.
|
|
52
|
+
* @returns Status string according to alarm severity
|
|
53
|
+
*/
|
|
54
|
+
static getStatus(device) {
|
|
55
|
+
if (!device.c8y_ActiveAlarmsStatus) {
|
|
56
|
+
return 'text-muted';
|
|
77
57
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
get rect() {
|
|
81
|
-
return this._rect;
|
|
82
|
-
}
|
|
83
|
-
constructor(iterable, addAssetCallback, translateService) {
|
|
84
|
-
this.iterable = iterable;
|
|
85
|
-
this.addAssetCallback = addAssetCallback;
|
|
86
|
-
this.translateService = translateService;
|
|
87
|
-
this.markers = [];
|
|
88
|
-
this.positions = [];
|
|
89
|
-
this.iterableDiffer = this.iterable.find(this.positions).create(this.trackBy);
|
|
90
|
-
}
|
|
91
|
-
render(map) {
|
|
92
|
-
if (this._rect) {
|
|
93
|
-
this._rect.addTo(map);
|
|
58
|
+
if (device.c8y_ActiveAlarmsStatus.critical) {
|
|
59
|
+
return 'status critical';
|
|
94
60
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this._clusterMarker.addTo(map);
|
|
61
|
+
if (device.c8y_ActiveAlarmsStatus.major) {
|
|
62
|
+
return 'status major';
|
|
98
63
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
this.removeClusterToBigMarker();
|
|
102
|
-
this._rect.remove();
|
|
103
|
-
this.positions = [];
|
|
104
|
-
this.updateChanges(map);
|
|
105
|
-
}
|
|
106
|
-
removeClusterToBigMarker() {
|
|
107
|
-
if (this._clusterMarker) {
|
|
108
|
-
this._clusterMarker.remove();
|
|
109
|
-
this._clusterMarker = null;
|
|
64
|
+
if (device.c8y_ActiveAlarmsStatus.minor) {
|
|
65
|
+
return 'status minor';
|
|
110
66
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const marker = this.addAssetCallback(device);
|
|
114
|
-
this.markers.push(marker);
|
|
115
|
-
marker.addTo(map);
|
|
116
|
-
}
|
|
117
|
-
setClusterToBigMarker(map, count, leaflet) {
|
|
118
|
-
const bound = this.rect.getBounds();
|
|
119
|
-
const text = this.translateService.instant(gettext('Zoom in'));
|
|
120
|
-
const divMarker = leaflet.divIcon({
|
|
121
|
-
html: `<div class="c8y-map-marker-count" data-count="${count}" title="${text}"></div>`
|
|
122
|
-
});
|
|
123
|
-
const labelIcon = leaflet.marker(bound.getCenter(), {
|
|
124
|
-
icon: divMarker
|
|
125
|
-
});
|
|
126
|
-
labelIcon.addTo(map);
|
|
127
|
-
labelIcon.on('click', () => {
|
|
128
|
-
map.fitBounds(bound);
|
|
129
|
-
});
|
|
130
|
-
this.clusterMarker = labelIcon;
|
|
131
|
-
}
|
|
132
|
-
updateChanges(map) {
|
|
133
|
-
const changes = this.iterableDiffer.diff(this.positions);
|
|
134
|
-
if (changes) {
|
|
135
|
-
changes.forEachRemovedItem((record) => {
|
|
136
|
-
this.removeMarkerFromMap(record.item);
|
|
137
|
-
});
|
|
138
|
-
changes.forEachAddedItem((record) => {
|
|
139
|
-
this.addMarkerToMap(record.item, map);
|
|
140
|
-
});
|
|
67
|
+
if (device.c8y_ActiveAlarmsStatus.warning) {
|
|
68
|
+
return 'status warning';
|
|
141
69
|
}
|
|
70
|
+
return 'text-muted';
|
|
142
71
|
}
|
|
143
|
-
trackBy(index, item) {
|
|
144
|
-
const trackItems = [item.id, item.c8y_Position.lat, item.c8y_Position.lng, getStatus(item)];
|
|
145
|
-
return trackItems.join('');
|
|
146
|
-
}
|
|
147
|
-
removeMarkerFromMap(device) {
|
|
148
|
-
const markers = this.markers.filter((marker) => marker.asset?.id === device.id);
|
|
149
|
-
markers.forEach(marker => marker.remove());
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
class MapPopupDirective {
|
|
154
|
-
constructor(template, elementRef, viewContainer) {
|
|
155
|
-
this.template = template;
|
|
156
|
-
this.elementRef = elementRef;
|
|
157
|
-
this.viewContainer = viewContainer;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
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 });
|
|
161
|
-
MapPopupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: MapPopupDirective, selector: "[c8yMapPopup]", ngImport: i0 });
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapPopupDirective, decorators: [{
|
|
163
|
-
type: Directive,
|
|
164
|
-
args: [{
|
|
165
|
-
selector: '[c8yMapPopup]'
|
|
166
|
-
}]
|
|
167
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }]; } });
|
|
168
|
-
|
|
169
|
-
class MapService {
|
|
170
72
|
/**
|
|
171
73
|
* @ignore: Only DI.
|
|
172
74
|
*/
|
|
@@ -319,6 +221,114 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
319
221
|
}]
|
|
320
222
|
}], ctorParameters: function () { return [{ type: i1.InventoryService }, { type: i1$1.OptionsService }]; } });
|
|
321
223
|
|
|
224
|
+
class ClusterMap {
|
|
225
|
+
set clusterMarker(item) {
|
|
226
|
+
this.removeClusterToBigMarker();
|
|
227
|
+
this._clusterMarker = item;
|
|
228
|
+
}
|
|
229
|
+
get clusterMarker() {
|
|
230
|
+
return this._clusterMarker;
|
|
231
|
+
}
|
|
232
|
+
set rect(item) {
|
|
233
|
+
if (this._rect) {
|
|
234
|
+
this._rect.remove();
|
|
235
|
+
}
|
|
236
|
+
this._rect = item;
|
|
237
|
+
}
|
|
238
|
+
get rect() {
|
|
239
|
+
return this._rect;
|
|
240
|
+
}
|
|
241
|
+
constructor(iterable, addAssetCallback, translateService) {
|
|
242
|
+
this.iterable = iterable;
|
|
243
|
+
this.addAssetCallback = addAssetCallback;
|
|
244
|
+
this.translateService = translateService;
|
|
245
|
+
this.markers = [];
|
|
246
|
+
this.positions = [];
|
|
247
|
+
this.iterableDiffer = this.iterable.find(this.positions).create(this.trackBy);
|
|
248
|
+
}
|
|
249
|
+
render(map) {
|
|
250
|
+
if (this._rect) {
|
|
251
|
+
this._rect.addTo(map);
|
|
252
|
+
}
|
|
253
|
+
this.updateChanges(map);
|
|
254
|
+
if (this._clusterMarker) {
|
|
255
|
+
this._clusterMarker.addTo(map);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
clear(map) {
|
|
259
|
+
this.removeClusterToBigMarker();
|
|
260
|
+
this._rect.remove();
|
|
261
|
+
this.positions = [];
|
|
262
|
+
this.updateChanges(map);
|
|
263
|
+
}
|
|
264
|
+
removeClusterToBigMarker() {
|
|
265
|
+
if (this._clusterMarker) {
|
|
266
|
+
this._clusterMarker.remove();
|
|
267
|
+
this._clusterMarker = null;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
addMarkerToMap(device, map) {
|
|
271
|
+
const marker = this.addAssetCallback(device);
|
|
272
|
+
this.markers.push(marker);
|
|
273
|
+
marker.addTo(map);
|
|
274
|
+
}
|
|
275
|
+
setClusterToBigMarker(map, count, leaflet) {
|
|
276
|
+
const bound = this.rect.getBounds();
|
|
277
|
+
const text = this.translateService.instant(gettext('Zoom in'));
|
|
278
|
+
const divMarker = leaflet.divIcon({
|
|
279
|
+
html: `<div class="c8y-map-marker-count" data-count="${count}" title="${text}"></div>`
|
|
280
|
+
});
|
|
281
|
+
const labelIcon = leaflet.marker(bound.getCenter(), {
|
|
282
|
+
icon: divMarker
|
|
283
|
+
});
|
|
284
|
+
labelIcon.addTo(map);
|
|
285
|
+
labelIcon.on('click', () => {
|
|
286
|
+
map.fitBounds(bound);
|
|
287
|
+
});
|
|
288
|
+
this.clusterMarker = labelIcon;
|
|
289
|
+
}
|
|
290
|
+
updateChanges(map) {
|
|
291
|
+
const changes = this.iterableDiffer.diff(this.positions);
|
|
292
|
+
if (changes) {
|
|
293
|
+
changes.forEachRemovedItem((record) => {
|
|
294
|
+
this.removeMarkerFromMap(record.item);
|
|
295
|
+
});
|
|
296
|
+
changes.forEachAddedItem((record) => {
|
|
297
|
+
this.addMarkerToMap(record.item, map);
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
trackBy(index, item) {
|
|
302
|
+
const trackItems = [
|
|
303
|
+
item.id,
|
|
304
|
+
item.c8y_Position.lat,
|
|
305
|
+
item.c8y_Position.lng,
|
|
306
|
+
MapService.getStatus(item)
|
|
307
|
+
];
|
|
308
|
+
return trackItems.join('');
|
|
309
|
+
}
|
|
310
|
+
removeMarkerFromMap(device) {
|
|
311
|
+
const markers = this.markers.filter((marker) => marker.asset?.id === device.id);
|
|
312
|
+
markers.forEach(marker => marker.remove());
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
class MapPopupDirective {
|
|
317
|
+
constructor(template, elementRef, viewContainer) {
|
|
318
|
+
this.template = template;
|
|
319
|
+
this.elementRef = elementRef;
|
|
320
|
+
this.viewContainer = viewContainer;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
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 });
|
|
324
|
+
MapPopupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: MapPopupDirective, selector: "[c8yMapPopup]", ngImport: i0 });
|
|
325
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapPopupDirective, decorators: [{
|
|
326
|
+
type: Directive,
|
|
327
|
+
args: [{
|
|
328
|
+
selector: '[c8yMapPopup]'
|
|
329
|
+
}]
|
|
330
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }]; } });
|
|
331
|
+
|
|
322
332
|
class MapComponent {
|
|
323
333
|
constructor(moRealtimeService, mapService, layers$, defaultConfig$, translateService) {
|
|
324
334
|
this.moRealtimeService = moRealtimeService;
|
|
@@ -341,7 +351,7 @@ class MapComponent {
|
|
|
341
351
|
this.onZoomEnd = new EventEmitter();
|
|
342
352
|
this.onRealtimeUpdate = new EventEmitter();
|
|
343
353
|
this.onInit = new EventEmitter();
|
|
344
|
-
this.
|
|
354
|
+
this.unsubscribeTrigger$ = new Subject();
|
|
345
355
|
}
|
|
346
356
|
startRealtime() {
|
|
347
357
|
if (!this.assets || (Array.isArray(this.assets) && this.assets.length > 1)) {
|
|
@@ -415,7 +425,7 @@ class MapComponent {
|
|
|
415
425
|
}
|
|
416
426
|
getAssetIcon(asset) {
|
|
417
427
|
const assetTypeIcon = this.config.icon || asset.icon?.name;
|
|
418
|
-
const status = getStatus(asset);
|
|
428
|
+
const status = MapService.getStatus(asset);
|
|
419
429
|
const color = this.config.color ? `style='color: ${this.config.color};'` : '';
|
|
420
430
|
const icon = this.leaflet.divIcon({
|
|
421
431
|
html: `<div class="dlt-c8y-icon-marker icon-3x ${status}" ${color}><i class="dlt-c8y-icon-${assetTypeIcon || 'data-transfer'}" /></div>`,
|
|
@@ -455,7 +465,7 @@ class MapComponent {
|
|
|
455
465
|
async ngAfterViewInit() {
|
|
456
466
|
this.leaflet = await this.mapService.getLeaflet();
|
|
457
467
|
combineLatest([this.layers$, this.defaultConfig$])
|
|
458
|
-
.pipe(first(), takeUntil(this.
|
|
468
|
+
.pipe(first(), takeUntil(this.unsubscribeTrigger$))
|
|
459
469
|
.subscribe(([layers, defaultConfig]) => {
|
|
460
470
|
this.initMap(layers, defaultConfig);
|
|
461
471
|
this.refreshMarkers();
|
|
@@ -473,7 +483,7 @@ class MapComponent {
|
|
|
473
483
|
this.unsubscribeAllListeners();
|
|
474
484
|
}
|
|
475
485
|
unsubscribeAllListeners() {
|
|
476
|
-
this.
|
|
486
|
+
this.unsubscribeTrigger$.next();
|
|
477
487
|
this.stopRealtime();
|
|
478
488
|
}
|
|
479
489
|
initMap(layers, defaultConfig) {
|
|
@@ -490,16 +500,16 @@ class MapComponent {
|
|
|
490
500
|
this.addLayers(layers);
|
|
491
501
|
this.handleMobile();
|
|
492
502
|
fromEvent(this.map, 'moveend')
|
|
493
|
-
.pipe(takeUntil(this.
|
|
503
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
494
504
|
.subscribe(event => this.onMoveEnd.emit(event));
|
|
495
505
|
fromEvent(this.map, 'move')
|
|
496
|
-
.pipe(takeUntil(this.
|
|
506
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
497
507
|
.subscribe(event => this.onMove.emit(event));
|
|
498
508
|
fromEvent(this.map, 'zoomend')
|
|
499
|
-
.pipe(takeUntil(this.
|
|
509
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
500
510
|
.subscribe(event => this.onZoomEnd.emit(event));
|
|
501
511
|
fromEvent(this.map, 'zoomstart')
|
|
502
|
-
.pipe(takeUntil(this.
|
|
512
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
503
513
|
.subscribe(event => this.onZoomStart.emit(event));
|
|
504
514
|
this.isInit = true;
|
|
505
515
|
this.onInit.emit(this.leaflet);
|
|
@@ -710,7 +720,7 @@ class ClusterMapComponent extends MapComponent {
|
|
|
710
720
|
this.leaflet = await this.mapService.getLeaflet();
|
|
711
721
|
}
|
|
712
722
|
combineLatest([this.layers$, this.defaultConfig$])
|
|
713
|
-
.pipe(takeUntil(this.
|
|
723
|
+
.pipe(takeUntil(this.unsubscribeTrigger$))
|
|
714
724
|
.subscribe(([layers, defaultConfig]) => {
|
|
715
725
|
this.initMap(layers, defaultConfig);
|
|
716
726
|
this.changeRootNode(this.rootNode);
|
|
@@ -727,17 +737,17 @@ class ClusterMapComponent extends MapComponent {
|
|
|
727
737
|
cancelReload() {
|
|
728
738
|
this.reloadTrigger$.next(false);
|
|
729
739
|
}
|
|
730
|
-
|
|
740
|
+
listenToClusterAndIntervalChanges() {
|
|
731
741
|
const timerStart$ = new Subject();
|
|
732
742
|
const timerEnd$ = new Subject();
|
|
733
|
-
const documentHiddenEvent$ = fromEvent(document, 'visibilitychange').pipe(takeUntil(this.
|
|
743
|
+
const documentHiddenEvent$ = fromEvent(document, 'visibilitychange').pipe(takeUntil(this.unsubscribeTrigger$));
|
|
734
744
|
const interval$ = timerStart$.pipe(map(() => this.config.refreshInterval), switchMap(configInterval => {
|
|
735
745
|
if (!configInterval) {
|
|
736
746
|
return NEVER;
|
|
737
747
|
}
|
|
738
748
|
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$));
|
|
739
|
-
}), switchMap(() => (document.hidden ? documentHiddenEvent$ : of(true))), takeUntil(this.
|
|
740
|
-
const mapChange$ =
|
|
749
|
+
}), switchMap(() => (document.hidden ? documentHiddenEvent$ : of(true))), takeUntil(this.unsubscribeTrigger$));
|
|
750
|
+
const mapChange$ = this.getMapChangeObservable();
|
|
741
751
|
merge(this.reloadTrigger$, mapChange$, interval$)
|
|
742
752
|
.pipe(tap(() => {
|
|
743
753
|
timerEnd$.next(true);
|
|
@@ -745,7 +755,7 @@ class ClusterMapComponent extends MapComponent {
|
|
|
745
755
|
this.isLoading$.next(true);
|
|
746
756
|
}), switchMap(value => value === false
|
|
747
757
|
? of([])
|
|
748
|
-
: from(this.mapService.getClusterSize(this.map.getBounds())).pipe(mergeMap((clusterSize) => this.getClusterRects(clusterSize, this.map.getBounds())), mergeMap(rects => this.createOrUpdateCluster(rects)))), takeUntil(this.
|
|
758
|
+
: from(this.mapService.getClusterSize(this.map.getBounds())).pipe(mergeMap((clusterSize) => this.getClusterRects(clusterSize, this.map.getBounds())), mergeMap(rects => this.createOrUpdateCluster(rects)))), takeUntil(this.unsubscribeTrigger$))
|
|
749
759
|
.subscribe((clusters) => {
|
|
750
760
|
clusters.forEach(cluster => cluster.render(this.map));
|
|
751
761
|
this.isLoading$.next(false);
|
|
@@ -753,6 +763,9 @@ class ClusterMapComponent extends MapComponent {
|
|
|
753
763
|
this.msUntilRefresh$.next(this.config.refreshInterval);
|
|
754
764
|
});
|
|
755
765
|
}
|
|
766
|
+
listenToClusterMapChanges() {
|
|
767
|
+
this.getMapChangeObservable().subscribe();
|
|
768
|
+
}
|
|
756
769
|
refreshMarkers() {
|
|
757
770
|
if (this.assets) {
|
|
758
771
|
super.refreshMarkers();
|
|
@@ -771,11 +784,13 @@ class ClusterMapComponent extends MapComponent {
|
|
|
771
784
|
if (isPositionDevice) {
|
|
772
785
|
this.assets = mo;
|
|
773
786
|
this.refreshMarkers();
|
|
774
|
-
|
|
787
|
+
this.listenToClusterMapChanges();
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
this.assets = null;
|
|
791
|
+
this.listenToClusterAndIntervalChanges();
|
|
792
|
+
this.reload();
|
|
775
793
|
}
|
|
776
|
-
this.assets = null;
|
|
777
|
-
this.listenToClusterChanges();
|
|
778
|
-
this.reload();
|
|
779
794
|
}
|
|
780
795
|
async getClusterRects(levelThreshold = ClusterSize.FOUR, viewBounds, level = 0) {
|
|
781
796
|
let rects = [];
|
|
@@ -864,6 +879,9 @@ class ClusterMapComponent extends MapComponent {
|
|
|
864
879
|
});
|
|
865
880
|
return Promise.all(updatePromise);
|
|
866
881
|
}
|
|
882
|
+
getMapChangeObservable() {
|
|
883
|
+
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$));
|
|
884
|
+
}
|
|
867
885
|
}
|
|
868
886
|
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 });
|
|
869
887
|
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" });
|
|
@@ -894,7 +912,7 @@ class MapStatusComponent {
|
|
|
894
912
|
this.configChange = new EventEmitter();
|
|
895
913
|
this.onUnfollow = new EventEmitter();
|
|
896
914
|
this.buttonsConfig = {};
|
|
897
|
-
this.
|
|
915
|
+
this.centerMapButtonDisabled = true;
|
|
898
916
|
this.destroy$ = new Subject();
|
|
899
917
|
}
|
|
900
918
|
ngOnInit() {
|
|
@@ -945,10 +963,24 @@ class MapStatusComponent {
|
|
|
945
963
|
this.clusterMap.mapChange.pipe(takeUntil(this.destroy$)).subscribe((event) => {
|
|
946
964
|
if (this.config?.center && event.sourceTarget?.getBounds) {
|
|
947
965
|
const bounds = event.sourceTarget.getBounds();
|
|
948
|
-
this.
|
|
966
|
+
this.centerMapButtonDisabled = this.shouldDisableCenterButton(bounds);
|
|
949
967
|
}
|
|
950
968
|
});
|
|
951
969
|
}
|
|
970
|
+
/**
|
|
971
|
+
* Checks if Center button should be disabled according to provided bounds.
|
|
972
|
+
* Provided bounds contain coordinates of current map rectangle corners.
|
|
973
|
+
* Center button should be disabled if distance between center coordinates (from config) and center of current bounds
|
|
974
|
+
* is less than 1/4 of bounds dimensions.
|
|
975
|
+
* To achieve it we just need to check if center coordinates (from config) are contained in the boundaries of
|
|
976
|
+
* current bounds shrunk by 25%.
|
|
977
|
+
* @param bounds Current map view boundaries.
|
|
978
|
+
* @returns True if distance between config center and current boundaries center is bigger than 1/4 of boundaries dimensions
|
|
979
|
+
*/
|
|
980
|
+
shouldDisableCenterButton(bounds) {
|
|
981
|
+
const shrunkBounds = bounds.pad(-0.25);
|
|
982
|
+
return shrunkBounds.contains(this.config.center);
|
|
983
|
+
}
|
|
952
984
|
defaultButtonsConfig() {
|
|
953
985
|
return {
|
|
954
986
|
realtime: { show: this.config.realtime || this.clusterMap.config.follow, disabled: false }
|
|
@@ -956,10 +988,10 @@ class MapStatusComponent {
|
|
|
956
988
|
}
|
|
957
989
|
}
|
|
958
990
|
MapStatusComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
959
|
-
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]=\"
|
|
991
|
+
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" }] });
|
|
960
992
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MapStatusComponent, decorators: [{
|
|
961
993
|
type: Component,
|
|
962
|
-
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]=\"
|
|
994
|
+
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" }]
|
|
963
995
|
}], propDecorators: { config: [{
|
|
964
996
|
type: Input
|
|
965
997
|
}], configChange: [{
|
|
@@ -1021,5 +1053,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1021
1053
|
* Generated bundle index. Do not edit.
|
|
1022
1054
|
*/
|
|
1023
1055
|
|
|
1024
|
-
export { ClusterMap, ClusterMapComponent, ClusterSize, MAP_DEFAULT_CONFIG, MAP_TILE_LAYER, MapComponent, MapModule, MapPopupDirective, MapService, MapStatusComponent, MapTenantOptionKeys, defaultLayer, defaultMapConfig, getC8yMarker
|
|
1056
|
+
export { ClusterMap, ClusterMapComponent, ClusterSize, MAP_DEFAULT_CONFIG, MAP_TILE_LAYER, MapComponent, MapModule, MapPopupDirective, MapService, MapStatusComponent, MapTenantOptionKeys, defaultLayer, defaultMapConfig, getC8yMarker };
|
|
1025
1057
|
//# sourceMappingURL=c8y-ngx-components-map.mjs.map
|