@ndwnu/map 0.0.1-beta.6 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ndwnu-map.mjs +539 -258
- package/fesm2022/ndwnu-map.mjs.map +1 -1
- package/package.json +3 -2
- package/types/ndwnu-map.d.ts +167 -105
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ndwnu-map.mjs","sources":["../../../../libs/map/src/lib/map/map-constants.ts","../../../../libs/map/src/lib/map/map-config.interface.ts","../../../../libs/map/src/lib/map/map-element.repository.ts","../../../../libs/map/src/lib/map/map-element.ts","../../../../libs/map/src/lib/map/map-layer.ts","../../../../libs/map/src/lib/map/map-source.ts","../../../../libs/map/src/lib/map/map.component.ts","../../../../libs/map/src/lib/map/maplibre-cursor.service.ts","../../../../libs/map/src/ndwnu-map.ts"],"sourcesContent":["import { LngLatLike } from 'maplibre-gl';\n\nexport const BOUNDS_NL: [LngLatLike, LngLatLike] = [\n [3.079667, 50.587611],\n [7.572028, 53.636667],\n];\nexport const BOUNDS_AMERSFOORT: [LngLatLike, LngLatLike] = [\n [5.34458238242172, 52.11623605695118],\n [5.446205917577942, 52.21132028216525],\n];\n","import { LngLatBoundsLike, LngLatLike } from 'maplibre-gl';\n\nexport interface MapConfig {\n /** Initial center position of the map */\n center?: LngLatLike;\n\n /** Initial zoom level */\n zoom?: number;\n\n /** Maximum zoom level */\n maxZoom?: number;\n\n /** Minimum zoom level */\n minZoom?: number;\n\n /** Initial bounds to fit the map to */\n bounds?: LngLatBoundsLike;\n\n /** Enable/disable all map interactions */\n interactive?: boolean;\n\n /** Enable/disable map rotation via drag */\n dragRotate?: boolean;\n\n /** Enable/disable double-click to zoom */\n doubleClickZoom?: boolean;\n\n /** Enable/disable scroll wheel zoom */\n scrollZoom?: boolean;\n\n /** Enable/disable shift+drag box zoom */\n boxZoom?: boolean;\n\n /** Enable/disable drag to pan */\n dragPan?: boolean;\n\n /** Enable/disable keyboard navigation */\n keyboard?: boolean;\n\n /** Enable/disable touch zoom and rotation on mobile */\n touchZoomRotate?: boolean;\n}\n\nexport const DEFAULT_MAP_CONFIG: Required<Omit<MapConfig, 'bounds'>> = {\n center: [5.387827, 52.155172],\n zoom: 8,\n maxZoom: 18,\n minZoom: 6,\n interactive: true,\n dragRotate: false,\n doubleClickZoom: true,\n scrollZoom: true,\n boxZoom: true,\n dragPan: true,\n keyboard: true,\n touchZoomRotate: true,\n};\n\n// Common bounds that users can optionally use\nexport const COMMON_BOUNDS = {\n NETHERLANDS: [\n [3.079667, 50.587611],\n [7.572028, 53.636667],\n ] as LngLatBoundsLike,\n AMERSFOORT: [\n [5.34458238242172, 52.11623605695118],\n [5.446205917577942, 52.21132028216525],\n ] as LngLatBoundsLike,\n} as const;\n","import { BehaviorSubject, map } from 'rxjs';\n\nimport { MapElement } from './map-element';\n\n/**\n * Repository for managing map elements.\n * Provides methods to add, remove, show, hide, and toggle map elements.\n * Also tracks element visibility state and provides observable streams for elements.\n *\n * @typeparam TElementType - The type of ID used for the map elements\n */\nexport abstract class MapElementRepository<TElementType> {\n /** Subject that holds the current array of map elements */\n private readonly mapElementsSubject = new BehaviorSubject<MapElement<TElementType>[]>([]);\n\n // mapElements are not directly exposed to prevent circular reference errors when\n // they are used in a template. Because the mapElements$ observable contains MapLibre\n // GL JS map objects, which have circular references.\n\n /** Observable stream of all map elements */\n private readonly mapElements$ = this.mapElementsSubject.asObservable();\n\n /** Observable stream of only visible map elements */\n private readonly visibleMapElements$ = this.mapElements$.pipe(\n map((elements) => elements.filter((element) => element.isVisible)),\n );\n\n /**\n * Gets the ids (TElementType) as an array of all map element\n * @returns Array of TElementType\n */\n mapElementIds$ = this.mapElements$.pipe(map((elements) => elements.map((element) => element.id)));\n\n /**\n * Gets the ids (TElementType) as an array of all visible map element\n * @returns Array of TElementType\n */\n visibleMapElementIds$ = this.visibleMapElements$.pipe(\n map((elements) => elements.map((element) => element.id)),\n );\n\n /**\n * Gets the current array of all map elements\n * @returns Array of map elements\n */\n get mapElements(): MapElement<TElementType>[] {\n return this.mapElementsSubject.getValue();\n }\n\n /**\n * Gets only the currently visible map elements\n * @returns Array of visible map elements\n */\n get visibleMapElements(): MapElement<TElementType>[] {\n return this.mapElements.filter((element) => element.isVisible);\n }\n\n /**\n * Finds a map element by its ID\n *\n * @param elementId - The ID of the element to find\n * @returns The map element if found, undefined otherwise\n */\n getMapElementById(elementId: TElementType): MapElement<TElementType> | undefined {\n return this.mapElements.find((element) => element.id === elementId);\n }\n\n /**\n * Checks if a map element is currently visible\n *\n * @param elementId - The ID of the element to check\n * @returns True if the element is visible, false otherwise\n */\n isMapElementVisible(elementId: TElementType): boolean {\n return this.visibleMapElements.some((element) => element.id === elementId);\n }\n\n /**\n * Adds a new map element to the repository and initializes it.\n * Sets the element's visibility based on its configuration.\n *\n * @param mapElement - The map element to add\n */\n addMapElement(mapElement: MapElement<TElementType>) {\n const currentElements = this.mapElements;\n this.mapElementsSubject.next([...currentElements, mapElement]);\n mapElement.onInit();\n if (mapElement.alwaysVisible || this.isMapElementVisible(mapElement.id)) {\n this.showMapElement(mapElement.id);\n } else {\n this.hideMapElement(mapElement.id);\n }\n }\n\n /**\n * Removes a map element from the repository and destroys it.\n *\n * @param mapElement - The map element to remove\n */\n removeMapElement(mapElement: MapElement<TElementType>) {\n const filteredElements = this.mapElements.filter((element) => element.id !== mapElement.id);\n this.mapElementsSubject.next(filteredElements);\n mapElement.onDestroy();\n }\n\n /**\n * Removes all map elements from the repository and destroys them.\n */\n removeAllMapElements() {\n this.mapElements.forEach((element) => {\n this.removeMapElement(element);\n });\n }\n\n /**\n * Sets the visibility of a map element by its ID and updates the subject with the new state.\n *\n * @param elementId - The ID of the element to update\n * @param visible - Whether the element should be visible or hidden\n */\n private setMapElementVisibility(elementId: TElementType, visible: boolean) {\n const element = this.getMapElementById(elementId);\n if (element) {\n element.setVisible(visible);\n const elements = this.mapElements.filter((el) => el.id !== elementId);\n this.mapElementsSubject.next([...elements, element]);\n }\n }\n\n /**\n * Shows a map element by its ID and updates the subject with the new state.\n *\n * @param elementId - The ID of the element to show\n */\n showMapElement(elementId: TElementType) {\n this.setMapElementVisibility(elementId, true);\n }\n\n /**\n * Hides a map element by its ID and updates the subject with the new state.\n *\n * @param elementId - The ID of the element to hide\n */\n hideMapElement(elementId: TElementType) {\n this.setMapElementVisibility(elementId, false);\n }\n\n /**\n * Toggles the visibility of a map element by its ID.\n * If the element is currently visible, it will be hidden, and vice versa.\n *\n * @param elementId - The ID of the element to toggle visibility\n */\n toggleMapElement(elementId: TElementType) {\n if (this.visibleMapElements.some((element) => element.id === elementId)) {\n this.hideMapElement(elementId);\n } else {\n this.showMapElement(elementId);\n }\n }\n\n /**\n * Gets the ID of the layer that should come before the specified element's layers\n * in the map's layer stack. This is used for maintaining proper layer ordering.\n *\n * @param elementId - The ID of the element to find a \"before\" reference for\n * @returns The ID of the first layer of the next element in order, or undefined if none exists\n */\n getBeforeId(elementId: TElementType): string | undefined {\n const currentElement = this.getMapElementById(elementId);\n if (!currentElement) {\n return undefined;\n }\n\n const nextElement = this.mapElements\n .filter((item) => item.elementOrder > currentElement.elementOrder)\n .sort((a, b) => a.elementOrder - b.elementOrder)[0];\n\n const nextElementLayerIds = nextElement?.sources\n .flatMap((source) => source.layers)\n .filter((layer) => layer.initialized)\n .map((layer) => layer.id);\n\n return nextElement && nextElementLayerIds.length > 0 ? nextElementLayerIds[0] : undefined;\n }\n}\n","import { Map } from 'maplibre-gl';\nimport { Subject } from 'rxjs';\n\nimport { MapElementRepository } from './map-element.repository';\nimport { MapSource } from './map-source';\nimport { MaplibreCursorService } from './maplibre-cursor.service';\n\nexport interface MapElementConfig<TElementType> {\n map: Map;\n mapElementRepository: MapElementRepository<TElementType>;\n maplibreCursorService: MaplibreCursorService;\n elementId: TElementType;\n elementOrder: number;\n}\n\nexport abstract class MapElement<TElementType> {\n id: TElementType;\n elementOrder: number;\n sources: MapSource<TElementType>[] = [];\n alwaysVisible = false;\n isVisible = false;\n\n protected unsubscribe = new Subject<void>();\n\n constructor(protected readonly config: MapElementConfig<TElementType>) {\n this.id = config.elementId;\n this.elementOrder = config.elementOrder;\n }\n\n onInit() {\n this.sources.forEach((source) => source.onInit());\n }\n\n onDestroy() {\n this.sources.forEach((source) => source.onDestroy());\n\n this.unsubscribe.next();\n this.unsubscribe.complete();\n }\n\n setVisible(visible: boolean) {\n this.isVisible = visible;\n this.sources.forEach((source) => source.setVisible(visible));\n }\n}\n","import { Feature } from 'geojson';\nimport { MapElementConfig } from './map-element';\nimport {\n FilterSpecification,\n LayerSpecification,\n MapGeoJSONFeature,\n MapMouseEvent,\n} from 'maplibre-gl';\nimport { Subject } from 'rxjs';\n\nexport abstract class MapLayer<TElementType> {\n initialized = false;\n\n protected unsubscribe = new Subject<void>();\n\n constructor(\n protected readonly config: MapElementConfig<TElementType>,\n protected readonly sourceId: string,\n protected readonly layerIdSuffix?: string,\n ) {}\n\n get id(): string {\n const suffix = this.layerIdSuffix ? `-${this.layerIdSuffix}` : '';\n return `${this.sourceId}${suffix}`;\n }\n\n get styleLayer() {\n return this.config.map.getLayer(this.id);\n }\n\n onInit() {\n // Add the layer to the map, with the correct ordering (beforeId)\n const beforeId = this.config.mapElementRepository.getBeforeId(this.config.elementId);\n this.config.map.addLayer(this.getSpecification() as LayerSpecification, beforeId);\n\n // Keeping track of which layers have been added to the map to allow for beforeId determination\n this.#setupClickHandlers();\n this.initialized = true;\n }\n\n onDestroy() {\n this.initialized = false;\n this.#removeClickHandlers();\n\n this.config.map.removeLayer(this.id);\n\n this.unsubscribe.next();\n this.unsubscribe.complete();\n }\n\n setVisible(visible: boolean) {\n this.config.map.setLayoutProperty(this.id, 'visibility', visible ? 'visible' : 'none');\n }\n\n protected onClick?(features: Feature[]): void;\n\n protected abstract getSpecification(): Partial<LayerSpecification>;\n getFilterSpecification?(): FilterSpecification;\n\n #setupClickHandlers() {\n if (!this.onClick) return;\n\n this.config.map.on('click', this.id, (event) => {\n this.onClick?.(this.#getFeatures(event));\n });\n\n this.config.maplibreCursorService.setMouseCursor(this.config.map, this.id);\n }\n\n #removeClickHandlers() {\n if (!this.onClick) return;\n\n this.config.map.off('click', this.id, (event) => {\n this.onClick?.(this.#getFeatures(event));\n });\n }\n\n #getFeatures(event: ClickEvent): Feature[] {\n if (event.features && event.features.length > 0) {\n return this.#distinctFeatures(event.features);\n }\n return [];\n }\n\n /**\n * Filters an array of features to remove duplicates based on their properties.\n * Two features are considered duplicates if they have identical properties.\n * Particularly vector sources can yield duplicate features due to the way they\n * are rendered in tiles.\n *\n * @param features - Array of GeoJSON features to filter\n * @returns Array of unique features with no property duplicates\n * @private\n */\n #distinctFeatures(features: Feature[]): Feature[] {\n const seen = new Set();\n const uniqueFeatures: Feature[] = [];\n\n features.forEach((feature) => {\n const propertiesString = JSON.stringify(feature.properties);\n if (!seen.has(propertiesString)) {\n seen.add(propertiesString);\n uniqueFeatures.push(feature);\n }\n });\n\n return uniqueFeatures;\n }\n}\n\nexport type ClickEvent = MapMouseEvent & {\n features?: MapGeoJSONFeature[];\n} & object;\n","import { FeatureCollection } from 'geojson';\nimport { GeoJSONSource, SourceSpecification } from 'maplibre-gl';\nimport { Observable, Subject, takeUntil } from 'rxjs';\nimport { MapLayer } from './map-layer';\nimport { MapElementConfig } from './map-element';\n\nexport abstract class MapSource<TElementType> {\n layers: MapLayer<TElementType>[] = [];\n\n protected unsubscribe = new Subject<void>();\n\n #isInitialized = false;\n #featureCollection$?: Observable<FeatureCollection>;\n\n constructor(\n public readonly id: string,\n protected readonly config: MapElementConfig<TElementType>,\n ) {}\n\n onInit() {\n if (!this.config.map.getSource(this.id)) {\n this.config.map.addSource(this.id, this.getSpecification() as SourceSpecification);\n }\n\n this.layers.forEach((layer) => layer.onInit());\n\n this.isInitialized = true;\n }\n\n onDestroy() {\n this.isInitialized = false;\n\n this.layers.forEach((layer) => layer.onDestroy());\n\n this.unsubscribe.next();\n this.unsubscribe.complete();\n }\n\n get featureCollection$(): Observable<FeatureCollection> | undefined {\n return this.#featureCollection$;\n }\n\n set featureCollection$(value: Observable<FeatureCollection> | undefined) {\n this.#featureCollection$ = value;\n this.#subscribeToFeatureCollection();\n }\n\n get isInitialized(): boolean {\n return this.#isInitialized;\n }\n\n set isInitialized(value: boolean) {\n this.#isInitialized = value;\n this.#subscribeToFeatureCollection();\n }\n\n setVisible(visible: boolean) {\n this.layers.forEach((layer) => layer.setVisible(visible));\n }\n\n protected abstract getSpecification(): Partial<SourceSpecification>;\n\n #subscribeToFeatureCollection() {\n if (this.isInitialized && this.featureCollection$) {\n this.featureCollection$.pipe(takeUntil(this.unsubscribe)).subscribe({\n next: (featureCollection) => {\n const source = this.config.map.getSource(this.id);\n\n if (source && source.type === 'geojson') {\n (source as GeoJSONSource).setData(featureCollection);\n } else {\n // not needed because source is always specified as geojson with empty collection\n this.config.map.addSource(this.id, {\n type: 'geojson',\n data: featureCollection,\n });\n }\n },\n error: (error) => {\n console.error('Error updating feature collection', error);\n },\n });\n }\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n input,\n OnDestroy,\n viewChild,\n} from '@angular/core';\nimport { AnimationOptions, Map, MapOptions } from 'maplibre-gl';\nimport { MapConfig, DEFAULT_MAP_CONFIG } from './map-config.interface';\n\n@Component({\n standalone: true,\n template: '<div #mapContainer class=\"map\"></div>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport abstract class MapComponent implements AfterViewInit, OnDestroy {\n mapContainer = viewChild.required<ElementRef>('mapContainer');\n config = input<Partial<MapConfig>>({});\n map!: Map;\n\n ngAfterViewInit() {\n this.map = this.#createMap(this.mapContainer().nativeElement);\n this.map.once('load', () => this.#initiateMapLoading());\n }\n\n ngOnDestroy() {\n // Note: Using `this.map.once('remove', this.onRemoveMap())` does not work correctly because,\n // by the time the `onRemoveMap` event is triggered, it is no longer possible to interact with the map for cleanup.\n // To address this we call `onRemoveMap` explicitly before destroying the MapLibre instance. This\n // ensures that our map elements are cleaned up properly before the map is removed.\n this.onRemoveMap();\n this.map?.remove();\n }\n\n resizeMap() {\n this.map?.resize();\n }\n\n zoomToLevel(zoomLevel: number, options?: AnimationOptions) {\n this.map?.zoomTo(zoomLevel, options);\n }\n\n #createMap(container: HTMLElement): Map {\n const config = { ...DEFAULT_MAP_CONFIG, ...this.config() };\n\n const options = {\n container,\n style: {\n version: 8 as const,\n sources: {},\n layers: [],\n },\n maxZoom: config.maxZoom,\n minZoom: config.minZoom,\n interactive: config.interactive,\n doubleClickZoom: config.doubleClickZoom,\n scrollZoom: config.scrollZoom,\n boxZoom: config.boxZoom,\n dragPan: config.dragPan,\n keyboard: config.keyboard,\n touchZoomRotate: config.touchZoomRotate,\n } as MapOptions;\n\n const map = new Map(options);\n\n return map;\n }\n\n protected abstract onLoadMap(): void;\n protected abstract onRemoveMap(): void;\n protected abstract onIdle(): void;\n\n #initiateMapLoading() {\n this.onLoadMap();\n this.resizeMap();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Map } from 'maplibre-gl';\n\n/**\n * Service for managing MapLibre map cursor interactions.\n *\n * Maplibre has no automatic cursor handling for layers, so when you add a clickHandler\n * to a layer, the user can click on it, but the cursor will not change to a pointer.\n * This service provides methods to set the cursor to pointer when hovering over a layer,\n * and to enable crosshair mode which takes precedence over all other cursor types.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MaplibreCursorService {\n /** Counter to track how many layers currently need a pointer cursor */\n #cursorPointerCount = 0;\n /** Flag indicating if crosshair mode is active */\n #crosshairMode = false;\n\n /**\n * Sets up mouse cursor handling for a map layer.\n * Changes cursor to pointer when mouse enters the layer and resets when leaving.\n *\n * @param map - The MapLibre map instance\n * @param layerId - ID of the layer to apply cursor behavior to\n */\n setMouseCursor(map: Map, layerId: string) {\n const updateCursor = (cursor: string) => {\n if (!this.#crosshairMode) this.#setMouseCursor(map, cursor);\n };\n\n map.on('mouseenter', layerId, () => updateCursor('pointer'));\n map.on('mouseleave', layerId, () => updateCursor(''));\n }\n\n /**\n * Enables or disables crosshair cursor mode for the map.\n * When enabled, crosshair cursor will take precedence over all other cursor types.\n *\n * @param value - True to enable crosshair mode, false to disable\n * @param map - The MapLibre map instance to apply the cursor to\n */\n /**\n * Enables or disables crosshair cursor mode for the map.\n * When enabled, crosshair cursor will take precedence over all other cursor types.\n *\n * @param value - True to enable crosshair mode, false to disable\n * @param map - The MapLibre map instance to apply the cursor to\n */\n setCrosshairMode(value: boolean, map: Map) {\n this.#crosshairMode = value;\n\n let cursorType = '';\n if (value) {\n cursorType = 'crosshair';\n } else if (this.#cursorPointerCount > 0) {\n cursorType = 'pointer';\n }\n\n map.getCanvas().style.cursor = cursorType;\n }\n\n /**\n * Internal method to handle mouse cursor state changes.\n * Manages the cursor pointer reference counter to ensure cursor displays correctly\n * when hovering over multiple interactive layers.\n *\n * @param map - The MapLibre map instance\n * @param cursor - Cursor type to set ('pointer' or '' to reset)\n * @private\n */\n #setMouseCursor(map: Map, cursor: string) {\n if (this.#crosshairMode) {\n // Crosshair mode takes precedence, ignore other cursor settings\n map.getCanvas().style.cursor = 'crosshair';\n return;\n }\n\n if (cursor === 'pointer') {\n this.#cursorPointerCount++;\n map.getCanvas().style.cursor = cursor;\n } else if (cursor === '') {\n this.#cursorPointerCount--;\n if (this.#cursorPointerCount < 1) {\n map.getCanvas().style.cursor = '';\n }\n } else {\n console.warn(`Cursor type '${cursor}' is not supported.`);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEO,MAAM,SAAS,GAA6B;IACjD,CAAC,QAAQ,EAAE,SAAS,CAAC;IACrB,CAAC,QAAQ,EAAE,SAAS,CAAC;;AAEhB,MAAM,iBAAiB,GAA6B;IACzD,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IACrC,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;;;ACmCjC,MAAM,kBAAkB,GAAwC;AACrE,IAAA,MAAM,EAAE,C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HjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ndwnu-map.mjs","sources":["../../../../libs/map/src/lib/base/map-layer.ts","../../../../libs/map/src/lib/api/api-layer.ts","../../../../libs/map/src/lib/api/api-background-layer.ts","../../../../libs/map/src/lib/base/map-element.ts","../../../../libs/map/src/lib/base/map-source.ts","../../../../libs/map/src/lib/api/api-source.ts","../../../../libs/map/src/lib/api/api-element.ts","../../../../libs/map/src/lib/component/map-config.interface.ts","../../../../libs/map/src/lib/component/map.component.ts","../../../../libs/map/src/lib/misc/map-constants.ts","../../../../libs/map/src/lib/misc/map-element.repository.ts","../../../../libs/map/src/lib/misc/maplibre-cursor.service.ts","../../../../libs/map/src/ndwnu-map.ts"],"sourcesContent":["import { Feature } from 'geojson';\nimport { MapElementConfig } from './../base/map-element.config';\nimport {\n FilterSpecification,\n LayerSpecification,\n MapGeoJSONFeature,\n MapMouseEvent,\n Point,\n} from 'maplibre-gl';\nimport { Subject } from 'rxjs';\n\nexport abstract class MapLayer<TElementType, TFilter = unknown, TLegendItem = unknown> {\n initialized = false;\n\n protected unsubscribe = new Subject<void>();\n\n constructor(\n protected readonly config: MapElementConfig<TElementType, TFilter, TLegendItem>,\n protected readonly sourceId: string,\n protected readonly layerIdSuffix?: string,\n ) {}\n\n get id(): string {\n const suffix = this.layerIdSuffix ? `-${this.layerIdSuffix}` : '';\n return `${this.sourceId}${suffix}`;\n }\n\n get styleLayer() {\n return this.config.map.getLayer(this.id);\n }\n\n onInit() {\n // Add the layer to the map, with the correct ordering (beforeId)\n const beforeId = this.config.mapElementRepository.getBeforeId(this.config.elementId);\n this.config.map.addLayer(this.getSpecification() as LayerSpecification, beforeId);\n\n // Keeping track of which layers have been added to the map to allow for beforeId determination\n this.#setupClickHandlers();\n this.initialized = true;\n }\n\n onDestroy() {\n this.initialized = false;\n this.#removeClickHandlers();\n\n this.config.map.removeLayer(this.id);\n\n this.unsubscribe.next();\n this.unsubscribe.complete();\n }\n\n setVisible(visible: boolean) {\n this.config.map.setLayoutProperty(this.id, 'visibility', visible ? 'visible' : 'none');\n }\n\n protected onClick?(point: Point, features: Feature[]): void;\n\n protected abstract getSpecification(): Partial<LayerSpecification>;\n getFilterSpecification?(filter?: TFilter): FilterSpecification;\n\n #setupClickHandlers() {\n if (!this.onClick) return;\n\n const mapElement = this.config.mapElementRepository.getMapElementById(this.config.elementId);\n if (!mapElement?.isInteractive) {\n return;\n }\n\n this.config.map.on('click', this.id, (event) => {\n this.onClick?.(event.point, this.#getFeatures(event));\n });\n\n this.config.maplibreCursorService.setMouseCursor(this.config.map, this.id);\n }\n\n #removeClickHandlers() {\n if (!this.onClick) return;\n\n this.config.map.off('click', this.id, (event) => {\n this.onClick?.(event.point, this.#getFeatures(event));\n });\n }\n\n #getFeatures(event: ClickEvent): Feature[] {\n if (event.features && event.features.length > 0) {\n return this.#distinctFeatures(event.features);\n }\n return [];\n }\n\n /**\n * Filters an array of features to remove duplicates based on their properties.\n * Two features are considered duplicates if they have identical properties.\n * Particularly vector sources can yield duplicate features due to the way they\n * are rendered in tiles.\n *\n * @param features - Array of GeoJSON features to filter\n * @returns Array of unique features with no property duplicates\n * @private\n */\n #distinctFeatures(features: Feature[]): Feature[] {\n const seen = new Set();\n const uniqueFeatures: Feature[] = [];\n\n features.forEach((feature) => {\n const propertiesString = JSON.stringify(feature.properties);\n if (!seen.has(propertiesString)) {\n seen.add(propertiesString);\n uniqueFeatures.push(feature);\n }\n });\n\n return uniqueFeatures;\n }\n}\n\nexport type ClickEvent = MapMouseEvent & {\n features?: MapGeoJSONFeature[];\n} & object;\n","import { MapElementConfig } from './../base/map-element.config';\nimport { MapLayer } from './../base/map-layer';\nimport { LayerSpecification } from 'maplibre-gl';\n\nexport class ApiLayer<TElementType, TFilter = unknown, TLegendItem = unknown> extends MapLayer<\n TElementType,\n TFilter,\n TLegendItem\n> {\n constructor(\n config: MapElementConfig<TElementType, TFilter, TLegendItem>,\n private readonly _layerSpecification: LayerSpecification,\n ) {\n const sourceId = 'source' in _layerSpecification ? _layerSpecification.source : '';\n\n super(config, sourceId);\n\n // Ensure that layout visibility is set after the base constructor has been called\n this._layerSpecification.layout = {\n ...this._layerSpecification.layout,\n visibility: 'none',\n };\n }\n\n public override get id(): string {\n return this._layerSpecification.id;\n }\n\n protected getSpecification(): Partial<LayerSpecification> {\n return this._layerSpecification;\n }\n}\n","import { BackgroundLayerSpecification } from 'maplibre-gl';\n\nimport { ApiLayer } from './api-layer';\nimport { MapElementConfig } from './../base/map-element.config';\n\nexport class ApiBackgroundLayer<\n TElementType,\n TFilter = unknown,\n TLegendItem = unknown,\n> extends ApiLayer<TElementType, TFilter, TLegendItem> {\n constructor(\n config: MapElementConfig<TElementType, TFilter, TLegendItem>,\n layerSpecification: BackgroundLayerSpecification,\n ) {\n super(config, layerSpecification);\n }\n}\n","import { MapElementConfig } from './../base/map-element.config';\nimport { MapSource } from './../base/map-source';\nimport { Subject } from 'rxjs';\n\nexport abstract class MapElement<TElementType, TFilter = unknown, TLegendItem = unknown> {\n id: TElementType;\n elementOrder: number;\n sources: MapSource<TElementType, TFilter, TLegendItem>[] = [];\n alwaysVisible = false;\n isVisible = false;\n isInteractive = true;\n\n protected unsubscribe = new Subject<void>();\n\n constructor(protected readonly config: MapElementConfig<TElementType, TFilter, TLegendItem>) {\n this.id = config.elementId;\n this.elementOrder = config.elementOrder;\n if (config.isInteractive !== undefined) {\n this.isInteractive = config.isInteractive;\n }\n }\n\n get legendItems(): TLegendItem[] {\n return [];\n }\n\n onInit() {\n this.sources.forEach((source) => source.onInit());\n }\n\n onDestroy() {\n this.sources.forEach((source) => source.onDestroy());\n\n this.unsubscribe.next();\n this.unsubscribe.complete();\n }\n\n setVisible(visible: boolean) {\n this.isVisible = visible;\n this.sources.forEach((source) => source.setVisible(visible));\n }\n\n reload() {\n this.sources.forEach((source) => source.reload());\n }\n}\n","import { FeatureCollection } from 'geojson';\nimport { MapElementConfig } from './../base/map-element.config';\nimport { MapLayer } from './../base/map-layer';\nimport { FilterSpecification, GeoJSONSource, SourceSpecification } from 'maplibre-gl';\nimport { Observable, Subject, Subscription, takeUntil } from 'rxjs';\n\nexport abstract class MapSource<TElementType, TFilter = unknown, TLegendItem = unknown> {\n layers: MapLayer<TElementType, TFilter, TLegendItem>[] = [];\n\n protected unsubscribe = new Subject<void>();\n protected activeFilter: TFilter | undefined;\n\n #isInitialized = false;\n #filter$?: Observable<TFilter>;\n #filterSubscription?: Subscription;\n #featureCollection$?: Observable<FeatureCollection>;\n\n constructor(\n public readonly id: string,\n protected readonly config: MapElementConfig<TElementType, TFilter, TLegendItem>,\n ) {}\n\n onInit() {\n if (!this.config.map.getSource(this.id)) {\n this.config.map.addSource(this.id, this.getSpecification() as SourceSpecification);\n }\n\n this.layers.forEach((layer) => layer.onInit());\n\n this.isInitialized = true;\n }\n\n onDestroy() {\n this.isInitialized = false;\n\n this.layers.forEach((layer) => layer.onDestroy());\n\n this.unsubscribe.next();\n this.unsubscribe.complete();\n }\n\n get featureCollection$(): Observable<FeatureCollection> | undefined {\n return this.#featureCollection$;\n }\n\n set featureCollection$(value: Observable<FeatureCollection> | undefined) {\n this.#featureCollection$ = value;\n this.#subscribeToFeatureCollection();\n }\n\n get isInitialized(): boolean {\n return this.#isInitialized;\n }\n\n set isInitialized(value: boolean) {\n this.#isInitialized = value;\n this.#subscribeToFeatureCollection();\n this.#subscribeToFilters();\n }\n\n get filter$(): Observable<TFilter> | undefined {\n return this.#filter$;\n }\n\n set filter$(value: Observable<TFilter> | undefined) {\n this.#filter$ = value;\n this.#subscribeToFilters();\n }\n\n setVisible(visible: boolean) {\n this.layers.forEach((layer) => layer.setVisible(visible));\n }\n\n reload() {\n this.config.map.refreshTiles(this.id);\n }\n\n protected abstract getSpecification(): Partial<SourceSpecification>;\n protected getFilterSpecification?(filter: TFilter | undefined): FilterSpecification;\n\n protected applyFilterToLayers(filterValue: TFilter | undefined) {\n const hasSourceFilter = !!this.getFilterSpecification;\n const hasLayerFilter = this.layers.some((layer) => !!layer.getFilterSpecification);\n\n if (!hasSourceFilter && !hasLayerFilter) {\n return;\n }\n\n this.activeFilter = filterValue;\n\n const sourceFilter = this.getFilterSpecification?.(filterValue);\n this.layers.forEach((layer) => {\n const layerFilter = layer.getFilterSpecification?.(filterValue);\n const combinedFilter = (\n sourceFilter && layerFilter\n ? ['all', sourceFilter, layerFilter]\n : sourceFilter || layerFilter\n ) as FilterSpecification;\n this.config.map.setFilter(layer.id, combinedFilter);\n });\n }\n\n #subscribeToFilters() {\n if (!this.isInitialized) return;\n\n if (this.#filterSubscription) {\n this.#filterSubscription.unsubscribe();\n }\n\n if (this.#filter$) {\n this.#filterSubscription = this.#filter$.pipe(takeUntil(this.unsubscribe)).subscribe({\n next: (filter) => {\n this.applyFilterToLayers(filter);\n },\n error: (error) => {\n console.error('Error updating filter', error);\n },\n });\n } else {\n this.applyFilterToLayers(undefined);\n }\n }\n\n #subscribeToFeatureCollection() {\n if (this.isInitialized && this.featureCollection$) {\n this.featureCollection$.pipe(takeUntil(this.unsubscribe)).subscribe({\n next: (featureCollection) => {\n const source = this.config.map.getSource(this.id);\n\n if (source?.type === 'geojson') {\n (source as GeoJSONSource).setData(featureCollection);\n } else {\n // not needed because source is always specified as geojson with empty collection\n this.config.map.addSource(this.id, {\n type: 'geojson',\n data: featureCollection,\n });\n }\n },\n error: (error) => {\n console.error('Error updating feature collection', error);\n },\n });\n }\n }\n}\n","import { LayerSpecification, SourceSpecification, StyleSpecification } from 'maplibre-gl';\n\nimport { ApiLayer } from './api-layer';\nimport { MapElementConfig } from './../base/map-element.config';\nimport { MapSource } from './../base/map-source';\n\nexport type LayerFilterFunction = (layer: LayerSpecification) => boolean;\n\nexport class ApiSource<TElementType, TFilter = unknown, TLegendItem = unknown> extends MapSource<\n TElementType,\n TFilter,\n TLegendItem\n> {\n constructor(\n id: string,\n config: MapElementConfig<TElementType, TFilter, TLegendItem>,\n private readonly _styleSpecification: StyleSpecification,\n private readonly _layerFilter?: LayerFilterFunction,\n ) {\n super(id, config);\n }\n\n protected getSpecification(): Partial<SourceSpecification> {\n return this._styleSpecification.sources[this.id];\n }\n\n /**\n * Creates ApiLayer instances for this source without initializing them.\n */\n createLayers(layers: LayerSpecification[]) {\n this.layers = layers\n .filter((layer) => layer.type !== 'background')\n .filter((layer) => layer.source === this.id)\n .filter((layer) => !this._layerFilter || this._layerFilter(layer))\n .map((layer) => new ApiLayer(this.config, layer));\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { LayerSpecification, StyleSpecification } from 'maplibre-gl';\nimport { filter, takeUntil } from 'rxjs';\n\nimport { ApiBackgroundLayer } from './api-background-layer';\nimport { MapElement } from './../base/map-element';\nimport { MapElementConfig } from './../base/map-element.config';\nimport { ApiSource, LayerFilterFunction } from './../api/api-source';\n\nexport class ApiElement<TElementType, TFilter = unknown, TLegendItem = unknown> extends MapElement<\n TElementType,\n TFilter,\n TLegendItem\n> {\n backgroundLayers: ApiBackgroundLayer<TElementType, TFilter, TLegendItem>[] = [];\n\n #visible = false;\n\n constructor(\n config: MapElementConfig<TElementType, TFilter, TLegendItem>,\n private readonly _http: HttpClient,\n private readonly _mapStyleUrl: string,\n private readonly _layerFilter?: LayerFilterFunction,\n ) {\n super(config);\n }\n\n override onInit() {\n super.onInit();\n\n this._http\n .get<StyleSpecification>(this._mapStyleUrl)\n .pipe(\n filter((styleSpecification) => !!styleSpecification),\n takeUntil(this.unsubscribe),\n )\n .subscribe((styleSpecification) => {\n this.#createBackgroundLayers(styleSpecification.layers);\n this.#createSources(styleSpecification);\n\n // If setVisible() was called before these layers were created,\n // re-apply the current visibility state so the new layers respect it.\n this.setVisible(this.#visible);\n });\n }\n\n override setVisible(visible: boolean) {\n this.#visible = visible;\n\n super.setVisible(visible);\n this.backgroundLayers.forEach((layer) => layer.setVisible(visible));\n }\n\n #createSources(styleSpecification: StyleSpecification) {\n const layers = styleSpecification.layers;\n\n // First, create all sources and their layer instances (without initializing them)\n this.sources = Object.entries(styleSpecification.sources).map(([id]) => {\n const source = new ApiSource<TElementType, TFilter, TLegendItem>(\n id,\n this.config,\n styleSpecification,\n this._layerFilter,\n );\n source.onInit();\n source.createLayers(layers);\n return source;\n });\n\n // Then, initialize all layers according to the style.json order\n // This ensures correct ordering regardless of which source they belong to\n this.#initializeLayersInOrder(layers);\n }\n\n #initializeLayersInOrder(layers: LayerSpecification[]) {\n // Create a map of layerId -> ApiLayer for quick lookup\n const layerMap = new Map(\n this.sources.flatMap((source) => source.layers.map((layer) => [layer.id, layer])),\n );\n\n // Initialize layers in the order they appear in style.json\n for (const layerSpec of layers) {\n const layer = layerMap.get(layerSpec.id);\n if (layer) {\n layer.onInit();\n }\n }\n }\n\n // API elements are created from the style specification and this can contain layers of type 'background'\n // These layers do not have a source and therefore don't fit in the element > source > layer hierarchy\n // That is why we create these layers from the element itself\n #createBackgroundLayers(layerSpecifications: LayerSpecification[]) {\n this.backgroundLayers = layerSpecifications\n .filter((layer) => layer.type === 'background')\n .filter((layer) => !this._layerFilter || this._layerFilter(layer))\n .map((layerSpecification) => {\n const apiLayer = new ApiBackgroundLayer(this.config, layerSpecification);\n apiLayer.onInit();\n return apiLayer;\n });\n }\n}\n","import { LngLatBoundsLike, LngLatLike } from 'maplibre-gl';\n\nexport interface MapConfig {\n /** Initial center position of the map */\n center?: LngLatLike;\n\n /** Initial zoom level */\n zoom?: number;\n\n /** Maximum zoom level */\n maxZoom?: number;\n\n /** Minimum zoom level */\n minZoom?: number;\n\n /** Initial bounds to fit the map to */\n bounds?: LngLatBoundsLike;\n\n /** Enable/disable all map interactions */\n interactive?: boolean;\n\n /** Enable/disable map rotation via drag */\n dragRotate?: boolean;\n\n /** Enable/disable double-click to zoom */\n doubleClickZoom?: boolean;\n\n /** Enable/disable scroll wheel zoom */\n scrollZoom?: boolean;\n\n /** Enable/disable shift+drag box zoom */\n boxZoom?: boolean;\n\n /** Enable/disable drag to pan */\n dragPan?: boolean;\n\n /** Enable/disable keyboard navigation */\n keyboard?: boolean;\n\n /** Enable/disable touch zoom and rotation on mobile */\n touchZoomRotate?: boolean;\n}\n\nexport const DEFAULT_MAP_CONFIG: Required<Omit<MapConfig, 'bounds'>> = {\n center: [5.387827, 52.155172],\n zoom: 8,\n maxZoom: 18,\n minZoom: 6,\n interactive: true,\n dragRotate: false,\n doubleClickZoom: true,\n scrollZoom: true,\n boxZoom: true,\n dragPan: true,\n keyboard: true,\n touchZoomRotate: true,\n};\n\n// Common bounds that users can optionally use\nexport const COMMON_BOUNDS = {\n NETHERLANDS: [\n [3.079667, 50.587611],\n [7.572028, 53.636667],\n ] as LngLatBoundsLike,\n AMERSFOORT: [\n [5.34458238242172, 52.11623605695118],\n [5.446205917577942, 52.21132028216525],\n ] as LngLatBoundsLike,\n} as const;\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n input,\n OnDestroy,\n viewChild,\n} from '@angular/core';\nimport { AnimationOptions, Map, MapOptions } from 'maplibre-gl';\nimport { MapConfig, DEFAULT_MAP_CONFIG } from './map-config.interface';\n\n@Component({\n standalone: true,\n template: '<div #mapContainer class=\"map\"></div>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport abstract class MapComponent implements AfterViewInit, OnDestroy {\n mapContainer = viewChild.required<ElementRef>('mapContainer');\n config = input<Partial<MapConfig>>({});\n map!: Map;\n\n ngAfterViewInit() {\n this.map = this.#createMap(this.mapContainer().nativeElement);\n this.map.once('load', () => this.#initiateMapLoading());\n }\n\n ngOnDestroy() {\n // Note: Using `this.map.once('remove', this.onRemoveMap())` does not work correctly because,\n // by the time the `onRemoveMap` event is triggered, it is no longer possible to interact with the map for cleanup.\n // To address this we call `onRemoveMap` explicitly before destroying the MapLibre instance. This\n // ensures that our map elements are cleaned up properly before the map is removed.\n this.onRemoveMap();\n this.map?.remove();\n }\n\n resizeMap() {\n this.map?.resize();\n }\n\n zoomToLevel(zoomLevel: number, options?: AnimationOptions) {\n this.map?.zoomTo(zoomLevel, options);\n }\n\n #createMap(container: HTMLElement): Map {\n const config = { ...DEFAULT_MAP_CONFIG, ...this.config() };\n\n const options = {\n container,\n style: {\n version: 8 as const,\n sources: {},\n layers: [],\n },\n maxZoom: config.maxZoom,\n minZoom: config.minZoom,\n interactive: config.interactive,\n doubleClickZoom: config.doubleClickZoom,\n scrollZoom: config.scrollZoom,\n boxZoom: config.boxZoom,\n dragPan: config.dragPan,\n keyboard: config.keyboard,\n touchZoomRotate: config.touchZoomRotate,\n } as MapOptions;\n\n const map = new Map(options);\n\n return map;\n }\n\n protected abstract onLoadMap(): void;\n protected abstract onRemoveMap(): void;\n protected abstract onIdle(): void;\n\n #initiateMapLoading() {\n this.onLoadMap();\n this.resizeMap();\n }\n}\n","import { LngLatLike, DataDrivenPropertyValueSpecification, LayerSpecification } from 'maplibre-gl';\n\nexport const BOUNDS_NL: [LngLatLike, LngLatLike] = [\n [3.079667, 50.587611],\n [7.572028, 53.636667],\n];\nexport const BOUNDS_AMERSFOORT: [LngLatLike, LngLatLike] = [\n [5.34458238242172, 52.11623605695118],\n [5.446205917577942, 52.21132028216525],\n];\n\nexport const lineWidthFrcSpecification = [\n 'interpolate',\n ['exponential', 1.1],\n ['zoom'],\n 10,\n [\n 'match',\n ['get', 'functionalRoadClass'],\n '0',\n 2.5,\n '1',\n 2.5,\n '2',\n 2.5,\n '3',\n 1.5,\n '4',\n 1.5,\n '5',\n 1,\n 0,\n ],\n 13,\n [\n 'match',\n ['get', 'functionalRoadClass'],\n '0',\n 7,\n '1',\n 7,\n '2',\n 5.7,\n '3',\n 4.1,\n '4',\n 4.1,\n '5',\n 2.7,\n '6',\n 1.5,\n 0,\n ],\n 15,\n [\n 'match',\n ['get', 'functionalRoadClass'],\n '0',\n 10.4,\n '1',\n 10.4,\n '2',\n 8.4,\n '3',\n 6.4,\n '4',\n 6.4,\n '5',\n 5.4,\n '6',\n 3.4,\n '7',\n 3.4,\n 3,\n ],\n 20,\n [\n 'match',\n ['get', 'functionalRoadClass'],\n '0',\n 24,\n '1',\n 24,\n '2',\n 22,\n '3',\n 20,\n '4',\n 18,\n '5',\n 16,\n '6',\n 14,\n '7',\n 10,\n 8,\n ],\n] as DataDrivenPropertyValueSpecification<number>;\n\nexport type NdwLayerSpecification = LayerSpecification & {\n metadata: { group: string; subGroup: string };\n};\nexport type NdwLayerFilterFunction = (layer: NdwLayerSpecification) => boolean;\n","import { MapElement } from './../base/map-element';\nimport { BehaviorSubject, map } from 'rxjs';\n\n/**\n * Repository for managing map elements.\n * Provides methods to add, remove, show, hide, and toggle map elements.\n * Also tracks element visibility state and provides observable streams for elements.\n *\n * @typeparam TElementType - The type of ID used for the map elements\n * @typeparam TFilter - The type of filter used for the map elements\n * @typeparam TLegendItem - The type of legend item used for the map elements\n */\nexport abstract class MapElementRepository<TElementType, TFilter = unknown, TLegendItem = unknown> {\n /** Subject that holds the current array of map elements */\n private readonly mapElementsSubject = new BehaviorSubject<\n MapElement<TElementType, TFilter, TLegendItem>[]\n >([]);\n\n // mapElements are not directly exposed to prevent circular reference errors when\n // they are used in a template. Because the mapElements$ observable contains MapLibre\n // GL JS map objects, which have circular references.\n\n /** Observable stream of all map elements */\n readonly mapElements$ = this.mapElementsSubject.asObservable();\n\n /** Observable stream of only visible map elements */\n readonly visibleMapElements$ = this.mapElements$.pipe(\n map((elements: MapElement<TElementType, TFilter, TLegendItem>[]) =>\n elements.filter((element) => element.isVisible),\n ),\n );\n\n /** Observable stream of legend items from all visible map elements */\n readonly legendItems$ = this.visibleMapElements$.pipe(\n map((elements) => elements.flatMap((element) => element.legendItems)),\n );\n\n /**\n * Gets the ids (TElementType) as an array of all map element\n * @returns Array of TElementType\n */\n mapElementIds$ = this.mapElements$.pipe(map((elements) => elements.map((element) => element.id)));\n\n /**\n * Gets the ids (TElementType) as an array of all visible map element\n * @returns Array of TElementType\n */\n visibleMapElementIds$ = this.visibleMapElements$.pipe(\n map((elements) => elements.map((element) => element.id)),\n );\n\n /**\n * Gets the ids (TElementType) as an array of all visible map element\n * @returns Array of TElementType\n */\n get visibleMapElementIds(): TElementType[] {\n return this.visibleMapElements.map((element) => element.id);\n }\n\n /**\n * Gets the current array of all map elements\n * @returns Array of map elements\n */\n get mapElements(): MapElement<TElementType, TFilter, TLegendItem>[] {\n return this.mapElementsSubject.getValue();\n }\n\n /**\n * Gets only the currently visible map elements\n * @returns Array of visible map elements\n */\n get visibleMapElements(): MapElement<TElementType, TFilter, TLegendItem>[] {\n return this.mapElements.filter((element) => element.isVisible);\n }\n\n /**\n * Finds a map element by its ID\n *\n * @param elementId - The ID of the element to find\n * @returns The map element if found, undefined otherwise\n */\n getMapElementById(\n elementId: TElementType,\n ): MapElement<TElementType, TFilter, TLegendItem> | undefined {\n return this.mapElements.find((element) => element.id === elementId);\n }\n\n /**\n * Checks if a map element is currently visible\n *\n * @param elementId - The ID of the element to check\n * @returns True if the element is visible, false otherwise\n */\n isMapElementVisible(elementId: TElementType): boolean {\n return this.visibleMapElements.some((element) => element.id === elementId);\n }\n\n /**\n * Adds a new map element to the repository and initializes it.\n * Sets the element's visibility based on its configuration.\n *\n * @param mapElement - The map element to add\n */\n addMapElement(mapElement: MapElement<TElementType, TFilter, TLegendItem>) {\n const currentElements = this.mapElements;\n this.mapElementsSubject.next([...currentElements, mapElement]);\n mapElement.onInit();\n if (mapElement.alwaysVisible || this.isMapElementVisible(mapElement.id)) {\n this.showMapElement(mapElement.id);\n } else {\n this.hideMapElement(mapElement.id);\n }\n }\n\n /**\n * Removes a map element from the repository and destroys it.\n *\n * @param mapElement - The map element to remove\n */\n removeMapElement(mapElement: MapElement<TElementType, TFilter, TLegendItem>) {\n const filteredElements = this.mapElements.filter((element) => element.id !== mapElement.id);\n this.mapElementsSubject.next(filteredElements);\n mapElement.onDestroy();\n }\n\n /**\n * Removes all map elements from the repository and destroys them.\n */\n removeAllMapElements() {\n this.mapElements.forEach((element) => {\n this.removeMapElement(element);\n });\n }\n\n /**\n * Sets the visibility of a map element by its ID and updates the subject with the new state.\n *\n * @param elementId - The ID of the element to update\n * @param visible - Whether the element should be visible or hidden\n */\n private setMapElementVisibility(elementId: TElementType, visible: boolean) {\n const element = this.getMapElementById(elementId);\n if (element) {\n element.setVisible(visible);\n const elements = this.mapElements.filter((el) => el.id !== elementId);\n this.mapElementsSubject.next([...elements, element]);\n }\n }\n\n /**\n * Shows a map element by its ID and updates the subject with the new state.\n *\n * @param elementId - The ID of the element to show\n */\n showMapElement(elementId: TElementType) {\n this.setMapElementVisibility(elementId, true);\n }\n\n /**\n * Hides a map element by its ID and updates the subject with the new state.\n *\n * @param elementId - The ID of the element to hide\n */\n hideMapElement(elementId: TElementType) {\n this.setMapElementVisibility(elementId, false);\n }\n\n /**\n * Triggers a reload of the tiles in the sources of the map element with the given ID\n *\n * @param elementId - The ID of the element to reload\n */\n reloadMapElement(elementId: TElementType) {\n const element = this.getMapElementById(elementId);\n if (element) {\n element.reload();\n }\n }\n\n /**\n * Toggles the visibility of a map element by its ID.\n * If the element is currently visible, it will be hidden, and vice versa.\n *\n * @param elementId - The ID of the element to toggle visibility\n */\n toggleMapElement(elementId: TElementType) {\n if (this.visibleMapElements.some((element) => element.id === elementId)) {\n this.hideMapElement(elementId);\n } else {\n this.showMapElement(elementId);\n }\n }\n\n /**\n * Gets the ID of the layer that should come before the specified element's layers\n * in the map's layer stack. This is used for maintaining proper layer ordering.\n *\n * @param elementId - The ID of the element to find a \"before\" reference for\n * @returns The ID of the first layer of the next element in order, or undefined if none exists\n */\n getBeforeId(elementId: TElementType): string | undefined {\n const currentElement = this.getMapElementById(elementId);\n if (!currentElement) {\n return undefined;\n }\n\n const nextElement = this.mapElements\n .filter((item) => item.elementOrder > currentElement.elementOrder)\n .sort((a, b) => a.elementOrder - b.elementOrder)[0];\n\n const nextElementLayerIds = nextElement?.sources\n .flatMap((source) => source.layers)\n .filter((layer) => layer.initialized)\n .map((layer) => layer.id);\n\n return nextElement && nextElementLayerIds.length > 0 ? nextElementLayerIds[0] : undefined;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Map } from 'maplibre-gl';\n\n/**\n * Service for managing MapLibre map cursor interactions.\n *\n * Maplibre has no automatic cursor handling for layers, so when you add a clickHandler\n * to a layer, the user can click on it, but the cursor will not change to a pointer.\n * This service provides methods to set the cursor to pointer when hovering over a layer,\n * and to enable crosshair mode which takes precedence over all other cursor types.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MaplibreCursorService {\n /** Counter to track how many layers currently need a pointer cursor */\n #cursorPointerCount = 0;\n /** Flag indicating if crosshair mode is active */\n #crosshairMode = false;\n\n /**\n * Sets up mouse cursor handling for a map layer.\n * Changes cursor to pointer when mouse enters the layer and resets when leaving.\n *\n * @param map - The MapLibre map instance\n * @param layerId - ID of the layer to apply cursor behavior to\n */\n setMouseCursor(map: Map, layerId: string) {\n const updateCursor = (cursor: 'pointer' | '') => {\n if (!this.#crosshairMode) this.#setMouseCursor(map, cursor);\n };\n\n map.on('mouseenter', layerId, () => updateCursor('pointer'));\n map.on('mouseleave', layerId, () => updateCursor(''));\n }\n\n /**\n * Enables or disables crosshair cursor mode for the map.\n * When enabled, crosshair cursor will take precedence over all other cursor types.\n *\n * @param value - True to enable crosshair mode, false to disable\n * @param map - The MapLibre map instance to apply the cursor to\n */\n setCrosshairMode(value: boolean, map: Map) {\n this.#crosshairMode = value;\n\n let cursorType = '';\n if (value) {\n cursorType = 'crosshair';\n } else if (this.#cursorPointerCount > 0) {\n cursorType = 'pointer';\n }\n\n map.getCanvas().style.cursor = cursorType;\n }\n\n /**\n * Internal method to handle mouse cursor state changes.\n * Manages the cursor pointer reference counter to ensure cursor displays correctly\n * when hovering over multiple interactive layers.\n *\n * @param map - The MapLibre map instance\n * @param cursor - Cursor type to set ('pointer' or '' to reset)\n * @private\n */\n #setMouseCursor(map: Map, cursor: 'pointer' | '') {\n if (this.#crosshairMode) {\n // Crosshair mode takes precedence, ignore other cursor settings\n map.getCanvas().style.cursor = 'crosshair';\n return;\n }\n\n if (cursor === 'pointer') {\n this.#cursorPointerCount++;\n map.getCanvas().style.cursor = cursor;\n } else if (cursor === '') {\n this.#cursorPointerCount--;\n if (this.#cursorPointerCount < 1) {\n map.getCanvas().style.cursor = '';\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Map"],"mappings":";;;;;MAWsB,QAAQ,CAAA;AAMP,IAAA,MAAA;AACA,IAAA,QAAA;AACA,IAAA,aAAA;IAPrB,WAAW,GAAG,KAAK;AAET,IAAA,WAAW,GAAG,IAAI,OAAO,EAAQ;AAE3C,IAAA,WAAA,CACqB,MAA4D,EAC5D,QAAgB,EAChB,aAAsB,EAAA;QAFtB,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,aAAa,GAAb,aAAa;IAC/B;AAEH,IAAA,IAAI,EAAE,GAAA;AACJ,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,GAAG,CAAA,CAAA,EAAI,IAAI,CAAC,aAAa,CAAA,CAAE,GAAG,EAAE;AACjE,QAAA,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAA,EAAG,MAAM,EAAE;IACpC;AAEA,IAAA,IAAI,UAAU,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C;IAEA,MAAM,GAAA;;AAEJ,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;AACpF,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAwB,EAAE,QAAQ,CAAC;;QAGjF,IAAI,CAAC,mBAAmB,EAAE;AAC1B,QAAA,IAAI,CAAC,WAAW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E,MAAM;AACnB,iBAAA;;;ACbD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndwnu/map",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/core": "^21.0.0",
|
|
6
|
-
"
|
|
6
|
+
"@angular/common": "^21.0.0",
|
|
7
|
+
"maplibre-gl": "^5.19.0",
|
|
7
8
|
"rxjs": "^7.8.0"
|
|
8
9
|
},
|
|
9
10
|
"sideEffects": false,
|
package/types/ndwnu-map.d.ts
CHANGED
|
@@ -1,142 +1,71 @@
|
|
|
1
1
|
import * as maplibre_gl from 'maplibre-gl';
|
|
2
|
-
import {
|
|
2
|
+
import { Point, LayerSpecification, FilterSpecification, MapMouseEvent, MapGeoJSONFeature, SourceSpecification, Map, BackgroundLayerSpecification, StyleSpecification, LngLatBoundsLike, LngLatLike, AnimationOptions, DataDrivenPropertyValueSpecification } from 'maplibre-gl';
|
|
3
3
|
import * as rxjs from 'rxjs';
|
|
4
4
|
import { Subject, Observable } from 'rxjs';
|
|
5
5
|
import { Feature, FeatureCollection } from 'geojson';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
7
|
import { AfterViewInit, OnDestroy, ElementRef } from '@angular/core';
|
|
8
|
+
import { HttpClient } from '@angular/common/http';
|
|
8
9
|
|
|
9
|
-
declare
|
|
10
|
-
declare const BOUNDS_AMERSFOORT: [LngLatLike, LngLatLike];
|
|
11
|
-
|
|
12
|
-
interface MapConfig {
|
|
13
|
-
/** Initial center position of the map */
|
|
14
|
-
center?: LngLatLike;
|
|
15
|
-
/** Initial zoom level */
|
|
16
|
-
zoom?: number;
|
|
17
|
-
/** Maximum zoom level */
|
|
18
|
-
maxZoom?: number;
|
|
19
|
-
/** Minimum zoom level */
|
|
20
|
-
minZoom?: number;
|
|
21
|
-
/** Initial bounds to fit the map to */
|
|
22
|
-
bounds?: LngLatBoundsLike;
|
|
23
|
-
/** Enable/disable all map interactions */
|
|
24
|
-
interactive?: boolean;
|
|
25
|
-
/** Enable/disable map rotation via drag */
|
|
26
|
-
dragRotate?: boolean;
|
|
27
|
-
/** Enable/disable double-click to zoom */
|
|
28
|
-
doubleClickZoom?: boolean;
|
|
29
|
-
/** Enable/disable scroll wheel zoom */
|
|
30
|
-
scrollZoom?: boolean;
|
|
31
|
-
/** Enable/disable shift+drag box zoom */
|
|
32
|
-
boxZoom?: boolean;
|
|
33
|
-
/** Enable/disable drag to pan */
|
|
34
|
-
dragPan?: boolean;
|
|
35
|
-
/** Enable/disable keyboard navigation */
|
|
36
|
-
keyboard?: boolean;
|
|
37
|
-
/** Enable/disable touch zoom and rotation on mobile */
|
|
38
|
-
touchZoomRotate?: boolean;
|
|
39
|
-
}
|
|
40
|
-
declare const DEFAULT_MAP_CONFIG: Required<Omit<MapConfig, 'bounds'>>;
|
|
41
|
-
declare const COMMON_BOUNDS: {
|
|
42
|
-
readonly NETHERLANDS: LngLatBoundsLike;
|
|
43
|
-
readonly AMERSFOORT: LngLatBoundsLike;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
declare abstract class MapLayer<TElementType> {
|
|
10
|
+
declare abstract class MapLayer<TElementType, TFilter = unknown, TLegendItem = unknown> {
|
|
47
11
|
#private;
|
|
48
|
-
protected readonly config: MapElementConfig<TElementType>;
|
|
12
|
+
protected readonly config: MapElementConfig<TElementType, TFilter, TLegendItem>;
|
|
49
13
|
protected readonly sourceId: string;
|
|
50
14
|
protected readonly layerIdSuffix?: string | undefined;
|
|
51
15
|
initialized: boolean;
|
|
52
16
|
protected unsubscribe: Subject<void>;
|
|
53
|
-
constructor(config: MapElementConfig<TElementType>, sourceId: string, layerIdSuffix?: string | undefined);
|
|
17
|
+
constructor(config: MapElementConfig<TElementType, TFilter, TLegendItem>, sourceId: string, layerIdSuffix?: string | undefined);
|
|
54
18
|
get id(): string;
|
|
55
19
|
get styleLayer(): maplibre_gl.StyleLayer | undefined;
|
|
56
20
|
onInit(): void;
|
|
57
21
|
onDestroy(): void;
|
|
58
22
|
setVisible(visible: boolean): void;
|
|
59
|
-
protected onClick?(features: Feature[]): void;
|
|
23
|
+
protected onClick?(point: Point, features: Feature[]): void;
|
|
60
24
|
protected abstract getSpecification(): Partial<LayerSpecification>;
|
|
61
|
-
getFilterSpecification?(): FilterSpecification;
|
|
25
|
+
getFilterSpecification?(filter?: TFilter): FilterSpecification;
|
|
62
26
|
}
|
|
63
27
|
type ClickEvent = MapMouseEvent & {
|
|
64
28
|
features?: MapGeoJSONFeature[];
|
|
65
29
|
} & object;
|
|
66
30
|
|
|
67
|
-
declare abstract class MapSource<TElementType> {
|
|
31
|
+
declare abstract class MapSource<TElementType, TFilter = unknown, TLegendItem = unknown> {
|
|
68
32
|
#private;
|
|
69
33
|
readonly id: string;
|
|
70
|
-
protected readonly config: MapElementConfig<TElementType>;
|
|
71
|
-
layers: MapLayer<TElementType>[];
|
|
34
|
+
protected readonly config: MapElementConfig<TElementType, TFilter, TLegendItem>;
|
|
35
|
+
layers: MapLayer<TElementType, TFilter, TLegendItem>[];
|
|
72
36
|
protected unsubscribe: Subject<void>;
|
|
73
|
-
|
|
37
|
+
protected activeFilter: TFilter | undefined;
|
|
38
|
+
constructor(id: string, config: MapElementConfig<TElementType, TFilter, TLegendItem>);
|
|
74
39
|
onInit(): void;
|
|
75
40
|
onDestroy(): void;
|
|
76
41
|
get featureCollection$(): Observable<FeatureCollection> | undefined;
|
|
77
42
|
set featureCollection$(value: Observable<FeatureCollection> | undefined);
|
|
78
43
|
get isInitialized(): boolean;
|
|
79
44
|
set isInitialized(value: boolean);
|
|
45
|
+
get filter$(): Observable<TFilter> | undefined;
|
|
46
|
+
set filter$(value: Observable<TFilter> | undefined);
|
|
80
47
|
setVisible(visible: boolean): void;
|
|
48
|
+
reload(): void;
|
|
81
49
|
protected abstract getSpecification(): Partial<SourceSpecification>;
|
|
50
|
+
protected getFilterSpecification?(filter: TFilter | undefined): FilterSpecification;
|
|
51
|
+
protected applyFilterToLayers(filterValue: TFilter | undefined): void;
|
|
82
52
|
}
|
|
83
53
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*
|
|
87
|
-
* Maplibre has no automatic cursor handling for layers, so when you add a clickHandler
|
|
88
|
-
* to a layer, the user can click on it, but the cursor will not change to a pointer.
|
|
89
|
-
* This service provides methods to set the cursor to pointer when hovering over a layer,
|
|
90
|
-
* and to enable crosshair mode which takes precedence over all other cursor types.
|
|
91
|
-
*/
|
|
92
|
-
declare class MaplibreCursorService {
|
|
93
|
-
#private;
|
|
94
|
-
/**
|
|
95
|
-
* Sets up mouse cursor handling for a map layer.
|
|
96
|
-
* Changes cursor to pointer when mouse enters the layer and resets when leaving.
|
|
97
|
-
*
|
|
98
|
-
* @param map - The MapLibre map instance
|
|
99
|
-
* @param layerId - ID of the layer to apply cursor behavior to
|
|
100
|
-
*/
|
|
101
|
-
setMouseCursor(map: Map, layerId: string): void;
|
|
102
|
-
/**
|
|
103
|
-
* Enables or disables crosshair cursor mode for the map.
|
|
104
|
-
* When enabled, crosshair cursor will take precedence over all other cursor types.
|
|
105
|
-
*
|
|
106
|
-
* @param value - True to enable crosshair mode, false to disable
|
|
107
|
-
* @param map - The MapLibre map instance to apply the cursor to
|
|
108
|
-
*/
|
|
109
|
-
/**
|
|
110
|
-
* Enables or disables crosshair cursor mode for the map.
|
|
111
|
-
* When enabled, crosshair cursor will take precedence over all other cursor types.
|
|
112
|
-
*
|
|
113
|
-
* @param value - True to enable crosshair mode, false to disable
|
|
114
|
-
* @param map - The MapLibre map instance to apply the cursor to
|
|
115
|
-
*/
|
|
116
|
-
setCrosshairMode(value: boolean, map: Map): void;
|
|
117
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MaplibreCursorService, never>;
|
|
118
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MaplibreCursorService>;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
interface MapElementConfig<TElementType> {
|
|
122
|
-
map: Map;
|
|
123
|
-
mapElementRepository: MapElementRepository<TElementType>;
|
|
124
|
-
maplibreCursorService: MaplibreCursorService;
|
|
125
|
-
elementId: TElementType;
|
|
126
|
-
elementOrder: number;
|
|
127
|
-
}
|
|
128
|
-
declare abstract class MapElement<TElementType> {
|
|
129
|
-
protected readonly config: MapElementConfig<TElementType>;
|
|
54
|
+
declare abstract class MapElement<TElementType, TFilter = unknown, TLegendItem = unknown> {
|
|
55
|
+
protected readonly config: MapElementConfig<TElementType, TFilter, TLegendItem>;
|
|
130
56
|
id: TElementType;
|
|
131
57
|
elementOrder: number;
|
|
132
|
-
sources: MapSource<TElementType>[];
|
|
58
|
+
sources: MapSource<TElementType, TFilter, TLegendItem>[];
|
|
133
59
|
alwaysVisible: boolean;
|
|
134
60
|
isVisible: boolean;
|
|
61
|
+
isInteractive: boolean;
|
|
135
62
|
protected unsubscribe: Subject<void>;
|
|
136
|
-
constructor(config: MapElementConfig<TElementType>);
|
|
63
|
+
constructor(config: MapElementConfig<TElementType, TFilter, TLegendItem>);
|
|
64
|
+
get legendItems(): TLegendItem[];
|
|
137
65
|
onInit(): void;
|
|
138
66
|
onDestroy(): void;
|
|
139
67
|
setVisible(visible: boolean): void;
|
|
68
|
+
reload(): void;
|
|
140
69
|
}
|
|
141
70
|
|
|
142
71
|
/**
|
|
@@ -145,14 +74,18 @@ declare abstract class MapElement<TElementType> {
|
|
|
145
74
|
* Also tracks element visibility state and provides observable streams for elements.
|
|
146
75
|
*
|
|
147
76
|
* @typeparam TElementType - The type of ID used for the map elements
|
|
77
|
+
* @typeparam TFilter - The type of filter used for the map elements
|
|
78
|
+
* @typeparam TLegendItem - The type of legend item used for the map elements
|
|
148
79
|
*/
|
|
149
|
-
declare abstract class MapElementRepository<TElementType> {
|
|
80
|
+
declare abstract class MapElementRepository<TElementType, TFilter = unknown, TLegendItem = unknown> {
|
|
150
81
|
/** Subject that holds the current array of map elements */
|
|
151
82
|
private readonly mapElementsSubject;
|
|
152
83
|
/** Observable stream of all map elements */
|
|
153
|
-
|
|
84
|
+
readonly mapElements$: rxjs.Observable<MapElement<TElementType, TFilter, TLegendItem>[]>;
|
|
154
85
|
/** Observable stream of only visible map elements */
|
|
155
|
-
|
|
86
|
+
readonly visibleMapElements$: rxjs.Observable<MapElement<TElementType, TFilter, TLegendItem>[]>;
|
|
87
|
+
/** Observable stream of legend items from all visible map elements */
|
|
88
|
+
readonly legendItems$: rxjs.Observable<TLegendItem[]>;
|
|
156
89
|
/**
|
|
157
90
|
* Gets the ids (TElementType) as an array of all map element
|
|
158
91
|
* @returns Array of TElementType
|
|
@@ -163,23 +96,28 @@ declare abstract class MapElementRepository<TElementType> {
|
|
|
163
96
|
* @returns Array of TElementType
|
|
164
97
|
*/
|
|
165
98
|
visibleMapElementIds$: rxjs.Observable<TElementType[]>;
|
|
99
|
+
/**
|
|
100
|
+
* Gets the ids (TElementType) as an array of all visible map element
|
|
101
|
+
* @returns Array of TElementType
|
|
102
|
+
*/
|
|
103
|
+
get visibleMapElementIds(): TElementType[];
|
|
166
104
|
/**
|
|
167
105
|
* Gets the current array of all map elements
|
|
168
106
|
* @returns Array of map elements
|
|
169
107
|
*/
|
|
170
|
-
get mapElements(): MapElement<TElementType>[];
|
|
108
|
+
get mapElements(): MapElement<TElementType, TFilter, TLegendItem>[];
|
|
171
109
|
/**
|
|
172
110
|
* Gets only the currently visible map elements
|
|
173
111
|
* @returns Array of visible map elements
|
|
174
112
|
*/
|
|
175
|
-
get visibleMapElements(): MapElement<TElementType>[];
|
|
113
|
+
get visibleMapElements(): MapElement<TElementType, TFilter, TLegendItem>[];
|
|
176
114
|
/**
|
|
177
115
|
* Finds a map element by its ID
|
|
178
116
|
*
|
|
179
117
|
* @param elementId - The ID of the element to find
|
|
180
118
|
* @returns The map element if found, undefined otherwise
|
|
181
119
|
*/
|
|
182
|
-
getMapElementById(elementId: TElementType): MapElement<TElementType> | undefined;
|
|
120
|
+
getMapElementById(elementId: TElementType): MapElement<TElementType, TFilter, TLegendItem> | undefined;
|
|
183
121
|
/**
|
|
184
122
|
* Checks if a map element is currently visible
|
|
185
123
|
*
|
|
@@ -193,13 +131,13 @@ declare abstract class MapElementRepository<TElementType> {
|
|
|
193
131
|
*
|
|
194
132
|
* @param mapElement - The map element to add
|
|
195
133
|
*/
|
|
196
|
-
addMapElement(mapElement: MapElement<TElementType>): void;
|
|
134
|
+
addMapElement(mapElement: MapElement<TElementType, TFilter, TLegendItem>): void;
|
|
197
135
|
/**
|
|
198
136
|
* Removes a map element from the repository and destroys it.
|
|
199
137
|
*
|
|
200
138
|
* @param mapElement - The map element to remove
|
|
201
139
|
*/
|
|
202
|
-
removeMapElement(mapElement: MapElement<TElementType>): void;
|
|
140
|
+
removeMapElement(mapElement: MapElement<TElementType, TFilter, TLegendItem>): void;
|
|
203
141
|
/**
|
|
204
142
|
* Removes all map elements from the repository and destroys them.
|
|
205
143
|
*/
|
|
@@ -223,6 +161,12 @@ declare abstract class MapElementRepository<TElementType> {
|
|
|
223
161
|
* @param elementId - The ID of the element to hide
|
|
224
162
|
*/
|
|
225
163
|
hideMapElement(elementId: TElementType): void;
|
|
164
|
+
/**
|
|
165
|
+
* Triggers a reload of the tiles in the sources of the map element with the given ID
|
|
166
|
+
*
|
|
167
|
+
* @param elementId - The ID of the element to reload
|
|
168
|
+
*/
|
|
169
|
+
reloadMapElement(elementId: TElementType): void;
|
|
226
170
|
/**
|
|
227
171
|
* Toggles the visibility of a map element by its ID.
|
|
228
172
|
* If the element is currently visible, it will be hidden, and vice versa.
|
|
@@ -240,6 +184,113 @@ declare abstract class MapElementRepository<TElementType> {
|
|
|
240
184
|
getBeforeId(elementId: TElementType): string | undefined;
|
|
241
185
|
}
|
|
242
186
|
|
|
187
|
+
/**
|
|
188
|
+
* Service for managing MapLibre map cursor interactions.
|
|
189
|
+
*
|
|
190
|
+
* Maplibre has no automatic cursor handling for layers, so when you add a clickHandler
|
|
191
|
+
* to a layer, the user can click on it, but the cursor will not change to a pointer.
|
|
192
|
+
* This service provides methods to set the cursor to pointer when hovering over a layer,
|
|
193
|
+
* and to enable crosshair mode which takes precedence over all other cursor types.
|
|
194
|
+
*/
|
|
195
|
+
declare class MaplibreCursorService {
|
|
196
|
+
#private;
|
|
197
|
+
/**
|
|
198
|
+
* Sets up mouse cursor handling for a map layer.
|
|
199
|
+
* Changes cursor to pointer when mouse enters the layer and resets when leaving.
|
|
200
|
+
*
|
|
201
|
+
* @param map - The MapLibre map instance
|
|
202
|
+
* @param layerId - ID of the layer to apply cursor behavior to
|
|
203
|
+
*/
|
|
204
|
+
setMouseCursor(map: Map, layerId: string): void;
|
|
205
|
+
/**
|
|
206
|
+
* Enables or disables crosshair cursor mode for the map.
|
|
207
|
+
* When enabled, crosshair cursor will take precedence over all other cursor types.
|
|
208
|
+
*
|
|
209
|
+
* @param value - True to enable crosshair mode, false to disable
|
|
210
|
+
* @param map - The MapLibre map instance to apply the cursor to
|
|
211
|
+
*/
|
|
212
|
+
setCrosshairMode(value: boolean, map: Map): void;
|
|
213
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaplibreCursorService, never>;
|
|
214
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MaplibreCursorService>;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
interface MapElementConfig<TElementType, TFilter = unknown, TLegendItem = unknown> {
|
|
218
|
+
map: Map;
|
|
219
|
+
mapElementRepository: MapElementRepository<TElementType, TFilter, TLegendItem>;
|
|
220
|
+
maplibreCursorService: MaplibreCursorService;
|
|
221
|
+
elementId: TElementType;
|
|
222
|
+
elementOrder: number;
|
|
223
|
+
isInteractive?: boolean;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
declare class ApiLayer<TElementType, TFilter = unknown, TLegendItem = unknown> extends MapLayer<TElementType, TFilter, TLegendItem> {
|
|
227
|
+
private readonly _layerSpecification;
|
|
228
|
+
constructor(config: MapElementConfig<TElementType, TFilter, TLegendItem>, _layerSpecification: LayerSpecification);
|
|
229
|
+
get id(): string;
|
|
230
|
+
protected getSpecification(): Partial<LayerSpecification>;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
declare class ApiBackgroundLayer<TElementType, TFilter = unknown, TLegendItem = unknown> extends ApiLayer<TElementType, TFilter, TLegendItem> {
|
|
234
|
+
constructor(config: MapElementConfig<TElementType, TFilter, TLegendItem>, layerSpecification: BackgroundLayerSpecification);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
type LayerFilterFunction = (layer: LayerSpecification) => boolean;
|
|
238
|
+
declare class ApiSource<TElementType, TFilter = unknown, TLegendItem = unknown> extends MapSource<TElementType, TFilter, TLegendItem> {
|
|
239
|
+
private readonly _styleSpecification;
|
|
240
|
+
private readonly _layerFilter?;
|
|
241
|
+
constructor(id: string, config: MapElementConfig<TElementType, TFilter, TLegendItem>, _styleSpecification: StyleSpecification, _layerFilter?: LayerFilterFunction | undefined);
|
|
242
|
+
protected getSpecification(): Partial<SourceSpecification>;
|
|
243
|
+
/**
|
|
244
|
+
* Creates ApiLayer instances for this source without initializing them.
|
|
245
|
+
*/
|
|
246
|
+
createLayers(layers: LayerSpecification[]): void;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
declare class ApiElement<TElementType, TFilter = unknown, TLegendItem = unknown> extends MapElement<TElementType, TFilter, TLegendItem> {
|
|
250
|
+
#private;
|
|
251
|
+
private readonly _http;
|
|
252
|
+
private readonly _mapStyleUrl;
|
|
253
|
+
private readonly _layerFilter?;
|
|
254
|
+
backgroundLayers: ApiBackgroundLayer<TElementType, TFilter, TLegendItem>[];
|
|
255
|
+
constructor(config: MapElementConfig<TElementType, TFilter, TLegendItem>, _http: HttpClient, _mapStyleUrl: string, _layerFilter?: LayerFilterFunction | undefined);
|
|
256
|
+
onInit(): void;
|
|
257
|
+
setVisible(visible: boolean): void;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface MapConfig {
|
|
261
|
+
/** Initial center position of the map */
|
|
262
|
+
center?: LngLatLike;
|
|
263
|
+
/** Initial zoom level */
|
|
264
|
+
zoom?: number;
|
|
265
|
+
/** Maximum zoom level */
|
|
266
|
+
maxZoom?: number;
|
|
267
|
+
/** Minimum zoom level */
|
|
268
|
+
minZoom?: number;
|
|
269
|
+
/** Initial bounds to fit the map to */
|
|
270
|
+
bounds?: LngLatBoundsLike;
|
|
271
|
+
/** Enable/disable all map interactions */
|
|
272
|
+
interactive?: boolean;
|
|
273
|
+
/** Enable/disable map rotation via drag */
|
|
274
|
+
dragRotate?: boolean;
|
|
275
|
+
/** Enable/disable double-click to zoom */
|
|
276
|
+
doubleClickZoom?: boolean;
|
|
277
|
+
/** Enable/disable scroll wheel zoom */
|
|
278
|
+
scrollZoom?: boolean;
|
|
279
|
+
/** Enable/disable shift+drag box zoom */
|
|
280
|
+
boxZoom?: boolean;
|
|
281
|
+
/** Enable/disable drag to pan */
|
|
282
|
+
dragPan?: boolean;
|
|
283
|
+
/** Enable/disable keyboard navigation */
|
|
284
|
+
keyboard?: boolean;
|
|
285
|
+
/** Enable/disable touch zoom and rotation on mobile */
|
|
286
|
+
touchZoomRotate?: boolean;
|
|
287
|
+
}
|
|
288
|
+
declare const DEFAULT_MAP_CONFIG: Required<Omit<MapConfig, 'bounds'>>;
|
|
289
|
+
declare const COMMON_BOUNDS: {
|
|
290
|
+
readonly NETHERLANDS: LngLatBoundsLike;
|
|
291
|
+
readonly AMERSFOORT: LngLatBoundsLike;
|
|
292
|
+
};
|
|
293
|
+
|
|
243
294
|
declare abstract class MapComponent implements AfterViewInit, OnDestroy {
|
|
244
295
|
#private;
|
|
245
296
|
mapContainer: i0.Signal<ElementRef<any>>;
|
|
@@ -256,5 +307,16 @@ declare abstract class MapComponent implements AfterViewInit, OnDestroy {
|
|
|
256
307
|
static ɵcmp: i0.ɵɵComponentDeclaration<MapComponent, "ng-component", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
257
308
|
}
|
|
258
309
|
|
|
259
|
-
|
|
260
|
-
|
|
310
|
+
declare const BOUNDS_NL: [LngLatLike, LngLatLike];
|
|
311
|
+
declare const BOUNDS_AMERSFOORT: [LngLatLike, LngLatLike];
|
|
312
|
+
declare const lineWidthFrcSpecification: DataDrivenPropertyValueSpecification<number>;
|
|
313
|
+
type NdwLayerSpecification = LayerSpecification & {
|
|
314
|
+
metadata: {
|
|
315
|
+
group: string;
|
|
316
|
+
subGroup: string;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
type NdwLayerFilterFunction = (layer: NdwLayerSpecification) => boolean;
|
|
320
|
+
|
|
321
|
+
export { ApiBackgroundLayer, ApiElement, ApiLayer, ApiSource, BOUNDS_AMERSFOORT, BOUNDS_NL, COMMON_BOUNDS, DEFAULT_MAP_CONFIG, MapComponent, MapElement, MapElementRepository, MapLayer, MapSource, MaplibreCursorService, lineWidthFrcSpecification };
|
|
322
|
+
export type { ClickEvent, LayerFilterFunction, MapConfig, MapElementConfig, NdwLayerFilterFunction, NdwLayerSpecification };
|