@c8y/ngx-components 1023.28.5 → 1023.37.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/cockpit/index.d.ts.map +1 -1
- package/alarms/devicemanagement/index.d.ts.map +1 -1
- package/alarms/index.d.ts +25 -2
- package/alarms/index.d.ts.map +1 -1
- package/asset-properties/index.d.ts +20 -2
- package/asset-properties/index.d.ts.map +1 -1
- package/bookmarks/index.d.ts +15 -7
- package/bookmarks/index.d.ts.map +1 -1
- package/cockpit-config/index.d.ts.map +1 -1
- package/datapoint-explorer/view/index.d.ts +2 -0
- package/datapoint-explorer/view/index.d.ts.map +1 -1
- package/datapoint-selector/index.d.ts.map +1 -1
- package/device-grid/index.d.ts.map +1 -1
- package/echart/index.d.ts +19 -3
- package/echart/index.d.ts.map +1 -1
- package/feature-toggles/index.d.ts +6 -0
- package/feature-toggles/index.d.ts.map +1 -0
- package/feature-toggles/list/index.d.ts +63 -0
- package/feature-toggles/list/index.d.ts.map +1 -0
- package/fesm2022/c8y-ngx-components-alarms-cockpit.mjs +6 -11
- package/fesm2022/c8y-ngx-components-alarms-cockpit.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms-devicemanagement.mjs +37 -11
- package/fesm2022/c8y-ngx-components-alarms-devicemanagement.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-alarms.mjs +58 -10
- package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-properties.mjs +36 -12
- package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
- package/fesm2022/{c8y-ngx-components-asset-property-grid.component-B04ixTyA.mjs → c8y-ngx-components-asset-property-grid.component-BoVrIpap.mjs} +5 -12
- package/fesm2022/c8y-ngx-components-asset-property-grid.component-BoVrIpap.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-bookmarks.mjs +86 -39
- package/fesm2022/c8y-ngx-components-bookmarks.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-cockpit-config.mjs +9 -9
- package/fesm2022/c8y-ngx-components-cockpit-config.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +21 -36
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +3 -11
- package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-grid.mjs +5 -2
- package/fesm2022/c8y-ngx-components-device-grid.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +101 -42
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-ecosystem-plugin-setup-stepper.mjs +3 -3
- package/fesm2022/c8y-ngx-components-ecosystem-plugin-setup-stepper.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-feature-toggles-list.mjs +242 -0
- package/fesm2022/c8y-ngx-components-feature-toggles-list.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-feature-toggles.mjs +36 -0
- package/fesm2022/c8y-ngx-components-feature-toggles.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-global-context.mjs +21 -6
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-map.mjs +127 -33
- package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-tenants.mjs +2 -2
- package/fesm2022/c8y-ngx-components-tenants.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-trusted-certificates.mjs +5 -1
- package/fesm2022/c8y-ngx-components-trusted-certificates.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-upgrade-not-found.component-CuCuYAkK.mjs +19 -0
- package/fesm2022/c8y-ngx-components-upgrade-not-found.component-CuCuYAkK.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-upgrade.mjs +33 -3
- package/fesm2022/c8y-ngx-components-upgrade.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +3 -3
- package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-pie-chart.mjs +30 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions-pie-chart.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs +2 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs +8 -1
- package/fesm2022/c8y-ngx-components-widgets-exports.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +4 -4
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +3 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +4 -3
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs +18 -11
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-pie-chart.mjs +366 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-pie-chart.mjs.map +1 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-three-d-rotation.mjs +4 -0
- package/fesm2022/c8y-ngx-components-widgets-implementations-three-d-rotation.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-widget-providers.mjs +5 -2
- package/fesm2022/c8y-ngx-components-widgets-widget-providers.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +57 -18
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/global-context/index.d.ts +12 -2
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +9 -3
- package/index.d.ts.map +1 -1
- package/locales/de.po +88 -66
- package/locales/es.po +26 -20
- package/locales/fr.po +25 -20
- package/locales/ja_JP.po +18 -20
- package/locales/ko.po +24 -20
- package/locales/locales.pot +130 -32
- package/locales/nl.po +26 -20
- package/locales/pl.po +26 -20
- package/locales/pt_BR.po +24 -20
- package/locales/zh_CN.po +26 -20
- package/locales/zh_TW.po +26 -20
- package/map/index.d.ts +41 -10
- package/map/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/trusted-certificates/index.d.ts +2 -0
- package/trusted-certificates/index.d.ts.map +1 -1
- package/upgrade/index.d.ts.map +1 -1
- package/widgets/cockpit-exports/index.d.ts +6 -0
- package/widgets/cockpit-exports/index.d.ts.map +1 -1
- package/widgets/definitions/index.d.ts +1 -0
- package/widgets/definitions/index.d.ts.map +1 -1
- package/widgets/definitions/pie-chart/index.d.ts +25 -0
- package/widgets/definitions/pie-chart/index.d.ts.map +1 -0
- package/widgets/device-management-exports/index.d.ts +6 -0
- package/widgets/device-management-exports/index.d.ts.map +1 -1
- package/widgets/exports/index.d.ts +8 -1
- package/widgets/exports/index.d.ts.map +1 -1
- package/widgets/implementations/html-widget/index.d.ts +2 -2
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
- package/widgets/implementations/map/index.d.ts +1 -0
- package/widgets/implementations/map/index.d.ts.map +1 -1
- package/widgets/implementations/pie-chart/index.d.ts +129 -0
- package/widgets/implementations/pie-chart/index.d.ts.map +1 -0
- package/widgets/implementations/three-d-rotation/index.d.ts.map +1 -1
- package/widgets/widget-providers/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-asset-property-grid.component-B04ixTyA.mjs.map +0 -1
|
@@ -5,7 +5,7 @@ import { sortByPriority, ManagedObjectRealtimeService, globalAutoRefreshLoading,
|
|
|
5
5
|
import * as i3 from '@ngx-translate/core';
|
|
6
6
|
import * as i4 from 'rxjs';
|
|
7
7
|
import { of, combineLatest, defer, firstValueFrom, NEVER, BehaviorSubject, Subject, fromEvent, merge, from } from 'rxjs';
|
|
8
|
-
import { map, first, takeUntil, scan, filter, switchMap, tap, mergeMap, catchError, debounceTime, skip } from 'rxjs/operators';
|
|
8
|
+
import { map, first, takeUntil, scan, filter, switchMap, tap, mergeMap, catchError, take, debounceTime, skip } from 'rxjs/operators';
|
|
9
9
|
import { gettext } from '@c8y/ngx-components/gettext';
|
|
10
10
|
import * as i1 from '@c8y/client';
|
|
11
11
|
import { QueriesUtil } from '@c8y/client';
|
|
@@ -85,6 +85,19 @@ const defaultMapConfig = {
|
|
|
85
85
|
const defaultFitBoundsOptions = {
|
|
86
86
|
padding: [50, 50]
|
|
87
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Extension of QueriesUtil to use decimal literals instead of float literals.
|
|
90
|
+
* Used for queries involving longitude and latitude to avoid precision issues.
|
|
91
|
+
*/
|
|
92
|
+
class QueriesUtilDecimalExtension extends QueriesUtil {
|
|
93
|
+
useAsFloat(operand) {
|
|
94
|
+
operand = this.quoteString(operand);
|
|
95
|
+
if (typeof operand === 'number') {
|
|
96
|
+
return `${operand}d`;
|
|
97
|
+
}
|
|
98
|
+
return operand;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
88
101
|
|
|
89
102
|
class MapService {
|
|
90
103
|
/**
|
|
@@ -200,25 +213,25 @@ class MapService {
|
|
|
200
213
|
/**
|
|
201
214
|
* Counts all managed objects in a given bound with a c8y_Position fragment.
|
|
202
215
|
* @param bound The lat lng bound to request the managed objects for.
|
|
203
|
-
* @param
|
|
216
|
+
* @param isInHierarchyOfMO The group managed object of which direct children should be searched for.
|
|
204
217
|
* @returns The number of all position managed objects in the given bound (and group).
|
|
205
218
|
*/
|
|
206
|
-
async getPositionMOsFromBoundCount(bound,
|
|
207
|
-
return this.getPositionMOsFromBound(bound,
|
|
219
|
+
async getPositionMOsFromBoundCount(bound, isInHierarchyOfMO) {
|
|
220
|
+
return this.getPositionMOsFromBound(bound, isInHierarchyOfMO, true);
|
|
208
221
|
}
|
|
209
|
-
async getPositionMOsFromBound(bound,
|
|
222
|
+
async getPositionMOsFromBound(bound, isInHierarchyOfMO, count = false) {
|
|
210
223
|
const { lat: latMin, lng: lngMinRaw } = bound.getSouthWest();
|
|
211
224
|
const { lat: latMax, lng: lngMaxRaw } = bound.getNorthEast();
|
|
212
225
|
const lngMin = lngMaxRaw - lngMinRaw > 360 ? -180 : this.normalizeLongitude(lngMinRaw);
|
|
213
226
|
const lngMax = lngMaxRaw - lngMinRaw > 360 ? 180 : this.normalizeLongitude(lngMaxRaw);
|
|
214
227
|
const filterObjWithCoordinates = {
|
|
215
228
|
__and: [
|
|
216
|
-
...(
|
|
229
|
+
...(isInHierarchyOfMO
|
|
217
230
|
? [
|
|
218
231
|
{
|
|
219
232
|
__or: [
|
|
220
|
-
{ id:
|
|
221
|
-
await this.childrenOfGroupFilter(
|
|
233
|
+
{ id: isInHierarchyOfMO.id },
|
|
234
|
+
await this.childrenOfGroupFilter(isInHierarchyOfMO)
|
|
222
235
|
]
|
|
223
236
|
}
|
|
224
237
|
]
|
|
@@ -287,15 +300,15 @@ class MapService {
|
|
|
287
300
|
}
|
|
288
301
|
/**
|
|
289
302
|
* Returns all managed object with a c8y_Position fragment.
|
|
290
|
-
* @param
|
|
303
|
+
* @param isInHierarchyOfMO The group managed object of which direct children should be searched for.
|
|
291
304
|
* @param pageSize Defines how many results should be returned.
|
|
292
305
|
* @returns The managed objects with position.
|
|
293
306
|
*/
|
|
294
|
-
async getAllPositionMOs(
|
|
295
|
-
const childrenFilter =
|
|
296
|
-
? await this.childrenOfGroupFilter(
|
|
307
|
+
async getAllPositionMOs(isInHierarchyOfMO, pageSize = 500) {
|
|
308
|
+
const childrenFilter = isInHierarchyOfMO
|
|
309
|
+
? await this.childrenOfGroupFilter(isInHierarchyOfMO)
|
|
297
310
|
: undefined;
|
|
298
|
-
const orValue = childrenFilter ? [{ id:
|
|
311
|
+
const orValue = childrenFilter ? [{ id: isInHierarchyOfMO.id }, childrenFilter] : undefined;
|
|
299
312
|
const queryObj = {
|
|
300
313
|
__filter: {
|
|
301
314
|
__and: [{ __has: 'c8y_Position' }],
|
|
@@ -315,31 +328,27 @@ class MapService {
|
|
|
315
328
|
data: data
|
|
316
329
|
};
|
|
317
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Gets the bounds of all assets, optionally within a group.
|
|
333
|
+
* @param isInHierarchyOfMO Is inhierachy of managed object to limit the assets to a group.
|
|
334
|
+
* @returns The bounds of all assets.
|
|
335
|
+
*/
|
|
336
|
+
async getAllBounds(isInHierarchyOfMO) {
|
|
337
|
+
return this.getBounds('query', isInHierarchyOfMO);
|
|
338
|
+
}
|
|
318
339
|
/**
|
|
319
340
|
* Determines a rectangular geographical area based on the positions of all devices.
|
|
320
341
|
*
|
|
321
342
|
* @returns A [[LatLngBounds]] object fitting all devices' geo positions.
|
|
322
343
|
*/
|
|
323
344
|
async getAllDevicesBounds() {
|
|
324
|
-
|
|
325
|
-
pageSize: 1,
|
|
326
|
-
q: `$filter=has(c8y_Position) $orderby=c8y_Position.${coord} ${order}`
|
|
327
|
-
});
|
|
328
|
-
const filterReverse = (op, order) => ({
|
|
329
|
-
pageSize: 1,
|
|
330
|
-
q: `$filter=has(c8y_Position) and c8y_Position.lng ${op} 0d $orderby=c8y_Position.lng ${order}`
|
|
331
|
-
});
|
|
332
|
-
const [latMin, latMax, lngMin, lngMax, lngRevMin, lngRevMax] = await Promise.all([
|
|
333
|
-
this.inventory.list(filter('lat', 'asc')),
|
|
334
|
-
this.inventory.list(filter('lat', 'desc')),
|
|
335
|
-
this.inventory.list(filter('lng', 'asc')),
|
|
336
|
-
this.inventory.list(filter('lng', 'desc')),
|
|
337
|
-
this.inventory.list(filterReverse('gt', 'asc')),
|
|
338
|
-
this.inventory.list(filterReverse('lt', 'desc'))
|
|
339
|
-
]).then(result => result.map(r => get(r.data, '[0].c8y_Position')));
|
|
340
|
-
const shiftWorld = (lngRevMin?.lng ?? 0) - (lngRevMax?.lng ?? 0) > 180;
|
|
341
|
-
return latLngBounds(latLng(latMin?.lat, shiftWorld ? lngRevMin?.lng : lngMin?.lng), latLng(latMax?.lat, shiftWorld ? lngRevMax?.lng + 360 : lngMax?.lng));
|
|
345
|
+
return this.getBounds('q');
|
|
342
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* Calculates the bounding box that contains all given assets.
|
|
349
|
+
* @param assets The assets to calculate the bounds for.
|
|
350
|
+
* @returns The calculated bounds or undefined if no valid positions are found.
|
|
351
|
+
*/
|
|
343
352
|
async getAssetsBounds(assets) {
|
|
344
353
|
const leaflet = await this.getLeaflet();
|
|
345
354
|
const bounds = leaflet.latLngBounds([]);
|
|
@@ -423,6 +432,66 @@ class MapService {
|
|
|
423
432
|
}
|
|
424
433
|
return { __bygroupid: mo.id };
|
|
425
434
|
}
|
|
435
|
+
/**
|
|
436
|
+
* Internal method to calculate bounds based on position coordinates.
|
|
437
|
+
* @param queryName The query parameter name to use ('q' or 'query'). Use q to limit to devices only.
|
|
438
|
+
* @param isInHierarchyOfMO Optional managed object to limit the assets to a group.
|
|
439
|
+
* @returns The calculated bounds
|
|
440
|
+
*/
|
|
441
|
+
async getBounds(queryName, isInHierarchyOfMO) {
|
|
442
|
+
const childrenFilter = isInHierarchyOfMO
|
|
443
|
+
? await this.childrenOfGroupFilter(isInHierarchyOfMO)
|
|
444
|
+
: undefined;
|
|
445
|
+
const filter = (coord, order) => ({
|
|
446
|
+
pageSize: 1,
|
|
447
|
+
[queryName]: new QueriesUtil().buildQuery({
|
|
448
|
+
__filter: {
|
|
449
|
+
__and: [
|
|
450
|
+
childrenFilter,
|
|
451
|
+
{
|
|
452
|
+
__has: 'c8y_Position'
|
|
453
|
+
}
|
|
454
|
+
].filter(Boolean)
|
|
455
|
+
},
|
|
456
|
+
__orderby: [
|
|
457
|
+
{
|
|
458
|
+
[`c8y_Position.${coord}`]: order === 'asc' ? 1 : -1
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
})
|
|
462
|
+
});
|
|
463
|
+
const filterReverse = (op, order) => ({
|
|
464
|
+
pageSize: 1,
|
|
465
|
+
[queryName]: new QueriesUtilDecimalExtension().buildQuery({
|
|
466
|
+
__filter: {
|
|
467
|
+
__and: [
|
|
468
|
+
childrenFilter,
|
|
469
|
+
{
|
|
470
|
+
__has: 'c8y_Position',
|
|
471
|
+
[`c8y_Position.lng`]: {
|
|
472
|
+
[`__${op}`]: 0
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
].filter(Boolean)
|
|
476
|
+
},
|
|
477
|
+
__orderby: [
|
|
478
|
+
{
|
|
479
|
+
[`c8y_Position.lng`]: order === 'asc' ? 1 : -1
|
|
480
|
+
}
|
|
481
|
+
]
|
|
482
|
+
})
|
|
483
|
+
});
|
|
484
|
+
const [latMin, latMax, lngMin, lngMax, lngRevMin, lngRevMax] = await Promise.all([
|
|
485
|
+
this.inventory.list(filter('lat', 'asc')),
|
|
486
|
+
this.inventory.list(filter('lat', 'desc')),
|
|
487
|
+
this.inventory.list(filter('lng', 'asc')),
|
|
488
|
+
this.inventory.list(filter('lng', 'desc')),
|
|
489
|
+
this.inventory.list(filterReverse('gt', 'asc')),
|
|
490
|
+
this.inventory.list(filterReverse('lt', 'desc'))
|
|
491
|
+
]).then(result => result.map(r => get(r.data, '[0].c8y_Position')));
|
|
492
|
+
const shiftWorld = (lngRevMin?.lng ?? 0) - (lngRevMax?.lng ?? 0) > 180;
|
|
493
|
+
return latLngBounds(latLng(latMin?.lat, shiftWorld ? lngRevMin?.lng : lngMin?.lng), latLng(latMax?.lat, shiftWorld ? lngRevMax?.lng + 360 : lngMax?.lng));
|
|
494
|
+
}
|
|
426
495
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MapService, deps: [{ token: i1.InventoryService }, { token: i1$1.OptionsService }, { token: i1$1.ServiceRegistry }, { token: i1$1.FeatureCacheService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
427
496
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MapService, providedIn: 'root' }); }
|
|
428
497
|
}
|
|
@@ -906,6 +975,9 @@ class MapComponent {
|
|
|
906
975
|
if (this.hasChanged(change, 'follow')) {
|
|
907
976
|
this.moveToPositionOfMo(this.assets);
|
|
908
977
|
}
|
|
978
|
+
if (this.hasChanged(change, 'bounds')) {
|
|
979
|
+
this.fitBounds(change.currentValue.bounds);
|
|
980
|
+
}
|
|
909
981
|
if (this.hasChanged(change, 'disablePan') || this.hasChanged(change, 'disableZoom')) {
|
|
910
982
|
this.toggleControls();
|
|
911
983
|
}
|
|
@@ -1085,6 +1157,10 @@ class ClusterMapComponent extends MapComponent {
|
|
|
1085
1157
|
this.mapChange = new EventEmitter();
|
|
1086
1158
|
/** @ignore */
|
|
1087
1159
|
this.errorNotifier = new BehaviorSubject(null);
|
|
1160
|
+
/**
|
|
1161
|
+
* Indicates if the map was manually changed by the user (e.g., panned or zoomed).
|
|
1162
|
+
*/
|
|
1163
|
+
this.isDirty = false;
|
|
1088
1164
|
this.reloadTrigger$ = new BehaviorSubject(false);
|
|
1089
1165
|
this.clusters = [];
|
|
1090
1166
|
this.EVENT_THROTTLE_TIME = 750;
|
|
@@ -1511,7 +1587,25 @@ class ClusterMapComponent extends MapComponent {
|
|
|
1511
1587
|
return Promise.all(updatePromise);
|
|
1512
1588
|
}
|
|
1513
1589
|
getMapChangeObservable() {
|
|
1514
|
-
|
|
1590
|
+
// Set isDirty flag on user interactions
|
|
1591
|
+
merge(fromEvent(this.map, 'mousedown'), fromEvent(this.mapElement?.nativeElement, 'wheel'), fromEvent(this.map, 'touchstart'))
|
|
1592
|
+
.pipe(take(1), takeUntil(this.unsubscribeTrigger$))
|
|
1593
|
+
.subscribe(() => {
|
|
1594
|
+
this.isDirty = true;
|
|
1595
|
+
});
|
|
1596
|
+
let skipMoveEvent = false;
|
|
1597
|
+
return merge(fromEvent(this.map, 'move'), fromEvent(this.map, 'moveend')).pipe(debounceTime(this.EVENT_THROTTLE_TIME), switchMap(async (event) => {
|
|
1598
|
+
// If the map wasn't changed by user and we have autoFitToBounds, fit the bounds
|
|
1599
|
+
// Skip this event and let the fitBounds-triggered event be processed instead
|
|
1600
|
+
if (this.config.autoFitToBounds && !this.isDirty && !skipMoveEvent) {
|
|
1601
|
+
const bounds = await this.mapService.getAllBounds(this.rootNode);
|
|
1602
|
+
skipMoveEvent = true;
|
|
1603
|
+
this.map.fitBounds(bounds, this.config.fitBoundsOptions || defaultFitBoundsOptions);
|
|
1604
|
+
return null; // Skip current event
|
|
1605
|
+
}
|
|
1606
|
+
skipMoveEvent = false;
|
|
1607
|
+
return event;
|
|
1608
|
+
}), filter(event => event !== null), tap(event => {
|
|
1515
1609
|
this.mapChange.emit(event);
|
|
1516
1610
|
}), takeUntil(this.unsubscribeTrigger$));
|
|
1517
1611
|
}
|
|
@@ -1851,5 +1945,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
1851
1945
|
* Generated bundle index. Do not edit.
|
|
1852
1946
|
*/
|
|
1853
1947
|
|
|
1854
|
-
export { ClusterMap, ClusterMapComponent, ClusterSize, MAP_DEFAULT_CONFIG, MAP_TILE_LAYER, MapComponent, MapModule, MapPopupDirective, MapService, MapStatusComponent, MapTenantOptionKeys, defaultFitBoundsOptions, defaultLayer, defaultMapConfig, getC8yMarker };
|
|
1948
|
+
export { ClusterMap, ClusterMapComponent, ClusterSize, MAP_DEFAULT_CONFIG, MAP_TILE_LAYER, MapComponent, MapModule, MapPopupDirective, MapService, MapStatusComponent, MapTenantOptionKeys, QueriesUtilDecimalExtension, defaultFitBoundsOptions, defaultLayer, defaultMapConfig, getC8yMarker };
|
|
1855
1949
|
//# sourceMappingURL=c8y-ngx-components-map.mjs.map
|