@ndwnu/map 1.0.1 → 2.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.map +1 -1
- package/package.json +1 -1
- package/src/lib/style/style.json +3170 -0
- package/types/ndwnu-map.d.ts +8 -5
|
@@ -1 +1 @@
|
|
|
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} 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?(event: ClickEvent): void;\n\n protected abstract getSpecification(): Partial<LayerSpecification>;\n getFilterSpecification?(filter?: TFilter): FilterSpecification;\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 #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);\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);\n });\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 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":";;;;;MAUsB,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,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;;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} 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?(event: ClickEvent): void;\n\n protected abstract getSpecification(): Partial<LayerSpecification>;\n getFilterSpecification?(filter?: TFilter): FilterSpecification;\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 #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);\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);\n });\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 LayerGroup =\n | 'context-map'\n | 'context-aerial'\n | 'context-roads'\n | 'context-admin'\n | 'context-labels'\n | 'relevant-roads'\n | 'relevant-admin';\n\nexport type LayerSubGroup =\n | 'administrative-division'\n | 'background-blue'\n | 'background-green'\n | 'background-grey'\n | 'background-yellow'\n | 'bgt-housenumbers'\n | 'brt-place-names'\n | 'fcd-segments'\n | 'ndw-nwb-road-sections'\n | 'nwb-hectometersigns'\n | 'nwb-oneway-signs'\n | 'nwb-road-names'\n | 'railway'\n | 'wkd-parking-areas';\n\nexport interface LayerMetadata {\n group: LayerGroup;\n 'sub-group'?: LayerSubGroup;\n}\n\nexport type NdwLayerSpecification = LayerSpecification & {\n metadata: LayerMetadata;\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 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":";;;;;MAUsB,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,IAA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