@c8y/ngx-components 1022.44.7 → 1022.45.2

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.
Files changed (60) hide show
  1. package/asset-properties/asset-properties.model.d.ts +1 -1
  2. package/asset-properties/asset-properties.model.d.ts.map +1 -1
  3. package/asset-properties/asset-property-list/asset-property-value.pipe.d.ts.map +1 -1
  4. package/computed-asset-properties/last-measurement/last-measurement-value.d.ts +2 -1
  5. package/computed-asset-properties/last-measurement/last-measurement-value.d.ts.map +1 -1
  6. package/computed-asset-properties/strategies/last-measurement-strategy.d.ts +4 -3
  7. package/computed-asset-properties/strategies/last-measurement-strategy.d.ts.map +1 -1
  8. package/context-dashboard/context-dashboard.service.d.ts +20 -2
  9. package/context-dashboard/context-dashboard.service.d.ts.map +1 -1
  10. package/context-dashboard/widget-config/widget-asset-selector.component.d.ts +8 -2
  11. package/context-dashboard/widget-config/widget-asset-selector.component.d.ts.map +1 -1
  12. package/context-dashboard/widget-config.component.d.ts.map +1 -1
  13. package/context-dashboard/widget-config.service.d.ts +7 -1
  14. package/context-dashboard/widget-config.service.d.ts.map +1 -1
  15. package/core/router/router.service.d.ts +1 -0
  16. package/core/router/router.service.d.ts.map +1 -1
  17. package/dashboard-manager/dashboard-manager.service.d.ts +5 -4
  18. package/dashboard-manager/dashboard-manager.service.d.ts.map +1 -1
  19. package/dashboard-manager/devicemanagement/dashboard-manager-navigation.factory.d.ts +10 -0
  20. package/dashboard-manager/devicemanagement/dashboard-manager-navigation.factory.d.ts.map +1 -0
  21. package/dashboard-manager/devicemanagement/dashboard-manager-tabs.factory.d.ts +11 -0
  22. package/dashboard-manager/devicemanagement/dashboard-manager-tabs.factory.d.ts.map +1 -0
  23. package/dashboard-manager/devicemanagement/index.d.ts +4 -0
  24. package/dashboard-manager/devicemanagement/index.d.ts.map +1 -1
  25. package/dashboard-manager/index.d.ts +2 -1
  26. package/dashboard-manager/index.d.ts.map +1 -1
  27. package/dashboard-manager/type-dashboards-list/index.d.ts +2 -0
  28. package/dashboard-manager/type-dashboards-list/index.d.ts.map +1 -0
  29. package/fesm2022/c8y-ngx-components-asset-properties.mjs +1 -1
  30. package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -1
  31. package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs +1 -1
  32. package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs.map +1 -1
  33. package/fesm2022/c8y-ngx-components-context-dashboard.mjs +54 -24
  34. package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
  35. package/fesm2022/c8y-ngx-components-dashboard-manager-devicemanagement.mjs +81 -6
  36. package/fesm2022/c8y-ngx-components-dashboard-manager-devicemanagement.mjs.map +1 -1
  37. package/fesm2022/c8y-ngx-components-dashboard-manager.mjs +185 -166
  38. package/fesm2022/c8y-ngx-components-dashboard-manager.mjs.map +1 -1
  39. package/fesm2022/c8y-ngx-components-map.mjs +1 -1
  40. package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
  41. package/fesm2022/c8y-ngx-components-widgets-implementations-cockpit-welcome.mjs +2 -2
  42. package/fesm2022/c8y-ngx-components-widgets-implementations-cockpit-welcome.mjs.map +1 -1
  43. package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs +12 -7
  44. package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs.map +1 -1
  45. package/fesm2022/c8y-ngx-components.mjs +14 -4
  46. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  47. package/locales/de.po +19 -0
  48. package/locales/es.po +19 -0
  49. package/locales/fr.po +19 -0
  50. package/locales/ja_JP.po +17 -0
  51. package/locales/ko.po +18 -0
  52. package/locales/locales.pot +18 -0
  53. package/locales/nl.po +19 -0
  54. package/locales/pl.po +19 -0
  55. package/locales/pt_BR.po +19 -0
  56. package/locales/zh_CN.po +18 -0
  57. package/locales/zh_TW.po +18 -0
  58. package/package.json +1 -1
  59. package/widgets/implementations/map/map-widget.component.d.ts +1 -0
  60. package/widgets/implementations/map/map-widget.component.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"c8y-ngx-components-map.mjs","sources":["../../map/map.model.ts","../../map/map.service.ts","../../map/cluster-map.ts","../../map/map-popup.directive.ts","../../map/map.component.ts","../../map/map.component.html","../../map/cluster-map.component.ts","../../map/cluster-map.component.html","../../map/map-status.component.ts","../../map/map-status.component.html","../../map/map.module.ts","../../map/c8y-ngx-components-map.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { IEvent, IManagedObject } from '@c8y/client';\nimport type { MapDefaultConfig, MapTileLayer } from '@c8y/options';\nimport type * as L from 'leaflet';\nimport { Observable } from 'rxjs';\nimport { GlobalAutoRefreshWidgetConfig } from '@c8y/ngx-components';\n\n/**\n * Utility function to assign asset and event information to a Leaflet marker.\n * @param marker The Leaflet marker instance.\n * @param asset The managed object representing the asset (optional).\n * @param event The event associated with the marker (optional).\n * @returns The marker with asset and/or event information attached.\n */\nexport function getC8yMarker(marker: L.Marker, asset?: PositionManagedObject, event?: IEvent) {\n (marker as C8yMarker).asset = asset;\n (marker as C8yMarker).event = event;\n return marker as C8yMarker;\n}\n\n/**\n * Injection token for providing map tile layers as an observable.\n */\nexport const MAP_TILE_LAYER = new InjectionToken<Observable<MapTileLayer[]>>('MAP_TILE_LAYER');\n\n/**\n * Utility type to require only one of the specified keys in a type.\n * @ignore\n */\ntype RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &\n { [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>> }[Keys];\n\n/**\n * Attributes that can be attached to a Cumulocity marker.\n */\ninterface C8yMarkerAttr {\n asset: PositionManagedObject;\n event: IEvent;\n}\n\n/**\n * Type representing the attribute keys for a Cumulocity marker.\n */\nexport type C8yMarkerAttributes = keyof C8yMarkerAttr;\n\n/**\n * Leaflet marker extended with either asset or event information.\n */\nexport type C8yMarker = L.Marker & RequireOnlyOne<C8yMarkerAttr, 'asset' | 'event'>;\n\n/**\n * Enum for supported cluster sizes on the map.\n */\nexport enum ClusterSize {\n /** No clustering. */\n NONE = 0,\n /** Cluster of 4. */\n FOUR = 1,\n /** Cluster of 16. */\n SIXTEEN = 2\n}\n\n/**\n * Enum for map tenant option keys used in configuration.\n */\nexport enum MapTenantOptionKeys {\n /** Map configuration key. */\n CONFIG = 'map-config',\n /** Map layers key. */\n LAYERS = 'map-layers'\n}\n\n/**\n * Managed object with position and optional alarm status and icon for map display.\n */\nexport interface PositionManagedObject extends IManagedObject {\n /**\n * Position information (latitude, longitude, optional altitude).\n */\n c8y_Position: {\n lat: number;\n lng: number;\n alt?: number;\n };\n\n /**\n * Optional active alarms status for the asset.\n */\n c8y_ActiveAlarmsStatus?: {\n minor: number;\n major: number;\n warning: number;\n critical: number;\n };\n\n /**\n * Optional icon information for the asset.\n */\n icon?: {\n name: string;\n };\n}\n\n/**\n * Configuration for the cluster map, including center and refresh interval.\n */\nexport type ClusterMapConfig = MapConfig & {\n /**\n * Center coordinates of the map [latitude, longitude].\n */\n center: [number, number];\n /**\n * Optional refresh interval in milliseconds (null for no auto-refresh).\n */\n refreshInterval?: number | null;\n};\n\n/**\n * General map configuration, including options for following, real-time, icon, color, zoom, pan, and bounds.\n */\nexport type MapConfig = MapDefaultConfig & {\n /** Whether the map should follow the selected asset. */\n follow?: boolean;\n /** Whether the map should update in real-time. */\n realtime?: boolean;\n /** Optional icon name for the map. */\n icon?: string;\n /** Optional color for the map or marker. */\n color?: string;\n /** Disable zoom controls. */\n disableZoom?: boolean;\n /** Disable pan controls. */\n disablePan?: boolean;\n /** Optional map bounds. */\n bounds?: L.LatLngBounds;\n /** Optional fit bounds options. */\n fitBoundsOptions?: L.FitBoundsOptions;\n} & GlobalAutoRefreshWidgetConfig;\n\n/**\n * Injection token for providing the default map configuration as an observable.\n */\nexport const MAP_DEFAULT_CONFIG = new InjectionToken<Observable<MapDefaultConfig>>(\n 'MAP_DEFAULT_CONFIG'\n);\n\n/**\n * Default map tile layer configuration (OpenStreetMap).\n */\nexport const defaultLayer: MapTileLayer = {\n layerUrl: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n label: 'OpenStreetMap',\n priority: 1000,\n options: {\n maxZoom: 18,\n minZoom: 0,\n attribution:\n '&copy;<a href=\"http://www.openstreetmap.org/copyright\" rel=\"noreferrer nofollow\">OpenStreetMap</a>',\n noWrap: false\n }\n};\n\n/**\n * Default map configuration (centered on Düsseldorf, zoom level 2).\n */\nexport const defaultMapConfig: MapDefaultConfig = {\n center: [51.23544, 6.79599], // Düsseldorf\n zoomLevel: 2\n};\n\n/**\n * Default options for fitting map bounds (padding).\n */\nexport const defaultFitBoundsOptions: L.FitBoundsOptions = {\n padding: [50, 50]\n};\n\n/**\n * Configuration for the status buttons shown on the map UI.\n */\nexport type MapStatusButtonsConfig = {\n /** Real-time button configuration. */\n realtime: { show: boolean; disabled?: boolean };\n /** Fit to bounds button configuration. */\n fitToBounds: { show: boolean; disabled?: boolean };\n /** Center button configuration. */\n center: { show: boolean; disabled?: boolean };\n};\n","import { Injectable } from '@angular/core';\nimport {\n IIdentified,\n IManagedObject,\n InventoryService,\n IResultList,\n Paging,\n QueriesUtil\n} from '@c8y/client';\nimport { FeatureCacheService, OptionsService, ServiceRegistry } from '@c8y/ngx-components';\nimport type { MapDefaultConfig, MapTileLayer } from '@c8y/options';\nimport type * as L from 'leaflet';\nimport { latLng, latLngBounds } from 'leaflet';\nimport { get } from 'lodash-es';\nimport { combineLatest, defer, firstValueFrom, Observable, of } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport {\n ClusterSize,\n defaultLayer,\n defaultMapConfig,\n MapTenantOptionKeys,\n PositionManagedObject\n} from './map.model';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MapService {\n /**\n * Returns asset icon status for highest alarm severity found in device object.\n * @param device Device that contains alarms information.\n * @returns Status string according to alarm severity\n */\n static getStatus(device: PositionManagedObject) {\n if (!device.c8y_ActiveAlarmsStatus) {\n return 'text-muted';\n }\n if (device.c8y_ActiveAlarmsStatus.critical) {\n return 'status critical';\n }\n if (device.c8y_ActiveAlarmsStatus.major) {\n return 'status major';\n }\n if (device.c8y_ActiveAlarmsStatus.minor) {\n return 'status minor';\n }\n if (device.c8y_ActiveAlarmsStatus.warning) {\n return 'status warning';\n }\n return 'text-muted';\n }\n /**\n * The devices that are maximal displayed in one cluster.\n */\n MAX_DEVICE_PER_CLUSTER = 200;\n /**\n * The count until the cluster is sized. There are a maximum of\n * three clusters: 1, 4 or 16.\n */\n CLUSTER_LEVEL_THRESHOLD = 500;\n\n private queriesUtil = new QueriesUtil();\n\n /**\n * @ignore: Only DI.\n */\n constructor(\n private inventory: InventoryService,\n private options: OptionsService,\n private serviceRegistry: ServiceRegistry,\n private featureCacheService: FeatureCacheService\n ) {}\n\n /**\n * Returns the leaflet instance used by the cumulocity core.\n */\n async getLeaflet() {\n const originalLeflet = window.L;\n const c8yLeafletInstance = (await import('leaflet')).default;\n c8yLeafletInstance.noConflict();\n window.L = originalLeflet;\n return c8yLeafletInstance;\n }\n\n /**\n * Verifies if a given managed object is a device with a position fragment.\n * @param mo The given managed object.\n */\n isPositionedDevice(mo: IIdentified) {\n return !!(mo?.c8y_IsDevice && this.hasPosition(mo));\n }\n\n /**\n * Verifies if a given managed object has a position fragment.\n * @param mo The given managed object.\n */\n hasPosition(mo: IIdentified) {\n return mo?.c8y_Position;\n }\n\n getMapTileLayerProviders(): CumulocityServiceRegistry.MapTileLayerProvider[] {\n const layerProviders = this.serviceRegistry.get('mapTileLayerHook');\n\n return layerProviders;\n }\n\n getMapTileLayersFromHookedProviders$(\n layerProviders: CumulocityServiceRegistry.MapTileLayerProvider[]\n ): Observable<MapTileLayer[]> {\n if (!layerProviders.length) {\n return of([]);\n }\n const layers = combineLatest(layerProviders.map(provider => provider.getMapTileLayers$()));\n return layers.pipe(map(layers => layers.flat()));\n }\n\n /**\n * Returns the layers available in this application.\n * Layers are taken from plugins installed to this application.\n * In case none of the plugins override the default layers, the default layers are also considered.\n * @returns The layers.\n */\n getMapTileLayers$(): Observable<MapTileLayer[]> {\n return defer(() => {\n const layerProviders = this.getMapTileLayerProviders();\n const overridesDefaultLayer = layerProviders.some(provider =>\n provider.overridesDefaultLayer?.()\n );\n const layersFromProviders = defer(() =>\n this.getMapTileLayersFromHookedProviders$(layerProviders)\n );\n if (overridesDefaultLayer) {\n return layersFromProviders;\n }\n\n return combineLatest([this.getDefaultLayers(), layersFromProviders]).pipe(\n map(layers => {\n return layers.flat();\n })\n );\n });\n }\n\n /**\n * Returns the layers configured in the current platform via tenant options.\n * @returns The layers. If not set in tenant options the default layers.\n */\n getDefaultLayers(): Observable<MapTileLayer[]> {\n return this.getMapOption<MapTileLayer[]>(\n MapTenantOptionKeys.LAYERS,\n this.options.mapLayers || [defaultLayer]\n );\n }\n\n /**\n * Returns the map configuration configured on the tenant.\n * @returns The configuration. If not set in tenant options the default configuration.\n */\n getDefaultConfig(): Observable<MapDefaultConfig> {\n return this.getMapOption<MapDefaultConfig>(\n MapTenantOptionKeys.CONFIG,\n this.options.mapConfig || defaultMapConfig\n );\n }\n\n /**\n * Counts all managed objects in a given bound with a c8y_Position fragment.\n * @param bound The lat lng bound to request the managed objects for.\n * @param isinhierarchyofMO The group managed object of which direct children should be searched for.\n * @returns The number of all position managed objects in the given bound (and group).\n */\n async getPositionMOsFromBoundCount(\n bound: L.LatLngBounds,\n isinhierarchyofMO?: IManagedObject\n ): Promise<number> {\n return this.getPositionMOsFromBound(bound, isinhierarchyofMO, true) as Promise<number>;\n }\n\n /**\n * Returns all managed objects with a c8y_Position fragment in a certain boundary.\n * @param bound The lat lng bound to request the managed objects for.\n * @returns All position managed objects in the given bound.\n */\n async getPositionMOsFromBound(bound: L.LatLngBounds): Promise<PositionManagedObject[]>;\n /**\n * Returns all managed objects with a c8y_Position fragment in a certain boundary that belongs to a certain group.\n * @param bound The lat lng bound to request the managed objects for.\n * @param isinhierarchyofMO The group managed object of which direct children should be searched for.\n * @returns All position managed objects in the given bound that are children of the given group.\n */\n async getPositionMOsFromBound(\n bound: L.LatLngBounds,\n isinhierarchyofMO: IManagedObject\n ): Promise<PositionManagedObject[]>;\n /**\n * Counts the managed objects in a certain boundary belonging to a group.\n * @param bound The lat lng bound to request the managed objects for.\n * @param isinhierarchyofMO The group managed object of which direct children should be searched for.\n * @return The count of the managed objects.\n */\n async getPositionMOsFromBound(\n bound: L.LatLngBounds,\n isinhierarchyofMO: IManagedObject,\n count: true\n ): Promise<number>;\n async getPositionMOsFromBound(\n bound: L.LatLngBounds,\n isinhierarchyofMO?: IManagedObject,\n count = false\n ): Promise<PositionManagedObject[] | number> {\n const { lat: latMin, lng: lngMinRaw } = bound.getSouthWest();\n const { lat: latMax, lng: lngMaxRaw } = bound.getNorthEast();\n\n const lngMin = lngMaxRaw - lngMinRaw > 360 ? -180 : this.normalizeLongitude(lngMinRaw);\n const lngMax = lngMaxRaw - lngMinRaw > 360 ? 180 : this.normalizeLongitude(lngMaxRaw);\n\n const filterObjWithCoordinates = {\n __and: [\n ...(isinhierarchyofMO\n ? [\n {\n __or: [\n { id: isinhierarchyofMO.id },\n await this.childrenOfGroupFilter(isinhierarchyofMO)\n ]\n }\n ]\n : []),\n {\n __has: 'c8y_Position'\n },\n {\n ['c8y_Position.lat']: {\n __gt: latMin\n }\n },\n {\n ['c8y_Position.lat']: {\n __lt: latMax\n }\n },\n {\n [lngMin < lngMax ? '__and' : '__or']: [\n {\n ['c8y_Position.lng']: {\n __gt: lngMin\n }\n },\n {\n ['c8y_Position.lng']: {\n __lt: lngMax\n }\n }\n ]\n }\n ]\n };\n\n const query = this.queriesUtil.buildQuery(filterObjWithCoordinates);\n\n const { paging, data } = await this.inventory.list({\n pageSize: count ? 1 : this.MAX_DEVICE_PER_CLUSTER,\n withTotalPages: count,\n query\n });\n if (count) {\n return paging.totalPages;\n }\n return data.map((pmo: PositionManagedObject) =>\n bound.contains(latLng(pmo.c8y_Position.lat, pmo.c8y_Position.lng))\n ? pmo\n : this.denormalizePMO(pmo, bound)\n ) as PositionManagedObject[];\n }\n\n /**\n * Returns all devices with c8y_Position.\n */\n async getPositionDevices(): Promise<PositionManagedObject[]>;\n /**\n * Returns all devices with c8y_Position.\n * @param pageSize The page size to return.\n */\n async getPositionDevices(pageSize: number): Promise<PositionManagedObject[]>;\n /**\n * Returns all devices with c8y_Position.\n * @param pageSize The page size to return.\n * @param count Counting is disabled\n */\n async getPositionDevices(pageSize: number, count: false): Promise<PositionManagedObject[]>;\n /**\n * Returns the number of all devices with c8y_Position.\n * @param pageSize The page size to return.\n * @param count Counting is enabled\n */\n async getPositionDevices(pageSize: number, count: true): Promise<number>;\n /**\n * Returns all devices with c8y_Position.\n * @param pageSize The page size to return.\n * @param count Switches to counting only.\n * @returns All devices or the device count with a c8y_Position fragment.\n */\n async getPositionDevices(\n pageSize = this.MAX_DEVICE_PER_CLUSTER,\n count?: boolean\n ): Promise<number | PositionManagedObject[]> {\n const query = this.queriesUtil.buildQuery({\n __and: [{ __has: 'c8y_Position' }, { __has: 'c8y_IsDevice' }]\n });\n const { paging, data } = await this.inventory.list({\n pageSize: count ? 1 : pageSize,\n withTotalPages: !!count,\n query\n });\n if (count) {\n return paging.totalPages;\n }\n return data as PositionManagedObject[];\n }\n\n /**\n * Returns all managed object with a c8y_Position fragment.\n * @param isinhierarchyofMO The group managed object of which direct children should be searched for.\n * @param pageSize Defines how many results should be returned.\n * @returns The managed objects with position.\n */\n async getAllPositionMOs(\n isinhierarchyofMO?: IIdentified,\n pageSize = 500\n ): Promise<IResultList<PositionManagedObject>> {\n const childrenFilter = isinhierarchyofMO\n ? await this.childrenOfGroupFilter(isinhierarchyofMO)\n : undefined;\n\n const orValue = childrenFilter ? [{ id: isinhierarchyofMO.id }, childrenFilter] : undefined;\n\n const queryObj = {\n __filter: {\n __and: [{ __has: 'c8y_Position' }],\n ...(orValue ? { __or: orValue } : {})\n }\n };\n\n const query = this.queriesUtil.buildQuery(queryObj);\n const filter: { pageSize: number; withTotalPages: boolean; query: string } = {\n pageSize,\n withTotalPages: true,\n query\n };\n\n const { paging, data, res } = await this.inventory.list(filter);\n\n return {\n res,\n paging: paging as Paging<PositionManagedObject>,\n data: data as PositionManagedObject[]\n };\n }\n\n /**\n * Determines a rectangular geographical area based on the positions of all devices.\n *\n * @returns A [[LatLngBounds]] object fitting all devices' geo positions.\n */\n async getAllDevicesBounds(): Promise<L.LatLngBounds> {\n const filter = (coord: 'lat' | 'lng', order: 'asc' | 'desc') => ({\n pageSize: 1,\n q: `$filter=has(c8y_Position) $orderby=c8y_Position.${coord} ${order}`\n });\n\n const filterReverse = (op: 'lt' | 'gt', order: 'asc' | 'desc') => ({\n pageSize: 1,\n q: `$filter=has(c8y_Position) and c8y_Position.lng ${op} 0d $orderby=c8y_Position.lng ${order}`\n });\n\n const [latMin, latMax, lngMin, lngMax, lngRevMin, lngRevMax] = await Promise.all([\n this.inventory.list(filter('lat', 'asc')),\n this.inventory.list(filter('lat', 'desc')),\n this.inventory.list(filter('lng', 'asc')),\n this.inventory.list(filter('lng', 'desc')),\n this.inventory.list(filterReverse('gt', 'asc')),\n this.inventory.list(filterReverse('lt', 'desc'))\n ]).then(result => result.map(r => get(r.data, '[0].c8y_Position')));\n\n const shiftWorld = (lngRevMin?.lng ?? 0) - (lngRevMax?.lng ?? 0) > 180;\n\n return latLngBounds(\n latLng(latMin?.lat, shiftWorld ? lngRevMin?.lng : lngMin?.lng),\n latLng(latMax?.lat, shiftWorld ? lngRevMax?.lng + 360 : lngMax?.lng)\n );\n }\n\n async getAssetsBounds(assets: PositionManagedObject[]): Promise<L.LatLngBounds | undefined> {\n const leaflet = await this.getLeaflet();\n const bounds = leaflet.latLngBounds([]);\n let hasValidPositions = false;\n assets.forEach(asset => {\n const position = asset.c8y_Position;\n if (position && typeof position.lat === 'number' && typeof position.lng === 'number') {\n bounds.extend([position.lat, position.lng]);\n hasValidPositions = true;\n }\n });\n if (!hasValidPositions || !bounds.isValid()) {\n return;\n }\n return bounds;\n }\n\n /**\n * Returns the cluster size for clustered maps. Counting the position MOs in a bounding\n * and if it reach a threshold, returning a [[ClusterSize]].\n * @param bound The bounding to check for cluster size.\n * @returns The cluster size, can be NONE, FOUR or SIXTEEN.\n */\n async getClusterSize(bound: L.LatLngBounds) {\n const count = await this.getPositionMOsFromBoundCount(bound);\n let clusterSize = ClusterSize.NONE;\n if (count > this.CLUSTER_LEVEL_THRESHOLD) {\n clusterSize = ClusterSize.SIXTEEN;\n } else if (count > this.MAX_DEVICE_PER_CLUSTER) {\n clusterSize = ClusterSize.FOUR;\n }\n return clusterSize;\n }\n\n private getMapOption<T>(key: MapTenantOptionKeys, defaultValue: T) {\n return defer(() =>\n this.options.getTenantOption<T | string>('configuration', key, defaultValue)\n ).pipe(\n map(config => {\n if (typeof config === 'string') {\n console.error(\n `The tenant option for maps 'configuration.${key}' is not a valid JSON structure.`\n );\n return defaultValue;\n }\n return config;\n })\n );\n }\n\n /**\n * Shifts longitudes received from Leaflet.js in the [-180 - k*360; 180 + k*360] rangewhen\n * `noWrap` is enabled to the [-180; 180] range expected for values of the c8y_Position fragment.\n *\n * @param lng Longitude to shift.\n * @returns Longitude value in the [-180; 180] range\n */\n private normalizeLongitude(lng: number): number {\n return ((((lng + 180) % 360) + 360) % 360) - 180;\n }\n\n /**\n * Shifts longitudes in the [-180; 180] range expected for values of the c8y_Position fragment\n * the the [-180 - k*360; 180 + k*360] range expected from Leaflet.js when `noWrap` is enabled.\n *\n * The method naively adds/subtracts 360 degrees to the original value until the position fits in the expected bounds.\n *\n * @param pmo A managed object with a `c8y_Position` fragment\n * @param bounds The bounds where the position should fit\n * @returns A managed object whose `c8y_Position`'s `lng` values has been shifted to fit in bounds\n */\n private denormalizePMO(\n pmo: PositionManagedObject,\n bounds: L.LatLngBounds\n ): PositionManagedObject {\n let { lng } = pmo.c8y_Position;\n const shiftFactor = lng > bounds.getEast() ? -1 : 1;\n\n while (!bounds.contains(latLng(pmo.c8y_Position.lat, lng))) {\n lng += shiftFactor * 360;\n }\n\n pmo.c8y_Position.lng = lng;\n return pmo;\n }\n\n private async childrenOfGroupFilter(mo: IIdentified) {\n try {\n const useInHierarchyOf = await firstValueFrom(\n this.featureCacheService.getFeatureState('ui.map.isinhierarchyof')\n );\n\n if (useInHierarchyOf) {\n return { __isinhierarchyof: mo.id };\n }\n } catch (e) {\n console.warn('Error while determining isinhierarchyof feature toggle state:', e);\n }\n\n return { __bygroupid: mo.id };\n }\n}\n","import { IterableChangeRecord, IterableDiffer, IterableDiffers } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport type * as L from 'leaflet';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { C8yMarker, PositionManagedObject } from './map.model';\nimport { MapService } from './map.service';\n\nexport class ClusterMap {\n markers: C8yMarker[] = [];\n positions: PositionManagedObject[] = [];\n\n set clusterMarker(item: L.Layer) {\n this.removeClusterToBigMarker();\n this._clusterMarker = item;\n }\n\n get clusterMarker() {\n return this._clusterMarker;\n }\n\n set rect(item: L.Rectangle) {\n if (this._rect) {\n this._rect.remove();\n }\n this._rect = item;\n }\n\n get rect() {\n return this._rect;\n }\n\n private _clusterMarker: L.Layer;\n private _rect: L.Rectangle;\n private iterableDiffer: IterableDiffer<PositionManagedObject> | null;\n\n constructor(\n private iterable: IterableDiffers,\n private addAssetCallback: (asset: PositionManagedObject) => C8yMarker,\n private translateService: TranslateService\n ) {\n this.iterableDiffer = this.iterable.find(this.positions).create(this.trackBy);\n }\n\n render(map: L.Map) {\n if (this._rect) {\n this._rect.addTo(map);\n }\n this.updateChanges(map);\n if (this._clusterMarker) {\n this._clusterMarker.addTo(map);\n }\n }\n\n clear(map: L.Map) {\n this.removeClusterToBigMarker();\n this._rect.remove();\n this.positions = [];\n this.updateChanges(map);\n }\n\n removeClusterToBigMarker() {\n if (this._clusterMarker) {\n this._clusterMarker.remove();\n this._clusterMarker = null;\n }\n }\n\n addMarkerToMap(device: PositionManagedObject, map: L.Map) {\n const marker = this.addAssetCallback(device);\n this.markers.push(marker);\n marker.addTo(map);\n }\n\n setClusterToBigMarker(map: L.Map, count, leaflet: typeof L) {\n const bound = this.rect.getBounds();\n const text = this.translateService.instant(gettext('Zoom in'));\n const divMarker = leaflet.divIcon({\n html: `<div class=\"c8y-map-marker-count\" data-count=\"${count}\" title=\"${text}\"></div>`\n });\n const labelIcon = leaflet.marker(bound.getCenter(), {\n icon: divMarker\n });\n labelIcon.addTo(map);\n labelIcon.on('click', () => {\n map.fitBounds(bound);\n });\n this.clusterMarker = labelIcon;\n }\n\n private updateChanges(map: L.Map) {\n const changes = this.iterableDiffer.diff(this.positions);\n if (changes) {\n changes.forEachRemovedItem((record: IterableChangeRecord<PositionManagedObject>) => {\n this.removeMarkerFromMap(record.item);\n });\n\n changes.forEachAddedItem((record: IterableChangeRecord<PositionManagedObject>) => {\n this.addMarkerToMap(record.item, map);\n });\n }\n }\n\n private trackBy(index: number, item: PositionManagedObject) {\n const trackItems = [\n item.id,\n item.c8y_Position.lat,\n item.c8y_Position.lng,\n MapService.getStatus(item)\n ];\n return trackItems.join('');\n }\n\n private removeMarkerFromMap(device: PositionManagedObject) {\n const markers = this.markers.filter((marker: C8yMarker) => marker.asset?.id === device.id);\n markers.forEach(marker => marker.remove());\n }\n}\n","import { Directive, ElementRef, TemplateRef, ViewContainerRef } from '@angular/core';\n\n@Directive({ selector: '[c8yMapPopup]' })\nexport class MapPopupDirective {\n constructor(\n public template: TemplateRef<unknown>,\n public elementRef: ElementRef,\n public viewContainer: ViewContainerRef\n ) {}\n}\n","import {\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n Output,\n SimpleChange,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { IEvent } from '@c8y/client';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport {\n DatePipe,\n GeoService,\n ManagedObjectRealtimeService,\n sortByPriority,\n WidgetGlobalAutoRefreshService\n} from '@c8y/ngx-components';\nimport type { MapDefaultConfig, MapTileLayer } from '@c8y/options';\nimport { TranslateService } from '@ngx-translate/core';\nimport type * as L from 'leaflet';\nimport { every, flatten, isEmpty, isNull, isUndefined, remove } from 'lodash-es';\nimport {\n BehaviorSubject,\n combineLatest,\n fromEvent,\n NEVER,\n Observable,\n Subject,\n Subscription\n} from 'rxjs';\nimport { filter, first, map, scan, switchMap, takeUntil } from 'rxjs/operators';\nimport { MapPopupDirective } from './map-popup.directive';\nimport {\n C8yMarker,\n C8yMarkerAttributes,\n getC8yMarker,\n MAP_DEFAULT_CONFIG,\n MAP_TILE_LAYER,\n MapConfig,\n PositionManagedObject\n} from './map.model';\nimport { MapService } from './map.service';\n\n@Component({\n selector: 'c8y-map',\n templateUrl: './map.component.html',\n providers: [ManagedObjectRealtimeService]\n})\nexport class MapComponent {\n /**\n * The leaflet map object instance.\n */\n map: L.Map;\n /**\n * The markers currently placed on the map.\n */\n markers: Array<C8yMarker | L.Marker> = [];\n /**\n * The leaflet library reference used for map operations.\n */\n leaflet: typeof L;\n /**\n * Indicates if the map was already initialized.\n */\n isInit = false;\n\n /**\n * Reference to the map DOM element.\n */\n @ViewChild('map')\n mapElement: ElementRef;\n\n /**\n * Reference to the custom popup directive for map markers.\n */\n @ContentChild(MapPopupDirective)\n popup: MapPopupDirective;\n\n /**\n * Map configuration object (center, zoom, icon, color, etc).\n */\n @Input()\n config: MapConfig = {};\n\n /**\n * Asset(s) to display as markers on the map.\n */\n @Input()\n assets: PositionManagedObject | PositionManagedObject[];\n\n /**\n * Observable for polyline coordinates to display on the map.\n */\n @Input()\n polyline$: Observable<L.LatLngExpression[] | L.LatLngExpression[][]> = NEVER;\n\n /**\n * Polyline display options for the map.\n */\n @Input()\n polylineOptions: L.PolylineOptions;\n\n /**\n * Emits when a tracked asset is updated in real-time.\n */\n @Output()\n onRealtimeUpdate = new EventEmitter<PositionManagedObject>();\n\n /**\n * Emits observable of map drag/move events.\n */\n @Output()\n onMove: Observable<L.LeafletEvent>;\n\n /**\n * Emits observable of map move end events.\n */\n @Output()\n onMoveEnd: Observable<L.LeafletEvent>;\n\n /**\n * Emits observable of map zoom start events.\n */\n @Output()\n onZoomStart: Observable<L.LeafletEvent>;\n\n /**\n * Emits observable of map zoom end events.\n */\n @Output()\n onZoomEnd: Observable<L.LeafletEvent>;\n\n /**\n * Emits the Leaflet map instance when available.\n */\n @Output()\n onMap = new BehaviorSubject<L.Map | null>(null);\n\n /**\n * Emits when the map and Leaflet library are initialized.\n */\n @Output()\n onInit = new EventEmitter<typeof L>();\n\n protected realtimeSubscription: Subscription;\n protected unsubscribeTrigger$ = new Subject<void>();\n protected destroy$ = new Subject<void>();\n\n private markerTitle = gettext('Marker at position {{lat}}, {{lng}}');\n\n constructor(\n protected moRealtimeService: ManagedObjectRealtimeService,\n protected mapService: MapService,\n @Inject(MAP_TILE_LAYER) protected layers$: Observable<MapTileLayer[]>,\n @Inject(MAP_DEFAULT_CONFIG)\n protected defaultConfig$: Observable<MapDefaultConfig>,\n protected translateService: TranslateService,\n protected geo: GeoService,\n protected datePipe: DatePipe,\n protected widgetGlobalAutoRefreshService: WidgetGlobalAutoRefreshService\n ) {\n this.initOutputs();\n }\n\n /**\n * Starts real-time updates for a single asset on the map.\n * Updates marker position and icon as new data arrives.\n */\n startRealtime() {\n if (!this.assets || (Array.isArray(this.assets) && this.assets.length > 1)) {\n this.config.realtime = false;\n this.stopRealtime();\n return;\n }\n const asset = Array.isArray(this.assets) ? this.assets[0] : this.assets;\n this.realtimeSubscription = this.moRealtimeService\n .onUpdate$(asset)\n .subscribe((asset: PositionManagedObject) => {\n const marker = this.findMarker(asset.id);\n const icon = this.getAssetIcon(asset);\n marker.setIcon(icon);\n marker.setLatLng(this.geo.getLatLong(asset));\n if (Array.isArray(this.assets)) {\n this.assets[0] = asset;\n } else {\n this.assets = asset;\n }\n this.moveToPositionOfMo(asset);\n this.onRealtimeUpdate.emit(asset);\n });\n }\n\n /**\n * Moves the map view to the position of the given asset(s) if follow is enabled.\n * @param positions The asset or array of assets to center the map on.\n */\n moveToPositionOfMo(positions: PositionManagedObject | PositionManagedObject[]) {\n const position = Array.isArray(positions) ? positions[0] : positions;\n if (this.config.follow) {\n this.map.setView([position.c8y_Position.lat, position.c8y_Position.lng]);\n }\n }\n\n /**\n * Stops real-time updates for the asset.\n */\n stopRealtime() {\n if (this.realtimeSubscription) {\n this.realtimeSubscription.unsubscribe();\n }\n }\n\n /**\n * Finds a marker on the map by asset, event, or ID.\n * @param moOrId Asset, event, or string ID to search for.\n * @returns The found marker or undefined.\n */\n findMarker(moOrId: string | IEvent | PositionManagedObject) {\n const getId = moOrId => (typeof moOrId === 'string' ? moOrId : moOrId?.id);\n return this.markers.find(\n (marker: C8yMarker) =>\n marker.asset?.id === getId(moOrId) || marker.event?.id === getId(moOrId)\n );\n }\n\n /**\n * Adds a marker to the map and internal marker list.\n * @param marker The marker to add.\n */\n addMarkerToMap(marker: C8yMarker | L.Marker) {\n this.markers.push(marker);\n marker.addTo(this.map);\n }\n\n /**\n * Creates and returns a marker for the given asset, including icon and popup.\n * @param asset The asset to create a marker for.\n * @returns The created marker.\n */\n getAssetMarker(asset: PositionManagedObject) {\n if (!asset) {\n return;\n }\n\n const icon = this.getAssetIcon(asset);\n const { lat, lng } = asset.c8y_Position;\n const leafletMarker = this.leaflet.marker(this.geo.getLatLong(asset), {\n icon,\n title: this.translateService.instant(this.markerTitle, { lat, lng })\n });\n const marker = getC8yMarker(leafletMarker, asset);\n this.bindPopup(marker, asset);\n\n return marker;\n }\n\n /**\n * Creates and returns a marker for a tracking event, including icon and popup.\n * @param event The event to create a marker for.\n * @returns The created marker.\n */\n getTrackingMarker(event: IEvent) {\n if (!event) {\n return;\n }\n\n const icon = this.getTrackingIcon();\n const { lat, lng } = event.c8y_Position;\n const leafletMarker = this.leaflet.marker(this.geo.getLatLong(event), {\n icon,\n title: this.translateService.instant(this.markerTitle, { lat, lng })\n });\n const marker = getC8yMarker(leafletMarker, null, event);\n this.bindPopup(marker, event);\n\n return marker;\n }\n\n /**\n * Returns a Leaflet icon for the given asset, using config or asset icon and color.\n * @param asset The asset to get the icon for.\n * @returns The Leaflet icon.\n */\n getAssetIcon(asset: PositionManagedObject) {\n const assetTypeIcon = this.config.icon || asset.icon?.name;\n const status = MapService.getStatus(asset);\n const color = this.config.color ? `style='color: ${this.config.color};'` : '';\n const icon = this.leaflet.divIcon({\n html: `<div class=\"dlt-c8y-icon-marker icon-3x ${status}\" ${color}><i class=\"dlt-c8y-icon-${\n assetTypeIcon || 'data-transfer'\n }\" /></div>`,\n className: 'c8y-map-marker-icon',\n // iconAnchor is used to set the marker accurately on click\n iconAnchor: [8, 8]\n });\n return icon;\n }\n\n /**\n * Returns a Leaflet icon for a tracking event.\n * @returns The Leaflet icon.\n */\n getTrackingIcon() {\n const icon = this.leaflet.divIcon({\n html: `<div class=\"dlt-c8y-icon-marker icon-3x text-muted\"></div>`,\n className: 'c8y-map-marker-icon',\n // iconAnchor is used to set the marker accurately on click\n iconAnchor: [8, 8]\n });\n return icon;\n }\n\n /**\n * Removes a marker from the map and internal marker list.\n * @param marker The marker to remove.\n */\n removeMarker(marker: C8yMarker | L.Marker) {\n if (marker) {\n marker.remove();\n remove(this.markers, m => m === marker);\n }\n }\n\n /**\n * Removes all markers from the map, optionally filtered by marker attribute.\n * @param fragment Optional marker attribute to filter by.\n */\n clearMarkers(fragment?: C8yMarkerAttributes) {\n const matchingMarkers = marker => !fragment || !!marker[fragment];\n this.markers.filter(matchingMarkers).forEach(marker => marker.remove());\n this.markers = this.markers.filter(marker => !matchingMarkers(marker));\n }\n\n /**\n * Refreshes all markers on the map based on the current assets.\n */\n refreshMarkers() {\n this.clearMarkers();\n let assets: PositionManagedObject[] = [];\n if (!isUndefined(this.assets)) {\n assets = Array.isArray(this.assets) ? this.assets : [this.assets];\n }\n assets.forEach(asset => {\n const marker = this.getAssetMarker(asset);\n this.addMarkerToMap(marker);\n });\n if (!this.config.center) {\n this.zoomToBound(assets);\n }\n this.toggleControls();\n }\n\n /**\n * Centers the map on the configured center coordinates.\n */\n center() {\n this.map?.setView(this.config.center);\n }\n\n /**\n * Refreshes the map and markers if the map is initialized.\n */\n refresh() {\n if (this.isInit) {\n this.refreshMarkers();\n }\n }\n\n protected async ngAfterViewInit() {\n this.leaflet = await this.mapService.getLeaflet();\n const initialized$ = combineLatest([this.layers$, this.defaultConfig$]).pipe(\n first(),\n takeUntil(this.unsubscribeTrigger$)\n );\n\n initialized$.subscribe(([layers, defaultConfig]) => {\n this.initMap(layers, defaultConfig);\n this.refreshMarkers();\n });\n\n combineLatest([this.polyline$, initialized$])\n .pipe(\n map(([expressions]) => this.leaflet.polyline(expressions, this.polylineOptions)),\n scan((oldPolyline, newPolyline) => {\n if (!!oldPolyline) {\n this.map.removeLayer(oldPolyline);\n }\n if (!!newPolyline) {\n newPolyline.addTo(this.map);\n this.fitBounds(newPolyline.getBounds());\n }\n\n return newPolyline;\n }, null),\n takeUntil(this.unsubscribeTrigger$)\n )\n .subscribe();\n }\n\n protected ngOnChanges(changes: SimpleChanges): void {\n if (!this.map) {\n return;\n }\n if (changes.assets?.currentValue && !changes.assets?.firstChange) {\n this.refreshMarkers();\n }\n\n if (changes.config?.currentValue && !changes.config?.firstChange) {\n this.changeConfig(changes.config);\n }\n }\n\n protected ngOnDestroy(): void {\n this.unsubscribeAllListeners();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n protected unsubscribeAllListeners() {\n this.unsubscribeTrigger$.next();\n this.stopRealtime();\n }\n\n protected initOutputs() {\n const getMapEventObservable = eventName => {\n return this.onMap.pipe(\n filter(map => !!map),\n switchMap(map => fromEvent<L.LeafletEvent>(map, eventName)),\n takeUntilDestroyed()\n );\n };\n const dragStart$ = getMapEventObservable('dragstart');\n const move$ = getMapEventObservable('move');\n const dragEnd$ = getMapEventObservable('dragend');\n\n this.onMove = dragStart$.pipe(\n switchMap(() => move$.pipe(takeUntil(dragEnd$))),\n takeUntil(this.unsubscribeTrigger$)\n );\n\n this.onMoveEnd = getMapEventObservable('moveend');\n\n this.onZoomEnd = getMapEventObservable('zoomend');\n\n this.onZoomStart = getMapEventObservable('zoomstart');\n }\n\n protected initMap(layers: MapTileLayer[], defaultConfig: MapConfig): void {\n const defaultOptions = {\n center: this.config.center || defaultConfig.center,\n zoomSnap: 0,\n zoom: this.config.zoomLevel || defaultConfig.zoomLevel,\n worldCopyJump: true\n };\n\n if (this.map) {\n this.map.remove();\n }\n this.map = this.leaflet.map(this.mapElement.nativeElement, defaultOptions);\n\n this.map.attributionControl.setPrefix('');\n\n this.fitBounds(this.config.bounds);\n\n this.addLayers(layers);\n\n this.handleMobile();\n\n this.onMap.next(this.map);\n\n if (this.config.realtime) {\n this.startRealtime();\n }\n\n this.isInit = true;\n this.onInit.emit(this.leaflet);\n }\n\n protected handleMobile() {\n // adding event listener to do mobile 2 finger scrolling\n if (this.leaflet.Browser.mobile) {\n const touchMsg = this.translateService.instant(gettext('Use two fingers to move the map.'));\n this.map.dragging.disable();\n const container = this.map.getContainer();\n container.setAttribute('data-touch-warning-content', touchMsg);\n container.addEventListener('touchstart', event => this.handleTouch(event));\n container.addEventListener('touchmove', event => this.handleTouch(event));\n container.addEventListener('touchend', event => this.handleTouch(event));\n container.addEventListener('touchcancel', event => this.handleTouch(event));\n container.addEventListener('click', event => this.handleTouch(event));\n }\n }\n\n protected addLayers(layers: MapTileLayer[]) {\n const flattenLayers: MapTileLayer[] = flatten(layers);\n const baseLayers: L.Control.LayersObject = {};\n const overlays: L.Control.LayersObject = {};\n let firstLayer = true;\n for (const layer of sortByPriority(flattenLayers)) {\n const objectToAddTo = layer.isOverlay ? overlays : baseLayers;\n if (objectToAddTo[layer.label]) {\n continue;\n }\n\n const tiles = this.leaflet.tileLayer(layer.layerUrl, layer.options);\n if (!layer.isOverlay && firstLayer) {\n firstLayer = false;\n tiles.addTo(this.map);\n }\n objectToAddTo[layer.label] = tiles;\n }\n if (flattenLayers.length > 1) {\n this.leaflet.control.layers(baseLayers, overlays, { position: 'bottomleft' }).addTo(this.map);\n }\n }\n\n protected changeConfig(change: SimpleChange) {\n if (this.hasChanged(change, 'zoomLevel')) {\n this.map.setZoom(this.config.zoomLevel);\n }\n\n if (this.hasChanged(change, 'center') && every(change.currentValue.center, p => !isNull(p))) {\n this.map.setView(change.currentValue.center);\n }\n\n if (this.hasChanged(change, 'icon') || this.hasChanged(change, 'color')) {\n this.refreshMarkers();\n }\n\n if (this.hasChanged(change, 'realtime') && change.currentValue.realtime) {\n this.startRealtime();\n }\n\n if (change.currentValue.realtime === false) {\n this.stopRealtime();\n }\n\n if (this.hasChanged(change, 'follow')) {\n this.moveToPositionOfMo(this.assets);\n }\n\n if (this.hasChanged(change, 'disablePan') || this.hasChanged(change, 'disableZoom')) {\n this.toggleControls();\n }\n }\n\n protected hasChanged(change: SimpleChange, prop: keyof MapConfig) {\n return change.currentValue[prop] !== change.previousValue[prop];\n }\n\n protected toggleControls() {\n if (this.config.disableZoom) {\n this.map.removeControl(this.map.zoomControl);\n this.map.scrollWheelZoom.disable();\n } else {\n this.map.addControl(this.map.zoomControl);\n this.map.scrollWheelZoom.enable();\n }\n if (this.config.disablePan) {\n this.map.dragging.disable();\n } else {\n this.map.dragging.enable();\n }\n }\n\n private handleTouch(e: Event) {\n // Disregard touch events on the minimap if present\n const ignoreList = [\n 'leaflet-control-minimap',\n 'leaflet-interactive',\n 'leaflet-popup-content',\n 'leaflet-popup-content-wrapper',\n 'leaflet-popup-close-button',\n 'leaflet-control-zoom-in',\n 'leaflet-control-zoom-out'\n ];\n\n let ignoreElement = false;\n for (let i = 0; i < ignoreList.length; i++) {\n if (this.leaflet.DomUtil.hasClass(e.target as HTMLElement, ignoreList[i])) {\n ignoreElement = true;\n }\n }\n\n const container = this.map.getContainer();\n if (ignoreElement) {\n if (\n this.leaflet.DomUtil.hasClass(e.target as HTMLElement, 'leaflet-interactive') &&\n e.type === 'touchmove' &&\n (e as TouchEvent).touches.length === 1\n ) {\n this.leaflet.DomUtil.addClass(container, 'touch-warning');\n this.map.dragging.disable();\n } else {\n this.leaflet.DomUtil.removeClass(container, 'touch-warning');\n }\n return;\n }\n\n if (e.type !== 'touchmove' && e.type !== 'touchstart') {\n this.leaflet.DomUtil.removeClass(container, 'touch-warning');\n return;\n }\n if ((e as TouchEvent).touches.length === 1) {\n this.leaflet.DomUtil.addClass(container, 'touch-warning');\n this.map.dragging.disable();\n } else {\n this.map.dragging.enable();\n this.leaflet.DomUtil.removeClass(container, 'touch-warning');\n }\n }\n\n private zoomToBound(assets: PositionManagedObject[]) {\n if (isEmpty(assets)) return;\n\n const bounds: [number, number][] = assets.map(asset => [\n asset.c8y_Position.lat,\n asset.c8y_Position.lng\n ]);\n if (assets.length > 1) {\n this.map.flyToBounds(bounds, { animate: false });\n return;\n }\n this.map.flyTo(\n [assets[0].c8y_Position.lat, assets[0].c8y_Position.lng],\n this.map.options.zoom,\n {\n animate: false\n }\n );\n }\n\n private fitBounds(bounds: L.LatLngBounds) {\n if (bounds?.isValid()) {\n this.map.fitBounds(bounds, this.config.fitBoundsOptions);\n }\n }\n\n private bindPopup(marker: C8yMarker, context: PositionManagedObject | IEvent) {\n if (this.popup) {\n marker.on('click', () => {\n this.popup.viewContainer.clear();\n const view = this.popup.viewContainer.createEmbeddedView(this.popup.template, {\n $implicit: context\n });\n view.detectChanges();\n marker\n .unbindPopup()\n .bindPopup(this.popup.elementRef.nativeElement.previousSibling, {\n offset: [-3, -40],\n maxWidth: 140,\n autoPan: true,\n closeButton: false\n })\n .openPopup();\n });\n }\n }\n}\n","<div class=\"c8y-map\">\n <div #map></div>\n</div>\n<ng-content></ng-content>\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n IterableDiffers,\n Output,\n SimpleChange,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { IManagedObject } from '@c8y/client';\nimport type { MapDefaultConfig, MapTileLayer } from '@c8y/options';\nimport {\n ColorService,\n CountdownIntervalComponent,\n DatePipe,\n GeoService,\n ManagedObjectRealtimeService,\n WidgetGlobalAutoRefreshService,\n globalAutoRefreshLoading,\n DynamicComponent,\n DynamicComponentAlertAggregator\n} from '@c8y/ngx-components';\nimport { TranslateService } from '@ngx-translate/core';\nimport type * as L from 'leaflet';\nimport {\n BehaviorSubject,\n EMPTY,\n Observable,\n combineLatest,\n from,\n fromEvent,\n merge,\n of\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n mergeMap,\n skip,\n switchMap,\n takeUntil,\n tap\n} from 'rxjs/operators';\nimport { ClusterMap } from './cluster-map';\nimport { MapComponent } from './map.component';\nimport {\n ClusterMapConfig,\n ClusterSize,\n MAP_DEFAULT_CONFIG,\n MAP_TILE_LAYER,\n PositionManagedObject\n} from './map.model';\nimport { MapService } from './map.service';\n\n/**\n * Smart map component for that clusters devices together when there are too many to display individually.\n * Unlike the basic map, this component loads device data dynamically and manages cluster rendering and updates.\n * Extends the base MapComponent with clustering, dynamic data loading, and advanced refresh logic.\n */\n@Component({\n selector: 'c8y-cluster-map',\n templateUrl: './cluster-map.component.html',\n providers: [ManagedObjectRealtimeService]\n})\nexport class ClusterMapComponent extends MapComponent implements DynamicComponent {\n /** Emits true while the map is loading or refreshing clusters. */\n isLoading$ = new BehaviorSubject(false);\n /** @ignore */\n countdownIntervalComp: CountdownIntervalComponent;\n\n /**\n * Cluster map configuration, including clustering thresholds and refresh intervals.\n */\n @Input()\n config: ClusterMapConfig;\n\n /**\n * The root managed object (e.g., group or device) for which to load and cluster data.\n */\n @Input()\n rootNode: IManagedObject;\n\n /**\n * Single asset to display (if not clustering). Used for following a specific device.\n * If provided, clusters will not be used, and the asset will be displayed individually.\n * If not provided, the component will cluster devices based on the root node.\n */\n @Input('asset')\n assets: PositionManagedObject;\n\n /**\n * Whether to show a color overlay for each cluster rectangle. This can be useful for debugging or visualizing clusters.\n */\n @Input()\n showClusterColor = false;\n\n /**\n * Emits Leaflet map change events (move, moveend) for external listeners.\n */\n @Output()\n mapChange = new EventEmitter<L.LeafletEvent>();\n\n /** Reference to the map element in the template. */\n @ViewChild('map')\n mapElement: ElementRef;\n\n /** Aggregator for dynamic component alerts. */\n alerts: DynamicComponentAlertAggregator;\n\n /** @ignore */\n errorNotifier = new BehaviorSubject(null);\n private reloadTrigger$ = new BehaviorSubject(false);\n private clusters: ClusterMap[] = [];\n private readonly EVENT_THROTTLE_TIME = 750;\n\n /**\n * Constructs the ClusterMapComponent, injecting required services and initializing the base map.\n */\n constructor(\n protected moRealtimeService: ManagedObjectRealtimeService,\n protected mapService: MapService,\n @Inject(MAP_TILE_LAYER) protected layers$: Observable<MapTileLayer[]>,\n @Inject(MAP_DEFAULT_CONFIG)\n protected defaultConfig$: Observable<MapDefaultConfig>,\n protected translateService: TranslateService,\n protected widgetGlobalAutoRefreshService: WidgetGlobalAutoRefreshService,\n private iterable: IterableDiffers,\n private colorService: ColorService,\n geo: GeoService,\n datePipe: DatePipe\n ) {\n super(\n moRealtimeService,\n mapService,\n layers$,\n defaultConfig$,\n translateService,\n geo,\n datePipe,\n widgetGlobalAutoRefreshService\n );\n }\n\n /**\n * @ignore\n */\n async ngOnChanges(changes: SimpleChanges) {\n if (changes.config?.firstChange) {\n return;\n }\n\n if (changes.rootNode?.previousValue !== changes.rootNode?.currentValue) {\n this.changeRootNode(changes.rootNode.currentValue);\n }\n\n if (changes.config?.currentValue) {\n this.changeConfig(changes.config);\n }\n }\n\n /**\n * Handles changes to the map configuration, including follow and refresh interval.\n * Cancels reload on follow, triggers reload on refresh interval change, and delegates to base config change logic.\n * @param change The config change object.\n */\n changeConfig(change: SimpleChange) {\n // on following, cancel reload to avoid stale state\n if (change.currentValue.follow === true) {\n this.cancelReload();\n this.isLoading$.next(false);\n }\n\n if (change.currentValue.refreshInterval !== change.previousValue.refreshInterval) {\n this.reload();\n }\n super.changeConfig(change);\n }\n\n /**\n * @ignore\n */\n async ngAfterViewInit() {\n if (!this.leaflet) {\n this.leaflet = await this.mapService.getLeaflet();\n }\n\n if (this.config.widgetInstanceGlobalAutoRefreshContext) {\n this.handleGlobalRefreshLoading();\n }\n combineLatest([this.layers$, this.defaultConfig$])\n .pipe(takeUntil(this.unsubscribeTrigger$))\n .subscribe(([layers, defaultConfig]) => {\n this.initMap(layers, defaultConfig);\n this.changeRootNode(this.rootNode);\n this.changeConfig(new SimpleChange({}, this.config, false));\n });\n }\n\n /**\n * Resets the map and clusters, re-initializing the component.\n */\n async reset() {\n this.ngOnDestroy();\n await this.ngAfterViewInit();\n }\n\n /**\n * Triggers a reload of cluster data.\n */\n reload() {\n this.reloadTrigger$.next(true);\n }\n\n /**\n * Cancels an ongoing reload operation.\n */\n cancelReload() {\n this.reloadTrigger$.next(false);\n }\n\n /**\n * Subscribes to cluster and interval changes, updating clusters as needed.\n * Handles auto-refresh and global refresh loading.\n */\n listenToClusterAndIntervalChanges() {\n const countdownEnded$ = this.config.widgetInstanceGlobalAutoRefreshContext\n ? this.widgetGlobalAutoRefreshService.countdownActions.countdownEnded$.pipe(\n takeUntil(this.destroy$)\n )\n : this.countdownIntervalComp\n ? this.countdownIntervalComp.countdownEnded.pipe(takeUntil(this.unsubscribeTrigger$))\n : EMPTY;\n\n const mapChange$ = this.getMapChangeObservable();\n merge(this.reloadTrigger$, mapChange$, countdownEnded$)\n .pipe(\n tap(value => {\n if (this.config.widgetInstanceGlobalAutoRefreshContext) {\n !this.isLeafletEventInterface(value) && this.isLoading$.next(true);\n return;\n }\n this.isLoading$.next(true);\n this.countdownIntervalComp?.stop(true);\n }),\n switchMap(value =>\n value === false\n ? of([])\n : from(this.mapService.getClusterSize(this.map.getBounds())).pipe(\n mergeMap((clusterSize: ClusterSize) =>\n this.getClusterRects(clusterSize, this.map.getBounds())\n ),\n mergeMap(rects => this.createOrUpdateCluster(rects)),\n catchError(error => {\n this.errorNotifier.next(error);\n\n return of([]);\n })\n )\n ),\n takeUntil(this.unsubscribeTrigger$)\n )\n .subscribe((clusters: ClusterMap[]) => {\n clusters.forEach(cluster => cluster.render(this.map));\n this.isLoading$.next(false);\n if (this.config.widgetInstanceGlobalAutoRefreshContext) {\n return;\n }\n this.countdownIntervalComp?.start();\n });\n }\n\n /**\n * Subscribes to map change events for cluster updates.\n */\n listenToClusterMapChanges() {\n this.getMapChangeObservable().subscribe();\n }\n\n /**\n * Refreshes markers or clusters, depending on whether a single asset or clusters are shown.\n */\n refreshMarkers() {\n if (this.assets) {\n super.refreshMarkers();\n return;\n }\n this.clusters.forEach(cluster => {\n cluster.clear(this.map);\n });\n this.reload();\n }\n\n private changeRootNode(mo: IManagedObject) {\n this.unsubscribeAllListeners();\n this.clearMarkers();\n this.clearClusters();\n\n const isPositionDevice = mo?.c8y_Position && mo?.c8y_IsDevice;\n if (isPositionDevice) {\n this.assets = mo as PositionManagedObject;\n this.refreshMarkers();\n this.listenToClusterMapChanges();\n } else {\n this.assets = null;\n this.listenToClusterAndIntervalChanges();\n this.reload();\n }\n }\n\n private async getClusterRects(\n levelThreshold: ClusterSize = ClusterSize.FOUR,\n viewBounds: L.LatLngBounds,\n level = 0\n ): Promise<L.Rectangle[]> {\n let rects = [];\n\n if (levelThreshold === ClusterSize.NONE) {\n const rect = await this.getRect(viewBounds);\n rects.push(rect);\n return rects;\n }\n\n if (level >= levelThreshold) {\n return rects;\n }\n level++;\n\n const { lat: x1, lng: y1 } = viewBounds.getSouthWest();\n const { lat: x2, lng: y2 } = viewBounds.getNorthEast();\n const newX2 = (x1 + x2) / 2;\n const newY2 = (y1 + y2) / 2;\n\n const bounds: [[number, number], [number, number]][] = [\n [\n [x1, y1],\n [newX2, newY2]\n ],\n [\n [newX2, newY2],\n [x2, y2]\n ],\n [\n [x1, newY2],\n [newX2, y2]\n ],\n [\n [newX2, y1],\n [x2, newY2]\n ]\n ];\n for (const bound of bounds) {\n const latLngBound = this.leaflet.latLngBounds(bound);\n const rect = await this.getRect(latLngBound);\n rects = [...rects, ...(await this.getClusterRects(levelThreshold, latLngBound, level))];\n\n if (level === levelThreshold) {\n rects.push(rect);\n }\n }\n\n return rects;\n }\n\n private async getRect(latLngBound: L.LatLngBounds) {\n let color = 'none';\n if (this.showClusterColor) {\n color = await this.colorService.generateColor(latLngBound.toBBoxString());\n }\n const rect = this.leaflet.rectangle(latLngBound, {\n color,\n weight: color === 'none' ? 0 : 1,\n interactive: false\n });\n return rect;\n }\n\n private clearClusters() {\n this.clusters.forEach(cluster => {\n cluster.clear(this.map);\n });\n this.clusters = [];\n }\n\n private async updateCluster(cluster: ClusterMap) {\n const clusterCount = await this.mapService.getPositionMOsFromBoundCount(\n cluster.rect.getBounds(),\n this.rootNode\n );\n if (clusterCount > this.mapService.MAX_DEVICE_PER_CLUSTER) {\n cluster.setClusterToBigMarker(this.map, clusterCount, this.leaflet);\n cluster.positions = [];\n return cluster;\n }\n\n cluster.removeClusterToBigMarker();\n cluster.positions = await this.mapService.getPositionMOsFromBound(\n cluster.rect.getBounds(),\n this.rootNode\n );\n return cluster;\n }\n\n private createOrUpdateCluster(rects: L.Rectangle<unknown>[]) {\n const isNew = rects.length !== this.clusters.length;\n if (isNew) {\n this.clearClusters();\n }\n const updatePromise = rects.map((rect, index) => {\n if (isNew) {\n const cluster = new ClusterMap(\n this.iterable,\n asset => this.getAssetMarker(asset),\n this.translateService\n );\n this.clusters.push(cluster);\n }\n this.clusters[index].rect = rect;\n return this.updateCluster(this.clusters[index]);\n });\n\n return Promise.all(updatePromise);\n }\n\n private getMapChangeObservable() {\n return merge(\n fromEvent<L.LeafletEvent>(this.map, 'move'),\n fromEvent<L.LeafletEvent>(this.map, 'moveend')\n ).pipe(\n debounceTime(this.EVENT_THROTTLE_TIME),\n tap(event => this.mapChange.emit(event)),\n takeUntil(this.unsubscribeTrigger$)\n );\n }\n\n private isLeafletEventInterface(\n LeafletEventObject: L.LeafletEvent | boolean | void\n ): LeafletEventObject is L.LeafletEvent {\n return (LeafletEventObject as L.LeafletEvent)?.type !== undefined;\n }\n\n private handleGlobalRefreshLoading(): void {\n this.isLoading$\n .pipe(\n skip(1),\n globalAutoRefreshLoading(this.widgetGlobalAutoRefreshService),\n takeUntil(this.destroy$)\n )\n .subscribe();\n\n this.destroy$.subscribe({\n complete: () =>\n this.isLoading$.value && this.widgetGlobalAutoRefreshService.decrementLoading()\n });\n }\n}\n","<div class=\"c8y-map\">\n <div #map></div>\n</div>\n<ng-content></ng-content>\n","import { Component, EventEmitter, Input, Output, SimpleChanges, ViewChild } from '@angular/core';\nimport { CountdownIntervalComponent, IconDirective, C8yTranslatePipe } from '@c8y/ngx-components';\nimport { cloneDeep } from 'lodash-es';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { ClusterMapComponent } from './cluster-map.component';\nimport { ClusterMapConfig, MapStatusButtonsConfig, PositionManagedObject } from './map.model';\nimport { NgIf, NgClass, AsyncPipe } from '@angular/common';\nimport { TooltipDirective } from 'ngx-bootstrap/tooltip';\n\n/**\n * Component to display controls and status information for a map rendered on an IoT Dashboard.\n * Provides UI for centering, fitting bounds, toggling real-time updates, auto-refresh, and following assets.\n */\n@Component({\n selector: 'c8y-map-status',\n templateUrl: './map-status.component.html',\n imports: [\n NgIf,\n NgClass,\n TooltipDirective,\n CountdownIntervalComponent,\n IconDirective,\n AsyncPipe,\n C8yTranslatePipe\n ]\n})\nexport class MapStatusComponent {\n /**\n * Map configuration object, including center, refresh interval, and other map options.\n */\n @Input()\n config: ClusterMapConfig;\n\n /**\n * List of managed objects with position information to be displayed on the map.\n */\n @Input() assets: PositionManagedObject[];\n\n /**\n * Emits when the map configuration changes (e.g., toggling real-time, follow, etc.).\n */\n @Output()\n configChange = new EventEmitter<ClusterMapConfig>();\n\n /**\n * Emits when the user unfollows an asset on the map.\n */\n @Output()\n onUnfollow = new EventEmitter<ClusterMapConfig>();\n\n /**\n * Emits when the user requests to fit all assets within the map bounds.\n */\n @Output() fitAssetsToBounds = new EventEmitter<void>();\n\n /**\n * Reference to the ClusterMapComponent instance rendered in the view.\n */\n @Input()\n clusterMap: ClusterMapComponent;\n\n /**\n * Configuration for which map status buttons are shown/enabled.\n * By default the \"center\" button is shown and realtime is disabled.\n * See {@link MapStatusButtonsConfig} for available options.\n */\n @Input() buttonsConfig: Partial<MapStatusButtonsConfig> = {};\n\n /**\n * @ignore\n */\n @ViewChild(CountdownIntervalComponent) countdownIntervalComp: CountdownIntervalComponent;\n\n /**\n * @ignore\n */\n initConfig: ClusterMapConfig;\n\n /**\n * @ignore\n */\n refreshPaused = false;\n\n private destroy$ = new Subject<void>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.initConfig = cloneDeep(this.config);\n this.buttonsConfig = Object.assign(this.defaultButtonsConfig(), this.buttonsConfig);\n }\n\n /**\n * @ignore\n */\n ngAfterViewInit(): void {\n if (!this.config.widgetInstanceGlobalAutoRefreshContext) {\n this.clusterMap.countdownIntervalComp = this.countdownIntervalComp;\n }\n }\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.clusterMap?.previousValue !== changes.clusterMap?.currentValue) {\n this.checkIfMapIsAlreadyCentered();\n }\n }\n\n /**\n * Centers the map on the configured center coordinates.\n */\n center() {\n this.clusterMap.center();\n }\n\n /**\n * Emits an event to fit all assets within the map bounds and disables the button until the next change.\n */\n fitToBounds() {\n this.buttonsConfig.fitToBounds.disabled = true;\n this.fitAssetsToBounds.emit();\n }\n\n /**\n * Reloads the map data.\n */\n reload() {\n this.clusterMap.reload();\n }\n\n /**\n * Cancels the map reload operation.\n */\n cancelReload() {\n this.clusterMap.cancelReload();\n }\n\n /**\n * Toggles real-time updates for the map.\n */\n toggleRealtime() {\n this.config = {\n ...this.config,\n realtime: !this.config.realtime\n };\n this.configChange.emit(this.config);\n }\n\n /**\n * Toggles the auto-refresh state for the map, pausing or resuming the countdown.\n * @param $event Mouse event to prevent default and stop propagation.\n */\n toggleAutoRefresh($event: MouseEvent) {\n $event.preventDefault();\n $event.stopPropagation();\n this.refreshPaused = !this.refreshPaused;\n if (this.refreshPaused) {\n this.countdownIntervalComp.stop(true);\n } else {\n this.countdownIntervalComp.start();\n }\n }\n\n /**\n * Disables following an asset on the map and emits the change.\n */\n unfollow() {\n this.config = {\n ...this.clusterMap.config,\n follow: false\n };\n this.configChange.emit(this.config);\n this.onUnfollow.emit(this.config);\n }\n\n /**\n * Enables following an asset on the map and emits the change.\n */\n follow() {\n this.config = {\n ...this.config,\n follow: true\n };\n this.configChange.emit(this.config);\n }\n\n /**\n * @ignore\n */\n ngOnDestroy(): void {\n this.destroy$.next();\n }\n\n /**\n * Subscribes to map changes and updates button states based on map bounds and center.\n */\n private checkIfMapIsAlreadyCentered() {\n this.clusterMap.mapChange.pipe(takeUntil(this.destroy$)).subscribe((event: L.LeafletEvent) => {\n if (event.sourceTarget?.getBounds) {\n const bounds: L.LatLngBounds = event.sourceTarget.getBounds();\n this.buttonsConfig.fitToBounds.disabled = this.shouldDisableFitToBoundsButton(bounds);\n if (this.config?.center) {\n this.buttonsConfig.center.disabled = this.shouldDisableCenterButton(bounds);\n }\n }\n });\n }\n\n /**\n * Checks if Center button should be disabled according to provided bounds.\n * Provided bounds contain coordinates of current map rectangle corners.\n * Center button should be disabled if distance between center coordinates (from config) and center of current bounds\n * is less than 1/4 of bounds dimensions.\n * To achieve it we just need to check if center coordinates (from config) are contained in the boundaries of\n * current bounds shrunk by 25%.\n * @param bounds Current map view boundaries.\n * @returns True if distance between config center and current boundaries center is bigger than 1/4 of boundaries dimensions\n */\n private shouldDisableCenterButton(bounds: L.LatLngBounds): boolean {\n const shrunkBounds = bounds.pad(-0.25);\n return shrunkBounds.contains(this.config.center);\n }\n\n /**\n * Checks if Fit to Bounds button should be disabled based on whether all assets are within the current bounds.\n * @param bounds Current map view boundaries.\n * @returns True if all assets are already within bounds, false otherwise.\n */\n private shouldDisableFitToBoundsButton(bounds: L.LatLngBounds): boolean {\n if (!this.assets) {\n return true;\n }\n return this.assets.every(({ c8y_Position }) =>\n bounds.contains([c8y_Position.lat, c8y_Position.lng])\n );\n }\n\n /**\n * Returns the default configuration for map status buttons.\n * @returns Default MapStatusButtonsConfig object.\n */\n private defaultButtonsConfig(): MapStatusButtonsConfig {\n return {\n realtime: { show: this.config.realtime || this.clusterMap.config.follow, disabled: false },\n fitToBounds: { show: false, disabled: false },\n center: { show: true, disabled: false }\n };\n }\n}\n","<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <label\n class=\"toggle-countdown vertical\"\n [attr.aria-label]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n [tooltip]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n placement=\"left\"\n *ngIf=\"\n !config.widgetInstanceGlobalAutoRefreshContext &&\n clusterMap?.config.refreshInterval &&\n !clusterMap?.config.follow\n \"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"1000\"\n >\n <input\n type=\"checkbox\"\n (click)=\"toggleAutoRefresh($event)\"\n />\n <c8y-countdown-interval\n [hidden]=\"refreshPaused\"\n [countdownInterval]=\"clusterMap?.config.refreshInterval\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"refreshPaused\"\n ></i>\n </label>\n\n <button\n title=\"{{ 'Cancel reload' | translate }}\"\n type=\"button\"\n *ngIf=\"(clusterMap?.isLoading$ | async) && !config.widgetInstanceGlobalAutoRefreshContext\"\n (click)=\"cancelReload()\"\n >\n <i\n class=\"icon-spin\"\n c8yIcon=\"refresh\"\n ></i>\n </button>\n <button\n [title]=\"'Reload' | translate\"\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime &&\n !clusterMap?.assets &&\n !(clusterMap?.isLoading$ | async) &&\n !config.widgetInstanceGlobalAutoRefreshContext\n \"\n (click)=\"reload()\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n title=\"{{ 'Center map' | translate }}\"\n type=\"button\"\n (click)=\"center()\"\n [disabled]=\"buttonsConfig.center.disabled || clusterMap?.config.follow\"\n *ngIf=\"buttonsConfig.center.show\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n title=\"{{ 'Fit to assets bounds' | translate }}\"\n type=\"button\"\n (click)=\"fitToBounds()\"\n [disabled]=\"buttonsConfig.fitToBounds.disabled || clusterMap?.config.follow\"\n *ngIf=\"buttonsConfig.fitToBounds.show\"\n >\n <i c8yIcon=\"waypoint-map\"></i>\n </button>\n <button\n title=\"{{ 'Unfollow' | translate }}\"\n type=\"button\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n title=\"{{ 'Follow' | translate }}\"\n type=\"button\"\n *ngIf=\"initConfig.follow && !clusterMap?.config.follow\"\n (click)=\"follow()\"\n >\n <i c8yIcon=\"marker\"></i>\n </button>\n </div>\n </div>\n</div>\n","import { CommonModule as NgCommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule as NgFormsModule } from '@angular/forms';\nimport { CommonModule, CoreModule, FormsModule, RealtimeModule } from '@c8y/ngx-components';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { ClusterMapComponent } from './cluster-map.component';\nimport { MapPopupDirective } from './map-popup.directive';\nimport { MapStatusComponent } from './map-status.component';\nimport { MapComponent } from './map.component';\nimport { MAP_DEFAULT_CONFIG, MAP_TILE_LAYER } from './map.model';\nimport { MapService } from './map.service';\n\n@NgModule({\n imports: [\n NgCommonModule,\n NgFormsModule,\n CommonModule,\n FormsModule,\n RealtimeModule,\n CoreModule,\n TooltipModule,\n MapComponent,\n MapStatusComponent,\n ClusterMapComponent,\n MapPopupDirective\n ],\n exports: [MapComponent, MapStatusComponent, ClusterMapComponent, MapPopupDirective],\n providers: [\n {\n provide: MAP_TILE_LAYER,\n useFactory: (mapService: MapService) => {\n return mapService.getMapTileLayers$();\n },\n deps: [MapService]\n },\n {\n provide: MAP_DEFAULT_CONFIG,\n useFactory: (mapService: MapService) => {\n return mapService.getDefaultConfig();\n },\n deps: [MapService]\n }\n ]\n})\nexport class MapModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","i1","i2.MapService","NgCommonModule","NgFormsModule","CommonModule","FormsModule"],"mappings":";;;;;;;;;;;;;;;;;;AAOA;;;;;;AAMG;SACa,YAAY,CAAC,MAAgB,EAAE,KAA6B,EAAE,KAAc,EAAA;AACzF,IAAA,MAAoB,CAAC,KAAK,GAAG,KAAK;AAClC,IAAA,MAAoB,CAAC,KAAK,GAAG,KAAK;AACnC,IAAA,OAAO,MAAmB;AAC5B;AAEA;;AAEG;MACU,cAAc,GAAG,IAAI,cAAc,CAA6B,gBAAgB;AA2B7F;;AAEG;IACS;AAAZ,CAAA,UAAY,WAAW,EAAA;;AAErB,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;;AAER,IAAA,WAAA,CAAA,WAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;;AAER,IAAA,WAAA,CAAA,WAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW;AACb,CAAC,EAPW,WAAW,KAAX,WAAW,GAAA,EAAA,CAAA,CAAA;AASvB;;AAEG;IACS;AAAZ,CAAA,UAAY,mBAAmB,EAAA;;AAE7B,IAAA,mBAAA,CAAA,QAAA,CAAA,GAAA,YAAqB;;AAErB,IAAA,mBAAA,CAAA,QAAA,CAAA,GAAA,YAAqB;AACvB,CAAC,EALW,mBAAm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,YAAc;wBACdC,WAAa;wBACbC,cAAY;wBACZC,aAAW;wBACX,cAAc;wBACd,UAAU;wBACV,aAAa;wBACb,YAAY;wBACZ,kBAAkB;wBAClB,mBAAmB;wBACnB;AACD,qBAAA;oBACD,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,CAAC;AACnF,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,cAAc;AACvB,4BAAA,UAAU,EAAE,CAAC,UAAsB,KAAI;AACrC,gCAAA,OAAO,UAAU,CAAC,iBAAiB,EAAE;4BACvC,CAAC;4BACD,IAAI,EAAE,CAAC,UAAU;AAClB,yBAAA;AACD,wBAAA;AACE,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,UAAU,EAAE,CAAC,UAAsB,KAAI;AACrC,gCAAA,OAAO,UAAU,CAAC,gBAAgB,EAAE;4BACtC,CAAC;4BACD,IAAI,EAAE,CAAC,UAAU;AAClB;AACF;AACF,iBAAA;;;AC3CD;;AAEG;;;;"}
1
+ {"version":3,"file":"c8y-ngx-components-map.mjs","sources":["../../map/map.model.ts","../../map/map.service.ts","../../map/cluster-map.ts","../../map/map-popup.directive.ts","../../map/map.component.ts","../../map/map.component.html","../../map/cluster-map.component.ts","../../map/cluster-map.component.html","../../map/map-status.component.ts","../../map/map-status.component.html","../../map/map.module.ts","../../map/c8y-ngx-components-map.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { IEvent, IManagedObject } from '@c8y/client';\nimport type { MapDefaultConfig, MapTileLayer } from '@c8y/options';\nimport type * as L from 'leaflet';\nimport { Observable } from 'rxjs';\nimport { GlobalAutoRefreshWidgetConfig } from '@c8y/ngx-components';\n\n/**\n * Utility function to assign asset and event information to a Leaflet marker.\n * @param marker The Leaflet marker instance.\n * @param asset The managed object representing the asset (optional).\n * @param event The event associated with the marker (optional).\n * @returns The marker with asset and/or event information attached.\n */\nexport function getC8yMarker(marker: L.Marker, asset?: PositionManagedObject, event?: IEvent) {\n (marker as C8yMarker).asset = asset;\n (marker as C8yMarker).event = event;\n return marker as C8yMarker;\n}\n\n/**\n * Injection token for providing map tile layers as an observable.\n */\nexport const MAP_TILE_LAYER = new InjectionToken<Observable<MapTileLayer[]>>('MAP_TILE_LAYER');\n\n/**\n * Utility type to require only one of the specified keys in a type.\n * @ignore\n */\ntype RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &\n { [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>> }[Keys];\n\n/**\n * Attributes that can be attached to a Cumulocity marker.\n */\ninterface C8yMarkerAttr {\n asset: PositionManagedObject;\n event: IEvent;\n}\n\n/**\n * Type representing the attribute keys for a Cumulocity marker.\n */\nexport type C8yMarkerAttributes = keyof C8yMarkerAttr;\n\n/**\n * Leaflet marker extended with either asset or event information.\n */\nexport type C8yMarker = L.Marker & RequireOnlyOne<C8yMarkerAttr, 'asset' | 'event'>;\n\n/**\n * Enum for supported cluster sizes on the map.\n */\nexport enum ClusterSize {\n /** No clustering. */\n NONE = 0,\n /** Cluster of 4. */\n FOUR = 1,\n /** Cluster of 16. */\n SIXTEEN = 2\n}\n\n/**\n * Enum for map tenant option keys used in configuration.\n */\nexport enum MapTenantOptionKeys {\n /** Map configuration key. */\n CONFIG = 'map-config',\n /** Map layers key. */\n LAYERS = 'map-layers'\n}\n\n/**\n * Managed object with position and optional alarm status and icon for map display.\n */\nexport interface PositionManagedObject extends IManagedObject {\n /**\n * Position information (latitude, longitude, optional altitude).\n */\n c8y_Position: {\n lat: number;\n lng: number;\n alt?: number;\n };\n\n /**\n * Optional active alarms status for the asset.\n */\n c8y_ActiveAlarmsStatus?: {\n minor: number;\n major: number;\n warning: number;\n critical: number;\n };\n\n /**\n * Optional icon information for the asset.\n */\n icon?: {\n name: string;\n };\n}\n\n/**\n * Configuration for the cluster map, including center and refresh interval.\n */\nexport type ClusterMapConfig = MapConfig & {\n /**\n * Center coordinates of the map [latitude, longitude].\n */\n center: [number, number];\n /**\n * Optional refresh interval in milliseconds (null for no auto-refresh).\n */\n refreshInterval?: number | null;\n};\n\n/**\n * General map configuration, including options for following, real-time, icon, color, zoom, pan, and bounds.\n */\nexport type MapConfig = MapDefaultConfig & {\n /** Whether the map should follow the selected asset. */\n follow?: boolean;\n /** Whether the map should update in real-time. */\n realtime?: boolean;\n /** Optional icon name for the map. */\n icon?: string;\n /** Optional color for the map or marker. */\n color?: string;\n /** Disable zoom controls. */\n disableZoom?: boolean;\n /** Disable pan controls. */\n disablePan?: boolean;\n /** Optional map bounds. */\n bounds?: L.LatLngBounds;\n /** Optional fit bounds options. */\n fitBoundsOptions?: L.FitBoundsOptions;\n} & GlobalAutoRefreshWidgetConfig;\n\n/**\n * Injection token for providing the default map configuration as an observable.\n */\nexport const MAP_DEFAULT_CONFIG = new InjectionToken<Observable<MapDefaultConfig>>(\n 'MAP_DEFAULT_CONFIG'\n);\n\n/**\n * Default map tile layer configuration (OpenStreetMap).\n */\nexport const defaultLayer: MapTileLayer = {\n layerUrl: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n label: 'OpenStreetMap',\n priority: 1000,\n options: {\n maxZoom: 18,\n minZoom: 0,\n attribution:\n '&copy;<a href=\"http://www.openstreetmap.org/copyright\" rel=\"noreferrer nofollow\">OpenStreetMap</a>',\n noWrap: false\n }\n};\n\n/**\n * Default map configuration (centered on Düsseldorf, zoom level 2).\n */\nexport const defaultMapConfig: MapDefaultConfig = {\n center: [51.23544, 6.79599], // Düsseldorf\n zoomLevel: 2\n};\n\n/**\n * Default options for fitting map bounds (padding).\n */\nexport const defaultFitBoundsOptions: L.FitBoundsOptions = {\n padding: [50, 50]\n};\n\n/**\n * Configuration for the status buttons shown on the map UI.\n */\nexport type MapStatusButtonsConfig = {\n /** Real-time button configuration. */\n realtime: { show: boolean; disabled?: boolean };\n /** Fit to bounds button configuration. */\n fitToBounds: { show: boolean; disabled?: boolean };\n /** Center button configuration. */\n center: { show: boolean; disabled?: boolean };\n};\n","import { Injectable } from '@angular/core';\nimport {\n IIdentified,\n IManagedObject,\n InventoryService,\n IResultList,\n Paging,\n QueriesUtil\n} from '@c8y/client';\nimport { FeatureCacheService, OptionsService, ServiceRegistry } from '@c8y/ngx-components';\nimport type { MapDefaultConfig, MapTileLayer } from '@c8y/options';\nimport type * as L from 'leaflet';\nimport { latLng, latLngBounds } from 'leaflet';\nimport { get } from 'lodash-es';\nimport { combineLatest, defer, firstValueFrom, Observable, of } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport {\n ClusterSize,\n defaultLayer,\n defaultMapConfig,\n MapTenantOptionKeys,\n PositionManagedObject\n} from './map.model';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MapService {\n /**\n * Returns asset icon status for highest alarm severity found in device object.\n * @param device Device that contains alarms information.\n * @returns Status string according to alarm severity\n */\n static getStatus(device: PositionManagedObject) {\n if (!device.c8y_ActiveAlarmsStatus) {\n return 'text-muted';\n }\n if (device.c8y_ActiveAlarmsStatus.critical) {\n return 'status critical';\n }\n if (device.c8y_ActiveAlarmsStatus.major) {\n return 'status major';\n }\n if (device.c8y_ActiveAlarmsStatus.minor) {\n return 'status minor';\n }\n if (device.c8y_ActiveAlarmsStatus.warning) {\n return 'status warning';\n }\n return 'text-muted';\n }\n /**\n * The devices that are maximal displayed in one cluster.\n */\n MAX_DEVICE_PER_CLUSTER = 200;\n /**\n * The count until the cluster is sized. There are a maximum of\n * three clusters: 1, 4 or 16.\n */\n CLUSTER_LEVEL_THRESHOLD = 500;\n\n private queriesUtil = new QueriesUtil();\n\n /**\n * @ignore: Only DI.\n */\n constructor(\n private inventory: InventoryService,\n private options: OptionsService,\n private serviceRegistry: ServiceRegistry,\n private featureCacheService: FeatureCacheService\n ) {}\n\n /**\n * Returns the leaflet instance used by the cumulocity core.\n */\n async getLeaflet() {\n const originalLeflet = window.L;\n const c8yLeafletInstance = (await import('leaflet')).default;\n c8yLeafletInstance.noConflict();\n window.L = originalLeflet;\n return c8yLeafletInstance;\n }\n\n /**\n * Verifies if a given managed object is a device with a position fragment.\n * @param mo The given managed object.\n */\n isPositionedDevice(mo: IIdentified) {\n return !!(mo?.c8y_IsDevice && this.hasPosition(mo));\n }\n\n /**\n * Verifies if a given managed object has a position fragment.\n * @param mo The given managed object.\n */\n hasPosition(mo: IIdentified) {\n return mo?.c8y_Position;\n }\n\n getMapTileLayerProviders(): CumulocityServiceRegistry.MapTileLayerProvider[] {\n const layerProviders = this.serviceRegistry.get('mapTileLayerHook');\n\n return layerProviders;\n }\n\n getMapTileLayersFromHookedProviders$(\n layerProviders: CumulocityServiceRegistry.MapTileLayerProvider[]\n ): Observable<MapTileLayer[]> {\n if (!layerProviders.length) {\n return of([]);\n }\n const layers = combineLatest(layerProviders.map(provider => provider.getMapTileLayers$()));\n return layers.pipe(map(layers => layers.flat()));\n }\n\n /**\n * Returns the layers available in this application.\n * Layers are taken from plugins installed to this application.\n * In case none of the plugins override the default layers, the default layers are also considered.\n * @returns The layers.\n */\n getMapTileLayers$(): Observable<MapTileLayer[]> {\n return defer(() => {\n const layerProviders = this.getMapTileLayerProviders();\n const overridesDefaultLayer = layerProviders.some(provider =>\n provider.overridesDefaultLayer?.()\n );\n const layersFromProviders = defer(() =>\n this.getMapTileLayersFromHookedProviders$(layerProviders)\n );\n if (overridesDefaultLayer) {\n return layersFromProviders;\n }\n\n return combineLatest([this.getDefaultLayers(), layersFromProviders]).pipe(\n map(layers => {\n return layers.flat();\n })\n );\n });\n }\n\n /**\n * Returns the layers configured in the current platform via tenant options.\n * @returns The layers. If not set in tenant options the default layers.\n */\n getDefaultLayers(): Observable<MapTileLayer[]> {\n return this.getMapOption<MapTileLayer[]>(\n MapTenantOptionKeys.LAYERS,\n this.options.mapLayers || [defaultLayer]\n );\n }\n\n /**\n * Returns the map configuration configured on the tenant.\n * @returns The configuration. If not set in tenant options the default configuration.\n */\n getDefaultConfig(): Observable<MapDefaultConfig> {\n return this.getMapOption<MapDefaultConfig>(\n MapTenantOptionKeys.CONFIG,\n this.options.mapConfig || defaultMapConfig\n );\n }\n\n /**\n * Counts all managed objects in a given bound with a c8y_Position fragment.\n * @param bound The lat lng bound to request the managed objects for.\n * @param isinhierarchyofMO The group managed object of which direct children should be searched for.\n * @returns The number of all position managed objects in the given bound (and group).\n */\n async getPositionMOsFromBoundCount(\n bound: L.LatLngBounds,\n isinhierarchyofMO?: IManagedObject\n ): Promise<number> {\n return this.getPositionMOsFromBound(bound, isinhierarchyofMO, true) as Promise<number>;\n }\n\n /**\n * Returns all managed objects with a c8y_Position fragment in a certain boundary.\n * @param bound The lat lng bound to request the managed objects for.\n * @returns All position managed objects in the given bound.\n */\n async getPositionMOsFromBound(bound: L.LatLngBounds): Promise<PositionManagedObject[]>;\n /**\n * Returns all managed objects with a c8y_Position fragment in a certain boundary that belongs to a certain group.\n * @param bound The lat lng bound to request the managed objects for.\n * @param isinhierarchyofMO The group managed object of which direct children should be searched for.\n * @returns All position managed objects in the given bound that are children of the given group.\n */\n async getPositionMOsFromBound(\n bound: L.LatLngBounds,\n isinhierarchyofMO: IManagedObject\n ): Promise<PositionManagedObject[]>;\n /**\n * Counts the managed objects in a certain boundary belonging to a group.\n * @param bound The lat lng bound to request the managed objects for.\n * @param isinhierarchyofMO The group managed object of which direct children should be searched for.\n * @return The count of the managed objects.\n */\n async getPositionMOsFromBound(\n bound: L.LatLngBounds,\n isinhierarchyofMO: IManagedObject,\n count: true\n ): Promise<number>;\n async getPositionMOsFromBound(\n bound: L.LatLngBounds,\n isinhierarchyofMO?: IManagedObject,\n count = false\n ): Promise<PositionManagedObject[] | number> {\n const { lat: latMin, lng: lngMinRaw } = bound.getSouthWest();\n const { lat: latMax, lng: lngMaxRaw } = bound.getNorthEast();\n\n const lngMin = lngMaxRaw - lngMinRaw > 360 ? -180 : this.normalizeLongitude(lngMinRaw);\n const lngMax = lngMaxRaw - lngMinRaw > 360 ? 180 : this.normalizeLongitude(lngMaxRaw);\n\n const filterObjWithCoordinates = {\n __and: [\n ...(isinhierarchyofMO\n ? [\n {\n __or: [\n { id: isinhierarchyofMO.id },\n await this.childrenOfGroupFilter(isinhierarchyofMO)\n ]\n }\n ]\n : []),\n {\n __has: 'c8y_Position'\n },\n {\n ['c8y_Position.lat']: {\n __gt: latMin\n }\n },\n {\n ['c8y_Position.lat']: {\n __lt: latMax\n }\n },\n {\n [lngMin < lngMax ? '__and' : '__or']: [\n {\n ['c8y_Position.lng']: {\n __gt: lngMin\n }\n },\n {\n ['c8y_Position.lng']: {\n __lt: lngMax\n }\n }\n ]\n }\n ]\n };\n\n const query = this.queriesUtil.buildQuery(filterObjWithCoordinates);\n\n const { paging, data } = await this.inventory.list({\n pageSize: count ? 1 : this.MAX_DEVICE_PER_CLUSTER,\n withTotalPages: count,\n query\n });\n if (count) {\n return paging.totalPages;\n }\n return data.map((pmo: PositionManagedObject) =>\n bound.contains(latLng(pmo.c8y_Position.lat, pmo.c8y_Position.lng))\n ? pmo\n : this.denormalizePMO(pmo, bound)\n ) as PositionManagedObject[];\n }\n\n /**\n * Returns all devices with c8y_Position.\n */\n async getPositionDevices(): Promise<PositionManagedObject[]>;\n /**\n * Returns all devices with c8y_Position.\n * @param pageSize The page size to return.\n */\n async getPositionDevices(pageSize: number): Promise<PositionManagedObject[]>;\n /**\n * Returns all devices with c8y_Position.\n * @param pageSize The page size to return.\n * @param count Counting is disabled\n */\n async getPositionDevices(pageSize: number, count: false): Promise<PositionManagedObject[]>;\n /**\n * Returns the number of all devices with c8y_Position.\n * @param pageSize The page size to return.\n * @param count Counting is enabled\n */\n async getPositionDevices(pageSize: number, count: true): Promise<number>;\n /**\n * Returns all devices with c8y_Position.\n * @param pageSize The page size to return.\n * @param count Switches to counting only.\n * @returns All devices or the device count with a c8y_Position fragment.\n */\n async getPositionDevices(\n pageSize = this.MAX_DEVICE_PER_CLUSTER,\n count?: boolean\n ): Promise<number | PositionManagedObject[]> {\n const query = this.queriesUtil.buildQuery({\n __and: [{ __has: 'c8y_Position' }, { __has: 'c8y_IsDevice' }]\n });\n const { paging, data } = await this.inventory.list({\n pageSize: count ? 1 : pageSize,\n withTotalPages: !!count,\n query\n });\n if (count) {\n return paging.totalPages;\n }\n return data as PositionManagedObject[];\n }\n\n /**\n * Returns all managed object with a c8y_Position fragment.\n * @param isinhierarchyofMO The group managed object of which direct children should be searched for.\n * @param pageSize Defines how many results should be returned.\n * @returns The managed objects with position.\n */\n async getAllPositionMOs(\n isinhierarchyofMO?: IIdentified,\n pageSize = 500\n ): Promise<IResultList<PositionManagedObject>> {\n const childrenFilter = isinhierarchyofMO\n ? await this.childrenOfGroupFilter(isinhierarchyofMO)\n : undefined;\n\n const orValue = childrenFilter ? [{ id: isinhierarchyofMO.id }, childrenFilter] : undefined;\n\n const queryObj = {\n __filter: {\n __and: [{ __has: 'c8y_Position' }],\n ...(orValue ? { __or: orValue } : {})\n }\n };\n\n const query = this.queriesUtil.buildQuery(queryObj);\n const filter: { pageSize: number; withTotalPages: boolean; query: string } = {\n pageSize,\n withTotalPages: true,\n query\n };\n\n const { paging, data, res } = await this.inventory.list(filter);\n\n return {\n res,\n paging: paging as Paging<PositionManagedObject>,\n data: data as PositionManagedObject[]\n };\n }\n\n /**\n * Determines a rectangular geographical area based on the positions of all devices.\n *\n * @returns A [[LatLngBounds]] object fitting all devices' geo positions.\n */\n async getAllDevicesBounds(): Promise<L.LatLngBounds> {\n const filter = (coord: 'lat' | 'lng', order: 'asc' | 'desc') => ({\n pageSize: 1,\n q: `$filter=has(c8y_Position) $orderby=c8y_Position.${coord} ${order}`\n });\n\n const filterReverse = (op: 'lt' | 'gt', order: 'asc' | 'desc') => ({\n pageSize: 1,\n q: `$filter=has(c8y_Position) and c8y_Position.lng ${op} 0d $orderby=c8y_Position.lng ${order}`\n });\n\n const [latMin, latMax, lngMin, lngMax, lngRevMin, lngRevMax] = await Promise.all([\n this.inventory.list(filter('lat', 'asc')),\n this.inventory.list(filter('lat', 'desc')),\n this.inventory.list(filter('lng', 'asc')),\n this.inventory.list(filter('lng', 'desc')),\n this.inventory.list(filterReverse('gt', 'asc')),\n this.inventory.list(filterReverse('lt', 'desc'))\n ]).then(result => result.map(r => get(r.data, '[0].c8y_Position')));\n\n const shiftWorld = (lngRevMin?.lng ?? 0) - (lngRevMax?.lng ?? 0) > 180;\n\n return latLngBounds(\n latLng(latMin?.lat, shiftWorld ? lngRevMin?.lng : lngMin?.lng),\n latLng(latMax?.lat, shiftWorld ? lngRevMax?.lng + 360 : lngMax?.lng)\n );\n }\n\n async getAssetsBounds(assets: PositionManagedObject[]): Promise<L.LatLngBounds | undefined> {\n const leaflet = await this.getLeaflet();\n const bounds = leaflet.latLngBounds([]);\n let hasValidPositions = false;\n assets.forEach(asset => {\n const position = asset.c8y_Position;\n if (position && typeof position.lat === 'number' && typeof position.lng === 'number') {\n bounds.extend([position.lat, position.lng]);\n hasValidPositions = true;\n }\n });\n if (!hasValidPositions || !bounds.isValid()) {\n return;\n }\n return bounds;\n }\n\n /**\n * Returns the cluster size for clustered maps. Counting the position MOs in a bounding\n * and if it reach a threshold, returning a [[ClusterSize]].\n * @param bound The bounding to check for cluster size.\n * @returns The cluster size, can be NONE, FOUR or SIXTEEN.\n */\n async getClusterSize(bound: L.LatLngBounds) {\n const count = await this.getPositionMOsFromBoundCount(bound);\n let clusterSize = ClusterSize.NONE;\n if (count > this.CLUSTER_LEVEL_THRESHOLD) {\n clusterSize = ClusterSize.SIXTEEN;\n } else if (count > this.MAX_DEVICE_PER_CLUSTER) {\n clusterSize = ClusterSize.FOUR;\n }\n return clusterSize;\n }\n\n private getMapOption<T>(key: MapTenantOptionKeys, defaultValue: T) {\n return defer(() =>\n this.options.getTenantOption<T | string>('configuration', key, defaultValue)\n ).pipe(\n map(config => {\n if (typeof config === 'string') {\n console.error(\n `The tenant option for maps 'configuration.${key}' is not a valid JSON structure.`\n );\n return defaultValue;\n }\n return config;\n })\n );\n }\n\n /**\n * Shifts longitudes received from Leaflet.js in the [-180 - k*360; 180 + k*360] rangewhen\n * `noWrap` is enabled to the [-180; 180] range expected for values of the c8y_Position fragment.\n *\n * @param lng Longitude to shift.\n * @returns Longitude value in the [-180; 180] range\n */\n private normalizeLongitude(lng: number): number {\n return ((((lng + 180) % 360) + 360) % 360) - 180;\n }\n\n /**\n * Shifts longitudes in the [-180; 180] range expected for values of the c8y_Position fragment\n * the the [-180 - k*360; 180 + k*360] range expected from Leaflet.js when `noWrap` is enabled.\n *\n * The method naively adds/subtracts 360 degrees to the original value until the position fits in the expected bounds.\n *\n * @param pmo A managed object with a `c8y_Position` fragment\n * @param bounds The bounds where the position should fit\n * @returns A managed object whose `c8y_Position`'s `lng` values has been shifted to fit in bounds\n */\n private denormalizePMO(\n pmo: PositionManagedObject,\n bounds: L.LatLngBounds\n ): PositionManagedObject {\n let { lng } = pmo.c8y_Position;\n const shiftFactor = lng > bounds.getEast() ? -1 : 1;\n\n while (!bounds.contains(latLng(pmo.c8y_Position.lat, lng))) {\n lng += shiftFactor * 360;\n }\n\n pmo.c8y_Position.lng = lng;\n return pmo;\n }\n\n private async childrenOfGroupFilter(mo: IIdentified) {\n try {\n const useInHierarchyOf = await firstValueFrom(\n this.featureCacheService.getFeatureState('ui.map.isinhierarchyof')\n );\n\n if (useInHierarchyOf) {\n return { __isinhierarchyof: mo.id };\n }\n } catch (e) {\n console.warn('Error while determining isinhierarchyof feature toggle state:', e);\n }\n\n return { __bygroupid: mo.id };\n }\n}\n","import { IterableChangeRecord, IterableDiffer, IterableDiffers } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport type * as L from 'leaflet';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { C8yMarker, PositionManagedObject } from './map.model';\nimport { MapService } from './map.service';\n\nexport class ClusterMap {\n markers: C8yMarker[] = [];\n positions: PositionManagedObject[] = [];\n\n set clusterMarker(item: L.Layer) {\n this.removeClusterToBigMarker();\n this._clusterMarker = item;\n }\n\n get clusterMarker() {\n return this._clusterMarker;\n }\n\n set rect(item: L.Rectangle) {\n if (this._rect) {\n this._rect.remove();\n }\n this._rect = item;\n }\n\n get rect() {\n return this._rect;\n }\n\n private _clusterMarker: L.Layer;\n private _rect: L.Rectangle;\n private iterableDiffer: IterableDiffer<PositionManagedObject> | null;\n\n constructor(\n private iterable: IterableDiffers,\n private addAssetCallback: (asset: PositionManagedObject) => C8yMarker,\n private translateService: TranslateService\n ) {\n this.iterableDiffer = this.iterable.find(this.positions).create(this.trackBy);\n }\n\n render(map: L.Map) {\n if (this._rect) {\n this._rect.addTo(map);\n }\n this.updateChanges(map);\n if (this._clusterMarker) {\n this._clusterMarker.addTo(map);\n }\n }\n\n clear(map: L.Map) {\n this.removeClusterToBigMarker();\n this._rect.remove();\n this.positions = [];\n this.updateChanges(map);\n }\n\n removeClusterToBigMarker() {\n if (this._clusterMarker) {\n this._clusterMarker.remove();\n this._clusterMarker = null;\n }\n }\n\n addMarkerToMap(device: PositionManagedObject, map: L.Map) {\n const marker = this.addAssetCallback(device);\n this.markers.push(marker);\n marker.addTo(map);\n }\n\n setClusterToBigMarker(map: L.Map, count, leaflet: typeof L) {\n const bound = this.rect.getBounds();\n const text = this.translateService.instant(gettext('Zoom in'));\n const divMarker = leaflet.divIcon({\n html: `<div class=\"c8y-map-marker-count\" data-count=\"${count}\" title=\"${text}\"></div>`\n });\n const labelIcon = leaflet.marker(bound.getCenter(), {\n icon: divMarker\n });\n labelIcon.addTo(map);\n labelIcon.on('click', () => {\n map.fitBounds(bound);\n });\n this.clusterMarker = labelIcon;\n }\n\n private updateChanges(map: L.Map) {\n const changes = this.iterableDiffer.diff(this.positions);\n if (changes) {\n changes.forEachRemovedItem((record: IterableChangeRecord<PositionManagedObject>) => {\n this.removeMarkerFromMap(record.item);\n });\n\n changes.forEachAddedItem((record: IterableChangeRecord<PositionManagedObject>) => {\n this.addMarkerToMap(record.item, map);\n });\n }\n }\n\n private trackBy(index: number, item: PositionManagedObject) {\n const trackItems = [\n item.id,\n item.c8y_Position.lat,\n item.c8y_Position.lng,\n MapService.getStatus(item)\n ];\n return trackItems.join('');\n }\n\n private removeMarkerFromMap(device: PositionManagedObject) {\n const markers = this.markers.filter((marker: C8yMarker) => marker.asset?.id === device.id);\n markers.forEach(marker => marker.remove());\n }\n}\n","import { Directive, ElementRef, TemplateRef, ViewContainerRef } from '@angular/core';\n\n@Directive({ selector: '[c8yMapPopup]' })\nexport class MapPopupDirective {\n constructor(\n public template: TemplateRef<unknown>,\n public elementRef: ElementRef,\n public viewContainer: ViewContainerRef\n ) {}\n}\n","import {\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n Output,\n SimpleChange,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { IEvent } from '@c8y/client';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport {\n DatePipe,\n GeoService,\n ManagedObjectRealtimeService,\n sortByPriority,\n WidgetGlobalAutoRefreshService\n} from '@c8y/ngx-components';\nimport type { MapDefaultConfig, MapTileLayer } from '@c8y/options';\nimport { TranslateService } from '@ngx-translate/core';\nimport type * as L from 'leaflet';\nimport { every, flatten, isEmpty, isNull, isUndefined, remove } from 'lodash-es';\nimport {\n BehaviorSubject,\n combineLatest,\n fromEvent,\n NEVER,\n Observable,\n Subject,\n Subscription\n} from 'rxjs';\nimport { filter, first, map, scan, switchMap, takeUntil } from 'rxjs/operators';\nimport { MapPopupDirective } from './map-popup.directive';\nimport {\n C8yMarker,\n C8yMarkerAttributes,\n getC8yMarker,\n MAP_DEFAULT_CONFIG,\n MAP_TILE_LAYER,\n MapConfig,\n PositionManagedObject\n} from './map.model';\nimport { MapService } from './map.service';\n\n@Component({\n selector: 'c8y-map',\n templateUrl: './map.component.html',\n providers: [ManagedObjectRealtimeService]\n})\nexport class MapComponent {\n /**\n * The leaflet map object instance.\n */\n map: L.Map;\n /**\n * The markers currently placed on the map.\n */\n markers: Array<C8yMarker | L.Marker> = [];\n /**\n * The leaflet library reference used for map operations.\n */\n leaflet: typeof L;\n /**\n * Indicates if the map was already initialized.\n */\n isInit = false;\n\n /**\n * Reference to the map DOM element.\n */\n @ViewChild('map')\n mapElement: ElementRef;\n\n /**\n * Reference to the custom popup directive for map markers.\n */\n @ContentChild(MapPopupDirective)\n popup: MapPopupDirective;\n\n /**\n * Map configuration object (center, zoom, icon, color, etc).\n */\n @Input()\n config: MapConfig = {};\n\n /**\n * Asset(s) to display as markers on the map.\n */\n @Input()\n assets: PositionManagedObject | PositionManagedObject[];\n\n /**\n * Observable for polyline coordinates to display on the map.\n */\n @Input()\n polyline$: Observable<L.LatLngExpression[] | L.LatLngExpression[][]> = NEVER;\n\n /**\n * Polyline display options for the map.\n */\n @Input()\n polylineOptions: L.PolylineOptions;\n\n /**\n * Emits when a tracked asset is updated in real-time.\n */\n @Output()\n onRealtimeUpdate = new EventEmitter<PositionManagedObject>();\n\n /**\n * Emits observable of map drag/move events.\n */\n @Output()\n onMove: Observable<L.LeafletEvent>;\n\n /**\n * Emits observable of map move end events.\n */\n @Output()\n onMoveEnd: Observable<L.LeafletEvent>;\n\n /**\n * Emits observable of map zoom start events.\n */\n @Output()\n onZoomStart: Observable<L.LeafletEvent>;\n\n /**\n * Emits observable of map zoom end events.\n */\n @Output()\n onZoomEnd: Observable<L.LeafletEvent>;\n\n /**\n * Emits the Leaflet map instance when available.\n */\n @Output()\n onMap = new BehaviorSubject<L.Map | null>(null);\n\n /**\n * Emits when the map and Leaflet library are initialized.\n */\n @Output()\n onInit = new EventEmitter<typeof L>();\n\n protected realtimeSubscription: Subscription;\n protected unsubscribeTrigger$ = new Subject<void>();\n protected destroy$ = new Subject<void>();\n\n private markerTitle = gettext('Marker at position {{lat}}, {{lng}}');\n\n constructor(\n protected moRealtimeService: ManagedObjectRealtimeService,\n protected mapService: MapService,\n @Inject(MAP_TILE_LAYER) protected layers$: Observable<MapTileLayer[]>,\n @Inject(MAP_DEFAULT_CONFIG)\n protected defaultConfig$: Observable<MapDefaultConfig>,\n protected translateService: TranslateService,\n protected geo: GeoService,\n protected datePipe: DatePipe,\n protected widgetGlobalAutoRefreshService: WidgetGlobalAutoRefreshService\n ) {\n this.initOutputs();\n }\n\n /**\n * Starts real-time updates for a single asset on the map.\n * Updates marker position and icon as new data arrives.\n */\n startRealtime() {\n if (!this.assets || (Array.isArray(this.assets) && this.assets.length > 1)) {\n this.config.realtime = false;\n this.stopRealtime();\n return;\n }\n const asset = Array.isArray(this.assets) ? this.assets[0] : this.assets;\n this.realtimeSubscription = this.moRealtimeService\n .onUpdate$(asset)\n .subscribe((asset: PositionManagedObject) => {\n const marker = this.findMarker(asset.id);\n const icon = this.getAssetIcon(asset);\n marker.setIcon(icon);\n marker.setLatLng(this.geo.getLatLong(asset));\n if (Array.isArray(this.assets)) {\n this.assets[0] = asset;\n } else {\n this.assets = asset;\n }\n this.moveToPositionOfMo(asset);\n this.onRealtimeUpdate.emit(asset);\n });\n }\n\n /**\n * Moves the map view to the position of the given asset(s) if follow is enabled.\n * @param positions The asset or array of assets to center the map on.\n */\n moveToPositionOfMo(positions: PositionManagedObject | PositionManagedObject[]) {\n const position = Array.isArray(positions) ? positions[0] : positions;\n if (this.config.follow) {\n this.map.setView([position.c8y_Position.lat, position.c8y_Position.lng]);\n }\n }\n\n /**\n * Stops real-time updates for the asset.\n */\n stopRealtime() {\n if (this.realtimeSubscription) {\n this.realtimeSubscription.unsubscribe();\n }\n }\n\n /**\n * Finds a marker on the map by asset, event, or ID.\n * @param moOrId Asset, event, or string ID to search for.\n * @returns The found marker or undefined.\n */\n findMarker(moOrId: string | IEvent | PositionManagedObject) {\n const getId = moOrId => (typeof moOrId === 'string' ? moOrId : moOrId?.id);\n return this.markers.find(\n (marker: C8yMarker) =>\n marker.asset?.id === getId(moOrId) || marker.event?.id === getId(moOrId)\n );\n }\n\n /**\n * Adds a marker to the map and internal marker list.\n * @param marker The marker to add.\n */\n addMarkerToMap(marker: C8yMarker | L.Marker) {\n this.markers.push(marker);\n marker.addTo(this.map);\n }\n\n /**\n * Creates and returns a marker for the given asset, including icon and popup.\n * @param asset The asset to create a marker for.\n * @returns The created marker.\n */\n getAssetMarker(asset: PositionManagedObject) {\n if (!asset) {\n return;\n }\n\n const icon = this.getAssetIcon(asset);\n const { lat, lng } = asset.c8y_Position;\n const leafletMarker = this.leaflet.marker(this.geo.getLatLong(asset), {\n icon,\n title: this.translateService.instant(this.markerTitle, { lat, lng })\n });\n const marker = getC8yMarker(leafletMarker, asset);\n this.bindPopup(marker, asset);\n\n return marker;\n }\n\n /**\n * Creates and returns a marker for a tracking event, including icon and popup.\n * @param event The event to create a marker for.\n * @returns The created marker.\n */\n getTrackingMarker(event: IEvent) {\n if (!event) {\n return;\n }\n\n const icon = this.getTrackingIcon();\n const { lat, lng } = event.c8y_Position;\n const leafletMarker = this.leaflet.marker(this.geo.getLatLong(event), {\n icon,\n title: this.translateService.instant(this.markerTitle, { lat, lng })\n });\n const marker = getC8yMarker(leafletMarker, null, event);\n this.bindPopup(marker, event);\n\n return marker;\n }\n\n /**\n * Returns a Leaflet icon for the given asset, using config or asset icon and color.\n * @param asset The asset to get the icon for.\n * @returns The Leaflet icon.\n */\n getAssetIcon(asset: PositionManagedObject) {\n const assetTypeIcon = this.config.icon || asset.icon?.name;\n const status = MapService.getStatus(asset);\n const color = this.config.color ? `style='color: ${this.config.color};'` : '';\n const icon = this.leaflet.divIcon({\n html: `<div class=\"dlt-c8y-icon-marker icon-3x ${status}\" ${color}><i class=\"dlt-c8y-icon-${\n assetTypeIcon || 'data-transfer'\n }\" /></div>`,\n className: 'c8y-map-marker-icon',\n // iconAnchor is used to set the marker accurately on click\n iconAnchor: [8, 8]\n });\n return icon;\n }\n\n /**\n * Returns a Leaflet icon for a tracking event.\n * @returns The Leaflet icon.\n */\n getTrackingIcon() {\n const icon = this.leaflet.divIcon({\n html: `<div class=\"dlt-c8y-icon-marker icon-3x text-muted\"></div>`,\n className: 'c8y-map-marker-icon',\n // iconAnchor is used to set the marker accurately on click\n iconAnchor: [8, 8]\n });\n return icon;\n }\n\n /**\n * Removes a marker from the map and internal marker list.\n * @param marker The marker to remove.\n */\n removeMarker(marker: C8yMarker | L.Marker) {\n if (marker) {\n marker.remove();\n remove(this.markers, m => m === marker);\n }\n }\n\n /**\n * Removes all markers from the map, optionally filtered by marker attribute.\n * @param fragment Optional marker attribute to filter by.\n */\n clearMarkers(fragment?: C8yMarkerAttributes) {\n const matchingMarkers = marker => !fragment || !!marker[fragment];\n this.markers.filter(matchingMarkers).forEach(marker => marker.remove());\n this.markers = this.markers.filter(marker => !matchingMarkers(marker));\n }\n\n /**\n * Refreshes all markers on the map based on the current assets.\n */\n refreshMarkers() {\n this.clearMarkers();\n let assets: PositionManagedObject[] = [];\n if (!isUndefined(this.assets)) {\n assets = Array.isArray(this.assets) ? this.assets : [this.assets];\n }\n assets.forEach(asset => {\n const marker = this.getAssetMarker(asset);\n this.addMarkerToMap(marker);\n });\n if (!this.config.center) {\n this.zoomToBound(assets);\n }\n this.toggleControls();\n }\n\n /**\n * Centers the map on the configured center coordinates.\n */\n center() {\n this.map?.setView(this.config.center);\n }\n\n /**\n * Refreshes the map and markers if the map is initialized.\n */\n refresh() {\n if (this.isInit) {\n this.refreshMarkers();\n }\n }\n\n protected async ngAfterViewInit() {\n this.leaflet = await this.mapService.getLeaflet();\n const initialized$ = combineLatest([this.layers$, this.defaultConfig$]).pipe(\n first(),\n takeUntil(this.unsubscribeTrigger$)\n );\n\n initialized$.subscribe(([layers, defaultConfig]) => {\n this.initMap(layers, defaultConfig);\n this.refreshMarkers();\n });\n\n combineLatest([this.polyline$, initialized$])\n .pipe(\n map(([expressions]) => this.leaflet.polyline(expressions, this.polylineOptions)),\n scan((oldPolyline, newPolyline) => {\n if (!!oldPolyline) {\n this.map.removeLayer(oldPolyline);\n }\n if (!!newPolyline) {\n newPolyline.addTo(this.map);\n this.fitBounds(newPolyline.getBounds());\n }\n\n return newPolyline;\n }, null),\n takeUntil(this.unsubscribeTrigger$)\n )\n .subscribe();\n }\n\n protected ngOnChanges(changes: SimpleChanges): void {\n if (!this.map) {\n return;\n }\n if (changes.assets?.currentValue && !changes.assets?.firstChange) {\n this.refreshMarkers();\n }\n\n if (changes.config?.currentValue && !changes.config?.firstChange) {\n this.changeConfig(changes.config);\n }\n }\n\n protected ngOnDestroy(): void {\n this.unsubscribeAllListeners();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n protected unsubscribeAllListeners() {\n this.unsubscribeTrigger$.next();\n this.stopRealtime();\n }\n\n protected initOutputs() {\n const getMapEventObservable = eventName => {\n return this.onMap.pipe(\n filter(map => !!map),\n switchMap(map => fromEvent<L.LeafletEvent>(map, eventName)),\n takeUntilDestroyed()\n );\n };\n const dragStart$ = getMapEventObservable('dragstart');\n const move$ = getMapEventObservable('move');\n const dragEnd$ = getMapEventObservable('dragend');\n\n this.onMove = dragStart$.pipe(\n switchMap(() => move$.pipe(takeUntil(dragEnd$))),\n takeUntil(this.unsubscribeTrigger$)\n );\n\n this.onMoveEnd = getMapEventObservable('moveend');\n\n this.onZoomEnd = getMapEventObservable('zoomend');\n\n this.onZoomStart = getMapEventObservable('zoomstart');\n }\n\n protected initMap(layers: MapTileLayer[], defaultConfig: MapConfig): void {\n const defaultOptions = {\n center: this.config.center || defaultConfig.center,\n zoomSnap: 0,\n zoom: this.config.zoomLevel || defaultConfig.zoomLevel,\n worldCopyJump: true\n };\n\n if (this.map) {\n this.map.remove();\n }\n this.map = this.leaflet.map(this.mapElement.nativeElement, defaultOptions);\n\n this.map.attributionControl.setPrefix('');\n\n this.fitBounds(this.config.bounds);\n\n this.addLayers(layers);\n\n this.handleMobile();\n\n this.onMap.next(this.map);\n\n if (this.config.realtime) {\n this.startRealtime();\n }\n\n this.isInit = true;\n this.onInit.emit(this.leaflet);\n }\n\n protected handleMobile() {\n // adding event listener to do mobile 2 finger scrolling\n if (this.leaflet.Browser.mobile) {\n const touchMsg = this.translateService.instant(gettext('Use two fingers to move the map.'));\n this.map.dragging.disable();\n const container = this.map.getContainer();\n container.setAttribute('data-touch-warning-content', touchMsg);\n container.addEventListener('touchstart', event => this.handleTouch(event));\n container.addEventListener('touchmove', event => this.handleTouch(event));\n container.addEventListener('touchend', event => this.handleTouch(event));\n container.addEventListener('touchcancel', event => this.handleTouch(event));\n container.addEventListener('click', event => this.handleTouch(event));\n }\n }\n\n protected addLayers(layers: MapTileLayer[]) {\n const flattenLayers: MapTileLayer[] = flatten(layers);\n const baseLayers: L.Control.LayersObject = {};\n const overlays: L.Control.LayersObject = {};\n let firstLayer = true;\n for (const layer of sortByPriority(flattenLayers)) {\n const objectToAddTo = layer.isOverlay ? overlays : baseLayers;\n if (objectToAddTo[layer.label]) {\n continue;\n }\n\n const tiles = this.leaflet.tileLayer(layer.layerUrl, layer.options);\n if (!layer.isOverlay && firstLayer) {\n firstLayer = false;\n tiles.addTo(this.map);\n }\n objectToAddTo[layer.label] = tiles;\n }\n if (flattenLayers.length > 1) {\n this.leaflet.control.layers(baseLayers, overlays, { position: 'bottomleft' }).addTo(this.map);\n }\n }\n\n protected changeConfig(change: SimpleChange) {\n if (this.hasChanged(change, 'zoomLevel')) {\n this.map.setZoom(this.config.zoomLevel);\n }\n\n if (this.hasChanged(change, 'center') && every(change.currentValue.center, p => !isNull(p))) {\n this.map.setView(change.currentValue.center);\n }\n\n if (this.hasChanged(change, 'icon') || this.hasChanged(change, 'color')) {\n this.refreshMarkers();\n }\n\n if (this.hasChanged(change, 'realtime') && change.currentValue.realtime) {\n this.startRealtime();\n }\n\n if (change.currentValue.realtime === false) {\n this.stopRealtime();\n }\n\n if (this.hasChanged(change, 'follow')) {\n this.moveToPositionOfMo(this.assets);\n }\n\n if (this.hasChanged(change, 'disablePan') || this.hasChanged(change, 'disableZoom')) {\n this.toggleControls();\n }\n }\n\n protected hasChanged(change: SimpleChange, prop: keyof MapConfig) {\n return change.currentValue[prop] !== change.previousValue[prop];\n }\n\n protected toggleControls() {\n if (this.config.disableZoom) {\n this.map.removeControl(this.map.zoomControl);\n this.map.scrollWheelZoom.disable();\n } else {\n this.map.addControl(this.map.zoomControl);\n this.map.scrollWheelZoom.enable();\n }\n if (this.config.disablePan) {\n this.map.dragging.disable();\n } else {\n this.map.dragging.enable();\n }\n }\n\n private handleTouch(e: Event) {\n // Disregard touch events on the minimap if present\n const ignoreList = [\n 'leaflet-control-minimap',\n 'leaflet-interactive',\n 'leaflet-popup-content',\n 'leaflet-popup-content-wrapper',\n 'leaflet-popup-close-button',\n 'leaflet-control-zoom-in',\n 'leaflet-control-zoom-out'\n ];\n\n let ignoreElement = false;\n for (let i = 0; i < ignoreList.length; i++) {\n if (this.leaflet.DomUtil.hasClass(e.target as HTMLElement, ignoreList[i])) {\n ignoreElement = true;\n }\n }\n\n const container = this.map.getContainer();\n if (ignoreElement) {\n if (\n this.leaflet.DomUtil.hasClass(e.target as HTMLElement, 'leaflet-interactive') &&\n e.type === 'touchmove' &&\n (e as TouchEvent).touches.length === 1\n ) {\n this.leaflet.DomUtil.addClass(container, 'touch-warning');\n this.map.dragging.disable();\n } else {\n this.leaflet.DomUtil.removeClass(container, 'touch-warning');\n }\n return;\n }\n\n if (e.type !== 'touchmove' && e.type !== 'touchstart') {\n this.leaflet.DomUtil.removeClass(container, 'touch-warning');\n return;\n }\n if ((e as TouchEvent).touches.length === 1) {\n this.leaflet.DomUtil.addClass(container, 'touch-warning');\n this.map.dragging.disable();\n } else {\n this.map.dragging.enable();\n this.leaflet.DomUtil.removeClass(container, 'touch-warning');\n }\n }\n\n private zoomToBound(assets: PositionManagedObject[]) {\n if (isEmpty(assets)) return;\n\n const bounds: [number, number][] = assets.map(asset => [\n asset.c8y_Position.lat,\n asset.c8y_Position.lng\n ]);\n if (assets.length > 1) {\n this.map.flyToBounds(bounds, { animate: false });\n return;\n }\n this.map.flyTo(\n [assets[0].c8y_Position.lat, assets[0].c8y_Position.lng],\n this.map.options.zoom,\n {\n animate: false\n }\n );\n }\n\n private fitBounds(bounds: L.LatLngBounds) {\n if (bounds?.isValid()) {\n this.map.fitBounds(bounds, this.config.fitBoundsOptions);\n }\n }\n\n private bindPopup(marker: C8yMarker, context: PositionManagedObject | IEvent) {\n if (this.popup) {\n marker.on('click', () => {\n this.popup.viewContainer.clear();\n const view = this.popup.viewContainer.createEmbeddedView(this.popup.template, {\n $implicit: context\n });\n view.detectChanges();\n marker\n .unbindPopup()\n .bindPopup(this.popup.elementRef.nativeElement.previousSibling, {\n offset: [-3, -40],\n maxWidth: 140,\n autoPan: true,\n closeButton: false\n })\n .openPopup();\n });\n }\n }\n}\n","<div class=\"c8y-map\">\n <div #map></div>\n</div>\n<ng-content></ng-content>\n","import {\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n IterableDiffers,\n Output,\n SimpleChange,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { IManagedObject } from '@c8y/client';\nimport type { MapDefaultConfig, MapTileLayer } from '@c8y/options';\nimport {\n ColorService,\n CountdownIntervalComponent,\n DatePipe,\n GeoService,\n ManagedObjectRealtimeService,\n WidgetGlobalAutoRefreshService,\n globalAutoRefreshLoading,\n DynamicComponent,\n DynamicComponentAlertAggregator\n} from '@c8y/ngx-components';\nimport { TranslateService } from '@ngx-translate/core';\nimport type * as L from 'leaflet';\nimport {\n BehaviorSubject,\n EMPTY,\n Observable,\n combineLatest,\n from,\n fromEvent,\n merge,\n of\n} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n mergeMap,\n skip,\n switchMap,\n takeUntil,\n tap\n} from 'rxjs/operators';\nimport { ClusterMap } from './cluster-map';\nimport { MapComponent } from './map.component';\nimport {\n ClusterMapConfig,\n ClusterSize,\n MAP_DEFAULT_CONFIG,\n MAP_TILE_LAYER,\n PositionManagedObject\n} from './map.model';\nimport { MapService } from './map.service';\n\n/**\n * Smart map component for that clusters devices together when there are too many to display individually.\n * Unlike the basic map, this component loads device data dynamically and manages cluster rendering and updates.\n * Extends the base MapComponent with clustering, dynamic data loading, and advanced refresh logic.\n */\n@Component({\n selector: 'c8y-cluster-map',\n templateUrl: './cluster-map.component.html',\n providers: [ManagedObjectRealtimeService]\n})\nexport class ClusterMapComponent extends MapComponent implements DynamicComponent {\n /** Emits true while the map is loading or refreshing clusters. */\n isLoading$ = new BehaviorSubject(false);\n /** @ignore */\n countdownIntervalComp: CountdownIntervalComponent;\n\n /**\n * Cluster map configuration, including clustering thresholds and refresh intervals.\n */\n @Input()\n config: ClusterMapConfig;\n\n /**\n * The root managed object (e.g., group or device) for which to load and cluster data.\n */\n @Input()\n rootNode: IManagedObject;\n\n /**\n * Single asset to display (if not clustering). Used for following a specific device.\n * If provided, clusters will not be used, and the asset will be displayed individually.\n * If not provided, the component will cluster devices based on the root node.\n */\n @Input('asset')\n assets: PositionManagedObject;\n\n /**\n * Whether to show a color overlay for each cluster rectangle. This can be useful for debugging or visualizing clusters.\n */\n @Input()\n showClusterColor = false;\n\n /**\n * Emits Leaflet map change events (move, moveend) for external listeners.\n */\n @Output()\n mapChange = new EventEmitter<L.LeafletEvent>();\n\n /** Reference to the map element in the template. */\n @ViewChild('map')\n mapElement: ElementRef;\n\n /** Aggregator for dynamic component alerts. */\n alerts: DynamicComponentAlertAggregator;\n\n /** @ignore */\n errorNotifier = new BehaviorSubject(null);\n private reloadTrigger$ = new BehaviorSubject(false);\n private clusters: ClusterMap[] = [];\n private readonly EVENT_THROTTLE_TIME = 750;\n\n /**\n * Constructs the ClusterMapComponent, injecting required services and initializing the base map.\n */\n constructor(\n protected moRealtimeService: ManagedObjectRealtimeService,\n protected mapService: MapService,\n @Inject(MAP_TILE_LAYER) protected layers$: Observable<MapTileLayer[]>,\n @Inject(MAP_DEFAULT_CONFIG)\n protected defaultConfig$: Observable<MapDefaultConfig>,\n protected translateService: TranslateService,\n protected widgetGlobalAutoRefreshService: WidgetGlobalAutoRefreshService,\n private iterable: IterableDiffers,\n private colorService: ColorService,\n geo: GeoService,\n datePipe: DatePipe\n ) {\n super(\n moRealtimeService,\n mapService,\n layers$,\n defaultConfig$,\n translateService,\n geo,\n datePipe,\n widgetGlobalAutoRefreshService\n );\n }\n\n /**\n * @ignore\n */\n async ngOnChanges(changes: SimpleChanges) {\n if (changes.config?.firstChange || !this.map) {\n return;\n }\n\n if (changes.rootNode?.previousValue !== changes.rootNode?.currentValue) {\n this.changeRootNode(changes.rootNode.currentValue);\n }\n\n if (changes.config?.currentValue) {\n this.changeConfig(changes.config);\n }\n }\n\n /**\n * Handles changes to the map configuration, including follow and refresh interval.\n * Cancels reload on follow, triggers reload on refresh interval change, and delegates to base config change logic.\n * @param change The config change object.\n */\n changeConfig(change: SimpleChange) {\n // on following, cancel reload to avoid stale state\n if (change.currentValue.follow === true) {\n this.cancelReload();\n this.isLoading$.next(false);\n }\n\n if (change.currentValue.refreshInterval !== change.previousValue.refreshInterval) {\n this.reload();\n }\n super.changeConfig(change);\n }\n\n /**\n * @ignore\n */\n async ngAfterViewInit() {\n if (!this.leaflet) {\n this.leaflet = await this.mapService.getLeaflet();\n }\n\n if (this.config.widgetInstanceGlobalAutoRefreshContext) {\n this.handleGlobalRefreshLoading();\n }\n combineLatest([this.layers$, this.defaultConfig$])\n .pipe(takeUntil(this.unsubscribeTrigger$))\n .subscribe(([layers, defaultConfig]) => {\n this.initMap(layers, defaultConfig);\n this.changeRootNode(this.rootNode);\n this.changeConfig(new SimpleChange({}, this.config, false));\n });\n }\n\n /**\n * Resets the map and clusters, re-initializing the component.\n */\n async reset() {\n this.ngOnDestroy();\n await this.ngAfterViewInit();\n }\n\n /**\n * Triggers a reload of cluster data.\n */\n reload() {\n this.reloadTrigger$.next(true);\n }\n\n /**\n * Cancels an ongoing reload operation.\n */\n cancelReload() {\n this.reloadTrigger$.next(false);\n }\n\n /**\n * Subscribes to cluster and interval changes, updating clusters as needed.\n * Handles auto-refresh and global refresh loading.\n */\n listenToClusterAndIntervalChanges() {\n const countdownEnded$ = this.config.widgetInstanceGlobalAutoRefreshContext\n ? this.widgetGlobalAutoRefreshService.countdownActions.countdownEnded$.pipe(\n takeUntil(this.destroy$)\n )\n : this.countdownIntervalComp\n ? this.countdownIntervalComp.countdownEnded.pipe(takeUntil(this.unsubscribeTrigger$))\n : EMPTY;\n\n const mapChange$ = this.getMapChangeObservable();\n merge(this.reloadTrigger$, mapChange$, countdownEnded$)\n .pipe(\n tap(value => {\n if (this.config.widgetInstanceGlobalAutoRefreshContext) {\n !this.isLeafletEventInterface(value) && this.isLoading$.next(true);\n return;\n }\n this.isLoading$.next(true);\n this.countdownIntervalComp?.stop(true);\n }),\n switchMap(value =>\n value === false\n ? of([])\n : from(this.mapService.getClusterSize(this.map.getBounds())).pipe(\n mergeMap((clusterSize: ClusterSize) =>\n this.getClusterRects(clusterSize, this.map.getBounds())\n ),\n mergeMap(rects => this.createOrUpdateCluster(rects)),\n catchError(error => {\n this.errorNotifier.next(error);\n\n return of([]);\n })\n )\n ),\n takeUntil(this.unsubscribeTrigger$)\n )\n .subscribe((clusters: ClusterMap[]) => {\n clusters.forEach(cluster => cluster.render(this.map));\n this.isLoading$.next(false);\n if (this.config.widgetInstanceGlobalAutoRefreshContext) {\n return;\n }\n this.countdownIntervalComp?.start();\n });\n }\n\n /**\n * Subscribes to map change events for cluster updates.\n */\n listenToClusterMapChanges() {\n this.getMapChangeObservable().subscribe();\n }\n\n /**\n * Refreshes markers or clusters, depending on whether a single asset or clusters are shown.\n */\n refreshMarkers() {\n if (this.assets) {\n super.refreshMarkers();\n return;\n }\n this.clusters.forEach(cluster => {\n cluster.clear(this.map);\n });\n this.reload();\n }\n\n private changeRootNode(mo: IManagedObject) {\n this.unsubscribeAllListeners();\n this.clearMarkers();\n this.clearClusters();\n\n const isPositionDevice = mo?.c8y_Position && mo?.c8y_IsDevice;\n if (isPositionDevice) {\n this.assets = mo as PositionManagedObject;\n this.refreshMarkers();\n this.listenToClusterMapChanges();\n } else {\n this.assets = null;\n this.listenToClusterAndIntervalChanges();\n this.reload();\n }\n }\n\n private async getClusterRects(\n levelThreshold: ClusterSize = ClusterSize.FOUR,\n viewBounds: L.LatLngBounds,\n level = 0\n ): Promise<L.Rectangle[]> {\n let rects = [];\n\n if (levelThreshold === ClusterSize.NONE) {\n const rect = await this.getRect(viewBounds);\n rects.push(rect);\n return rects;\n }\n\n if (level >= levelThreshold) {\n return rects;\n }\n level++;\n\n const { lat: x1, lng: y1 } = viewBounds.getSouthWest();\n const { lat: x2, lng: y2 } = viewBounds.getNorthEast();\n const newX2 = (x1 + x2) / 2;\n const newY2 = (y1 + y2) / 2;\n\n const bounds: [[number, number], [number, number]][] = [\n [\n [x1, y1],\n [newX2, newY2]\n ],\n [\n [newX2, newY2],\n [x2, y2]\n ],\n [\n [x1, newY2],\n [newX2, y2]\n ],\n [\n [newX2, y1],\n [x2, newY2]\n ]\n ];\n for (const bound of bounds) {\n const latLngBound = this.leaflet.latLngBounds(bound);\n const rect = await this.getRect(latLngBound);\n rects = [...rects, ...(await this.getClusterRects(levelThreshold, latLngBound, level))];\n\n if (level === levelThreshold) {\n rects.push(rect);\n }\n }\n\n return rects;\n }\n\n private async getRect(latLngBound: L.LatLngBounds) {\n let color = 'none';\n if (this.showClusterColor) {\n color = await this.colorService.generateColor(latLngBound.toBBoxString());\n }\n const rect = this.leaflet.rectangle(latLngBound, {\n color,\n weight: color === 'none' ? 0 : 1,\n interactive: false\n });\n return rect;\n }\n\n private clearClusters() {\n this.clusters.forEach(cluster => {\n cluster.clear(this.map);\n });\n this.clusters = [];\n }\n\n private async updateCluster(cluster: ClusterMap) {\n const clusterCount = await this.mapService.getPositionMOsFromBoundCount(\n cluster.rect.getBounds(),\n this.rootNode\n );\n if (clusterCount > this.mapService.MAX_DEVICE_PER_CLUSTER) {\n cluster.setClusterToBigMarker(this.map, clusterCount, this.leaflet);\n cluster.positions = [];\n return cluster;\n }\n\n cluster.removeClusterToBigMarker();\n cluster.positions = await this.mapService.getPositionMOsFromBound(\n cluster.rect.getBounds(),\n this.rootNode\n );\n return cluster;\n }\n\n private createOrUpdateCluster(rects: L.Rectangle<unknown>[]) {\n const isNew = rects.length !== this.clusters.length;\n if (isNew) {\n this.clearClusters();\n }\n const updatePromise = rects.map((rect, index) => {\n if (isNew) {\n const cluster = new ClusterMap(\n this.iterable,\n asset => this.getAssetMarker(asset),\n this.translateService\n );\n this.clusters.push(cluster);\n }\n this.clusters[index].rect = rect;\n return this.updateCluster(this.clusters[index]);\n });\n\n return Promise.all(updatePromise);\n }\n\n private getMapChangeObservable() {\n return merge(\n fromEvent<L.LeafletEvent>(this.map, 'move'),\n fromEvent<L.LeafletEvent>(this.map, 'moveend')\n ).pipe(\n debounceTime(this.EVENT_THROTTLE_TIME),\n tap(event => this.mapChange.emit(event)),\n takeUntil(this.unsubscribeTrigger$)\n );\n }\n\n private isLeafletEventInterface(\n LeafletEventObject: L.LeafletEvent | boolean | void\n ): LeafletEventObject is L.LeafletEvent {\n return (LeafletEventObject as L.LeafletEvent)?.type !== undefined;\n }\n\n private handleGlobalRefreshLoading(): void {\n this.isLoading$\n .pipe(\n skip(1),\n globalAutoRefreshLoading(this.widgetGlobalAutoRefreshService),\n takeUntil(this.destroy$)\n )\n .subscribe();\n\n this.destroy$.subscribe({\n complete: () =>\n this.isLoading$.value && this.widgetGlobalAutoRefreshService.decrementLoading()\n });\n }\n}\n","<div class=\"c8y-map\">\n <div #map></div>\n</div>\n<ng-content></ng-content>\n","import { Component, EventEmitter, Input, Output, SimpleChanges, ViewChild } from '@angular/core';\nimport { CountdownIntervalComponent, IconDirective, C8yTranslatePipe } from '@c8y/ngx-components';\nimport { cloneDeep } from 'lodash-es';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { ClusterMapComponent } from './cluster-map.component';\nimport { ClusterMapConfig, MapStatusButtonsConfig, PositionManagedObject } from './map.model';\nimport { NgIf, NgClass, AsyncPipe } from '@angular/common';\nimport { TooltipDirective } from 'ngx-bootstrap/tooltip';\n\n/**\n * Component to display controls and status information for a map rendered on an IoT Dashboard.\n * Provides UI for centering, fitting bounds, toggling real-time updates, auto-refresh, and following assets.\n */\n@Component({\n selector: 'c8y-map-status',\n templateUrl: './map-status.component.html',\n imports: [\n NgIf,\n NgClass,\n TooltipDirective,\n CountdownIntervalComponent,\n IconDirective,\n AsyncPipe,\n C8yTranslatePipe\n ]\n})\nexport class MapStatusComponent {\n /**\n * Map configuration object, including center, refresh interval, and other map options.\n */\n @Input()\n config: ClusterMapConfig;\n\n /**\n * List of managed objects with position information to be displayed on the map.\n */\n @Input() assets: PositionManagedObject[];\n\n /**\n * Emits when the map configuration changes (e.g., toggling real-time, follow, etc.).\n */\n @Output()\n configChange = new EventEmitter<ClusterMapConfig>();\n\n /**\n * Emits when the user unfollows an asset on the map.\n */\n @Output()\n onUnfollow = new EventEmitter<ClusterMapConfig>();\n\n /**\n * Emits when the user requests to fit all assets within the map bounds.\n */\n @Output() fitAssetsToBounds = new EventEmitter<void>();\n\n /**\n * Reference to the ClusterMapComponent instance rendered in the view.\n */\n @Input()\n clusterMap: ClusterMapComponent;\n\n /**\n * Configuration for which map status buttons are shown/enabled.\n * By default the \"center\" button is shown and realtime is disabled.\n * See {@link MapStatusButtonsConfig} for available options.\n */\n @Input() buttonsConfig: Partial<MapStatusButtonsConfig> = {};\n\n /**\n * @ignore\n */\n @ViewChild(CountdownIntervalComponent) countdownIntervalComp: CountdownIntervalComponent;\n\n /**\n * @ignore\n */\n initConfig: ClusterMapConfig;\n\n /**\n * @ignore\n */\n refreshPaused = false;\n\n private destroy$ = new Subject<void>();\n\n /**\n * @ignore\n */\n ngOnInit(): void {\n this.initConfig = cloneDeep(this.config);\n this.buttonsConfig = Object.assign(this.defaultButtonsConfig(), this.buttonsConfig);\n }\n\n /**\n * @ignore\n */\n ngAfterViewInit(): void {\n if (!this.config.widgetInstanceGlobalAutoRefreshContext) {\n this.clusterMap.countdownIntervalComp = this.countdownIntervalComp;\n }\n }\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.clusterMap?.previousValue !== changes.clusterMap?.currentValue) {\n this.checkIfMapIsAlreadyCentered();\n }\n }\n\n /**\n * Centers the map on the configured center coordinates.\n */\n center() {\n this.clusterMap.center();\n }\n\n /**\n * Emits an event to fit all assets within the map bounds and disables the button until the next change.\n */\n fitToBounds() {\n this.buttonsConfig.fitToBounds.disabled = true;\n this.fitAssetsToBounds.emit();\n }\n\n /**\n * Reloads the map data.\n */\n reload() {\n this.clusterMap.reload();\n }\n\n /**\n * Cancels the map reload operation.\n */\n cancelReload() {\n this.clusterMap.cancelReload();\n }\n\n /**\n * Toggles real-time updates for the map.\n */\n toggleRealtime() {\n this.config = {\n ...this.config,\n realtime: !this.config.realtime\n };\n this.configChange.emit(this.config);\n }\n\n /**\n * Toggles the auto-refresh state for the map, pausing or resuming the countdown.\n * @param $event Mouse event to prevent default and stop propagation.\n */\n toggleAutoRefresh($event: MouseEvent) {\n $event.preventDefault();\n $event.stopPropagation();\n this.refreshPaused = !this.refreshPaused;\n if (this.refreshPaused) {\n this.countdownIntervalComp.stop(true);\n } else {\n this.countdownIntervalComp.start();\n }\n }\n\n /**\n * Disables following an asset on the map and emits the change.\n */\n unfollow() {\n this.config = {\n ...this.clusterMap.config,\n follow: false\n };\n this.configChange.emit(this.config);\n this.onUnfollow.emit(this.config);\n }\n\n /**\n * Enables following an asset on the map and emits the change.\n */\n follow() {\n this.config = {\n ...this.config,\n follow: true\n };\n this.configChange.emit(this.config);\n }\n\n /**\n * @ignore\n */\n ngOnDestroy(): void {\n this.destroy$.next();\n }\n\n /**\n * Subscribes to map changes and updates button states based on map bounds and center.\n */\n private checkIfMapIsAlreadyCentered() {\n this.clusterMap.mapChange.pipe(takeUntil(this.destroy$)).subscribe((event: L.LeafletEvent) => {\n if (event.sourceTarget?.getBounds) {\n const bounds: L.LatLngBounds = event.sourceTarget.getBounds();\n this.buttonsConfig.fitToBounds.disabled = this.shouldDisableFitToBoundsButton(bounds);\n if (this.config?.center) {\n this.buttonsConfig.center.disabled = this.shouldDisableCenterButton(bounds);\n }\n }\n });\n }\n\n /**\n * Checks if Center button should be disabled according to provided bounds.\n * Provided bounds contain coordinates of current map rectangle corners.\n * Center button should be disabled if distance between center coordinates (from config) and center of current bounds\n * is less than 1/4 of bounds dimensions.\n * To achieve it we just need to check if center coordinates (from config) are contained in the boundaries of\n * current bounds shrunk by 25%.\n * @param bounds Current map view boundaries.\n * @returns True if distance between config center and current boundaries center is bigger than 1/4 of boundaries dimensions\n */\n private shouldDisableCenterButton(bounds: L.LatLngBounds): boolean {\n const shrunkBounds = bounds.pad(-0.25);\n return shrunkBounds.contains(this.config.center);\n }\n\n /**\n * Checks if Fit to Bounds button should be disabled based on whether all assets are within the current bounds.\n * @param bounds Current map view boundaries.\n * @returns True if all assets are already within bounds, false otherwise.\n */\n private shouldDisableFitToBoundsButton(bounds: L.LatLngBounds): boolean {\n if (!this.assets) {\n return true;\n }\n return this.assets.every(({ c8y_Position }) =>\n bounds.contains([c8y_Position.lat, c8y_Position.lng])\n );\n }\n\n /**\n * Returns the default configuration for map status buttons.\n * @returns Default MapStatusButtonsConfig object.\n */\n private defaultButtonsConfig(): MapStatusButtonsConfig {\n return {\n realtime: { show: this.config.realtime || this.clusterMap.config.follow, disabled: false },\n fitToBounds: { show: false, disabled: false },\n center: { show: true, disabled: false }\n };\n }\n}\n","<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <label\n class=\"toggle-countdown vertical\"\n [attr.aria-label]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n [tooltip]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n placement=\"left\"\n *ngIf=\"\n !config.widgetInstanceGlobalAutoRefreshContext &&\n clusterMap?.config.refreshInterval &&\n !clusterMap?.config.follow\n \"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"1000\"\n >\n <input\n type=\"checkbox\"\n (click)=\"toggleAutoRefresh($event)\"\n />\n <c8y-countdown-interval\n [hidden]=\"refreshPaused\"\n [countdownInterval]=\"clusterMap?.config.refreshInterval\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"refreshPaused\"\n ></i>\n </label>\n\n <button\n title=\"{{ 'Cancel reload' | translate }}\"\n type=\"button\"\n *ngIf=\"(clusterMap?.isLoading$ | async) && !config.widgetInstanceGlobalAutoRefreshContext\"\n (click)=\"cancelReload()\"\n >\n <i\n class=\"icon-spin\"\n c8yIcon=\"refresh\"\n ></i>\n </button>\n <button\n [title]=\"'Reload' | translate\"\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime &&\n !clusterMap?.assets &&\n !(clusterMap?.isLoading$ | async) &&\n !config.widgetInstanceGlobalAutoRefreshContext\n \"\n (click)=\"reload()\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n title=\"{{ 'Center map' | translate }}\"\n type=\"button\"\n (click)=\"center()\"\n [disabled]=\"buttonsConfig.center.disabled || clusterMap?.config.follow\"\n *ngIf=\"buttonsConfig.center.show\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n title=\"{{ 'Fit to assets bounds' | translate }}\"\n type=\"button\"\n (click)=\"fitToBounds()\"\n [disabled]=\"buttonsConfig.fitToBounds.disabled || clusterMap?.config.follow\"\n *ngIf=\"buttonsConfig.fitToBounds.show\"\n >\n <i c8yIcon=\"waypoint-map\"></i>\n </button>\n <button\n title=\"{{ 'Unfollow' | translate }}\"\n type=\"button\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n title=\"{{ 'Follow' | translate }}\"\n type=\"button\"\n *ngIf=\"initConfig.follow && !clusterMap?.config.follow\"\n (click)=\"follow()\"\n >\n <i c8yIcon=\"marker\"></i>\n </button>\n </div>\n </div>\n</div>\n","import { CommonModule as NgCommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule as NgFormsModule } from '@angular/forms';\nimport { CommonModule, CoreModule, FormsModule, RealtimeModule } from '@c8y/ngx-components';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { ClusterMapComponent } from './cluster-map.component';\nimport { MapPopupDirective } from './map-popup.directive';\nimport { MapStatusComponent } from './map-status.component';\nimport { MapComponent } from './map.component';\nimport { MAP_DEFAULT_CONFIG, MAP_TILE_LAYER } from './map.model';\nimport { MapService } from './map.service';\n\n@NgModule({\n imports: [\n NgCommonModule,\n NgFormsModule,\n CommonModule,\n FormsModule,\n RealtimeModule,\n CoreModule,\n TooltipModule,\n MapComponent,\n MapStatusComponent,\n ClusterMapComponent,\n MapPopupDirective\n ],\n exports: [MapComponent, MapStatusComponent, ClusterMapComponent, MapPopupDirective],\n providers: [\n {\n provide: MAP_TILE_LAYER,\n useFactory: (mapService: MapService) => {\n return mapService.getMapTileLayers$();\n },\n deps: [MapService]\n },\n {\n provide: MAP_DEFAULT_CONFIG,\n useFactory: (mapService: MapService) => {\n return mapService.getDefaultConfig();\n },\n deps: [MapService]\n }\n ]\n})\nexport class MapModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","i1","i2.MapService","NgCommonModule","NgFormsModule","CommonModule","FormsModule"],"mappings":";;;;;;;;;;;;;;;;;;AAOA;;;;;;AAMG;SACa,YAAY,CAAC,MAAgB,EAAE,KAA6B,EAAE,KAAc,EAAA;AACzF,IAAA,MAAoB,CAAC,KAAK,GAAG,KAAK;AAClC,IAAA,MAAoB,CAAC,KAAK,GAAG,KAAK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4BACD,IAAI,EAAE,CAAC,UAAU;AAClB;AACF;AACF,iBAAA;;;AC3CD;;AAEG;;;;"}
@@ -96,7 +96,7 @@ class WelcomeToCockpitComponent {
96
96
  createQuickLinkReports() {
97
97
  const label = gettext('Reports');
98
98
  const reports = {
99
- icon: 'th',
99
+ icon: 'c8y-reports',
100
100
  label,
101
101
  url: '/reports'
102
102
  };
@@ -112,7 +112,7 @@ class WelcomeToCockpitComponent {
112
112
  createQuickLinkExports() {
113
113
  const label = gettext('Exports');
114
114
  const exports = {
115
- icon: 'c8y-reports',
115
+ icon: 'graph-report',
116
116
  label,
117
117
  url: '/export'
118
118
  };