@apexara/map 1.3.0 → 1.4.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/README.md CHANGED
@@ -6,10 +6,13 @@ A thin, opinionated Angular wrapper around [Mapbox GL JS](https://docs.mapbox.co
6
6
  - **Mapbox GL**: 3.x
7
7
  - **SSR-safe**: every browser-only call no-ops on the server.
8
8
 
9
- ## Changes since v1.2.0
9
+ ## Changes since v1.3.0
10
10
 
11
- None to the package's code: 1.3.0 ships the same code as 1.2.0, the first version released with `npm run deploy`
12
- (RELEASING.md).
11
+ - **`fitBounds` padding frames that fit only.** Mapbox kept a fit's padding as the map's own, so every later
12
+ `getBounds()`, `getViewportPolygon()` and `bounds` covered the box inside it (40 px short on every side after a default
13
+ fit) through every pan and zoom. Fits now pass `retainPadding: false`, and the map's padding stays as it was; pass
14
+ `retainPadding: true` for the old behaviour. The fit looks the same on screen. A mapbox-gl without the option (3.13
15
+ has it) ignores it.
13
16
 
14
17
  Four entry points, so a page loads only what it uses:
15
18
 
@@ -257,7 +260,8 @@ async addMyLayers(): Promise<void> {
257
260
  - `moveCenter([lng, lat], zoom = 13)` — animated `flyTo`.
258
261
  - `fitBounds(bounds, options?, eventData?)` — animated `fitBounds`. A number is the padding (default 40) of a one-second
259
262
  slide, as in 1.0. An options object (`padding` as a number or per side, `maxZoom`, `duration`, `animate: false`, …)
260
- lays over those same defaults.
263
+ lays over those same defaults. The padding frames that fit only: the map's own padding, which `getBounds()` and
264
+ `getViewportPolygon()` measure inside, stays as it was unless the options say `retainPadding: true`.
261
265
  - `flyTo(options, eventData?)`, `easeTo(options, eventData?)`, `jumpTo(options, eventData?)` — mapbox's camera calls
262
266
  with every option (`duration`, `curve`, `offset`, …).
263
267
  - `resize(eventData?)` — have mapbox re-read its container's size, e.g. from a `ResizeObserver`. The resize fires
@@ -59,8 +59,9 @@ class MapboxService {
59
59
  this.activeContainer = this._activeContainer;
60
60
  // Whether this browser can run mapbox; null until asked. Kept, since mapbox's check builds a worker and a canvas.
61
61
  this.supported = null;
62
- // What `fitBounds` has always done: 40 px all round, a one-second slide.
63
- this.fitDefaults = { padding: 40, duration: 1000 };
62
+ // What `fitBounds` has always done: 40 px all round, a one-second slide. The padding frames that one fit: kept as the
63
+ // map's own, it would shrink every later getBounds / getViewportPolygon / `bounds` to the inset box.
64
+ this.fitDefaults = { padding: 40, duration: 1000, retainPadding: false };
64
65
  }
65
66
  /** Back-compat wrapper around `activate`. SSR-safe. */
66
67
  async init(options) {
@@ -362,6 +363,7 @@ class MapboxService {
362
363
  /**
363
364
  * Fit the viewport to `bounds`. A number is the padding (default 40) of a one-second slide; options (`padding` per
364
365
  * side, `maxZoom`, `duration`, `animate: false`, …) lay over those same defaults. `eventData` reaches the move's events.
366
+ * The padding frames this fit only and the map's own padding stays as it was; `retainPadding: true` keeps it instead.
365
367
  */
366
368
  fitBounds(bounds, options = {}, eventData) {
367
369
  const overrides = typeof options === 'number' ? { padding: options } : options;
@@ -1 +1 @@
1
- {"version":3,"file":"apexara-map.mjs","sources":["../../../../projects/apexara/map/src/lib/mapbox.service.ts","../../../../projects/apexara/map/src/lib/apex-map/apex-map.component.ts","../../../../projects/apexara/map/src/lib/apex-map/apex-map.component.html","../../../../projects/apexara/map/src/lib/apex-map-pinch-zoom.directive.ts","../../../../projects/apexara/map/src/lib/map-user-location.layer.ts","../../../../projects/apexara/map/src/lib/map.utils.ts","../../../../projects/apexara/map/apexara-map.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Injectable, PLATFORM_ID, Signal, WritableSignal, inject, signal } from '@angular/core';\n\nimport { Subject } from 'rxjs';\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport mapboxgl, { CameraOptions, EasingOptions, LayerSpecification, PaddingOptions } from 'mapbox-gl';\n\nimport { MAP_CONFIG, MapStyles } from '@apexara/map/config';\n\nimport type * as GeoJSON from 'geojson';\nimport type { Position } from 'geojson';\n\nimport {\n MapDrawOptions,\n MapEventData,\n MapFeatureQuery,\n MapFitOptions,\n MapImageOptions,\n MapImageSource,\n MapInitOptions,\n MapInsets,\n MapQueryGeometry,\n MapStyleOptions,\n SourceConfig,\n} from './map.types';\n\n/**\n * Mapbox Service — wrapper around a `mapboxgl.Map` instance.\n *\n * Terms:\n * - Feature: A GeoJSON geometry (Point/LineString/Polygon/…) drawn on the map.\n * - Properties: Arbitrary key-value pairs on `feature.properties`.\n * - Source: Raw data (GeoJSON, vector tiles, raster tiles) added with `addSource`.\n * - Layer: A visual rendering (circle, fill, heatmap, raster, …) bound to a source.\n * - Cluster: A grouped feature emitted when `cluster: true` is set on a GeoJSON source.\n *\n * Browser-only: `init()` is a no-op on the server. Methods other than `init()` assume\n * the map instance exists and must only be called after `ready()` becomes true.\n */\n\n// Process-lifetime cache of parsed Mapbox style JSON keyed by URL. Subsequent\n// inits with the same URL pass the cached object to the Map constructor\n// instead of re-fetching `api.mapbox.com/styles/v1/...`.\nconst styleCache = new Map<string, mapboxgl.StyleSpecification>();\n\n@Injectable({ providedIn: 'root' })\nexport class MapboxService {\n\n /** Click on empty canvas (no features under the cursor). Event stream. */\n public mapClick = new Subject<mapboxgl.MapMouseEvent>();\n\n /** Click on a feature (wired by consumers via `on('click', layerId, ...)`). Event stream. */\n public featureClick = new Subject<mapboxgl.MapMouseEvent>();\n\n /** Fires when the user completes a polygon in draw mode (double-click or first-vertex click). */\n public polygonCreate = new Subject<GeoJSON.Feature<GeoJSON.Polygon>>();\n\n private readonly _ready = signal<boolean>(false);\n\n /** Reactive state: `true` once the map's `load` event has fired. */\n public readonly ready: Signal<boolean> = this._ready;\n\n /** Reactive state: current center `[lng, lat]`. Updates on `moveend`. `null` before init. */\n public readonly center = signal<[number, number] | null>(null);\n\n /** Reactive state: current zoom level. Updates on `moveend`. `null` before init. */\n public readonly zoom = signal<number | null>(null);\n\n /** Reactive state: current viewport bounds `[[swLng, swLat], [neLng, neLat]]`. Updates on `moveend`. */\n public readonly bounds = signal<[[number, number], [number, number]] | null>(null);\n\n /** Reactive state: `true` while the map is panning/zooming (between `movestart` and `moveend`). */\n public readonly isMoving = signal<boolean>(false);\n\n private map!: mapboxgl.Map;\n // `map` stays non-null-typed so existing call-sites don't need guards;\n // this flag tracks whether the constructor has actually run.\n private mapInitialised = false;\n private draw?: MapboxDraw;\n private readonly config = inject(MAP_CONFIG);\n private readonly platformId = inject(PLATFORM_ID);\n\n private onDrawCreate?: (e: { features: GeoJSON.Feature[] }) => void;\n private savedInteractions?: Record<'dragPan' | 'scrollZoom' | 'boxZoom' | 'doubleClickZoom' | 'touchZoomRotate' | 'keyboard', boolean>;\n\n // mapbox-gl is given this stable element (not the consumer's `<div>`).\n // The service re-parents `hostDiv` between consumer containers on context\n // swaps so the underlying `mapboxgl.Map` survives → one billed load per session.\n private hostDiv: HTMLDivElement | null = null;\n\n private containerStack: HTMLElement[] = [];\n\n private readonly _activeContainer: WritableSignal<HTMLElement | null> = signal(null);\n public readonly activeContainer: Signal<HTMLElement | null> = this._activeContainer;\n\n // Whether this browser can run mapbox; null until asked. Kept, since mapbox's check builds a worker and a canvas.\n private supported: boolean | null = null;\n\n // What `fitBounds` has always done: 40 px all round, a one-second slide.\n private readonly fitDefaults: MapFitOptions = { padding: 40, duration: 1000 };\n\n /** Back-compat wrapper around `activate`. SSR-safe. */\n public async init(options: MapInitOptions): Promise<void> {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n this.activate(options.container, options);\n }\n\n /** Whether this browser can run mapbox (WebGL2, workers, canvas reads). Asked once; false on the server. */\n public isSupported(): boolean {\n this.supported ??= isPlatformBrowser(this.platformId) && mapboxgl.supported();\n\n return this.supported;\n }\n\n /**\n * Puts the shared map on `container`. False when it did not start there: on the server, in a browser that cannot run\n * mapbox, or when the first start throws (undone and reported). A running map's errors still throw.\n */\n public activate(container: HTMLElement, options: MapInitOptions): boolean {\n if (!this.isSupported()) {\n return false;\n }\n\n if (!this.mapInitialised) {\n return this.startMap(container, options);\n }\n\n const active = this._activeContainer();\n\n if (active === container) {\n if (options.center) {\n this.map.jumpTo({ center: options.center, zoom: options.zoom ?? this.map.getZoom() });\n }\n requestAnimationFrame(() => this.map.resize());\n\n return true;\n }\n\n this.hostDiv?.remove();\n if (this.hostDiv) {\n this.hostDiv.style.display = '';\n container.appendChild(this.hostDiv);\n }\n\n this.containerStack = this.containerStack.filter((c) => c !== container);\n this.containerStack.push(container);\n this._activeContainer.set(container);\n\n if (options.center) {\n this.map.jumpTo({ center: options.center, zoom: options.zoom ?? this.map.getZoom() });\n }\n requestAnimationFrame(() => this.map.resize());\n\n return true;\n }\n\n public deactivate(container: HTMLElement): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const wasActive = this._activeContainer() === container;\n this.containerStack = this.containerStack.filter((c) => c !== container);\n\n if (!wasActive) {\n return;\n }\n\n const next = this.containerStack[this.containerStack.length - 1];\n\n this.hostDiv?.remove();\n\n if (next && this.hostDiv) {\n this.hostDiv.style.display = '';\n next.appendChild(this.hostDiv);\n this._activeContainer.set(next);\n requestAnimationFrame(() => this.map.resize());\n return;\n }\n\n if (this.hostDiv) {\n document.body.appendChild(this.hostDiv);\n this.hostDiv.style.display = 'none';\n }\n this._activeContainer.set(null);\n }\n\n // The first start. It can pass isSupported and still throw (e.g. at the browser's limit of WebGL contexts) after its\n // host div went into the container: the div comes back out, so the container is left as it was.\n private startMap(container: HTMLElement, options: MapInitOptions): boolean {\n try {\n this.createMap(container, options);\n } catch (error) {\n this.hostDiv?.remove();\n this.hostDiv = null;\n console.error('[@apexara/map] The map failed to start.', error);\n\n return false;\n }\n\n this.containerStack.push(container);\n this._activeContainer.set(container);\n\n return true;\n }\n\n private createMap(container: HTMLElement, options: MapInitOptions): void {\n const defaultBounds: mapboxgl.LngLatBoundsLike = [\n [-175, -85],\n [175, 85],\n ];\n\n const styleInput = options.mapStyle || this.config.defaultStyle || MapStyles.Streets;\n const styleUrl = typeof styleInput === 'string' ? styleInput : null;\n const cachedStyle = styleUrl ? styleCache.get(styleUrl) : undefined;\n\n this.hostDiv = document.createElement('div');\n this.hostDiv.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;';\n container.appendChild(this.hostDiv);\n\n this.map = new mapboxgl.Map({\n center: options.center,\n zoom: options.zoom || 10,\n accessToken: this.config.accessToken,\n container: this.hostDiv,\n style: (cachedStyle ?? styleInput) as string,\n fadeDuration: 0,\n pitch: 0,\n bearing: 0,\n dragRotate: false,\n pitchWithRotate: false,\n projection: 'mercator',\n maxBounds: options.maxBounds ?? defaultBounds,\n renderWorldCopies: false,\n // Required for `canvas.toDataURL()` to return pixels — consumers that\n // snapshot the canvas (e.g. freeze-frame overlays) rely on this.\n preserveDrawingBuffer: true,\n });\n this.mapInitialised = true;\n\n if (styleUrl && !cachedStyle) {\n this.map.once('style.load', () => {\n styleCache.set(styleUrl, this.map.getStyle() as mapboxgl.StyleSpecification);\n });\n }\n\n this.center.set(options.center);\n this.zoom.set(options.zoom ?? 10);\n\n this.map.on('movestart', () => this.isMoving.set(true));\n\n this.map.on('moveend', () => {\n const c = this.map.getCenter();\n const b = this.map.getBounds() as mapboxgl.LngLatBounds;\n const sw = b.getSouthWest();\n const ne = b.getNorthEast();\n\n this.center.set([c.lng, c.lat]);\n this.zoom.set(this.map.getZoom());\n this.bounds.set([[sw.lng, sw.lat], [ne.lng, ne.lat]]);\n this.isMoving.set(false);\n });\n\n this.map.once('load', () => {\n if (options.showNavigation !== false) {\n this.map.addControl(\n new mapboxgl.NavigationControl({ showCompass: false, showZoom: true }),\n );\n }\n\n this._ready.set(true);\n });\n }\n\n /** Current map center as a `LngLat`. Prefer the `center` signal for reactive reads. */\n public getCenter(): mapboxgl.LngLat {\n return this.map.getCenter();\n }\n\n /** Current zoom level. Prefer the `zoom` signal for reactive reads. */\n public getZoom(): number {\n return this.map.getZoom();\n }\n\n /** The live `mapboxgl.Map`, for mapbox APIs this service does not wrap. `undefined` until the first `init`/`activate`. */\n public getMap(): mapboxgl.Map | undefined {\n return this.mapInitialised ? this.map : undefined;\n }\n\n /**\n * Resolves once the style is parsed, so sources and layers can be added: after a re-parent `ready()` (a one-time\n * latch) says nothing about that. Resolves at once with no map; pass `destroyRef` to resolve on teardown, not hang.\n */\n public whenStyleReady(destroyRef?: DestroyRef): Promise<void> {\n if (!this.mapInitialised || this.isStyleParsed()) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n let removeDestroyHook: (() => void) | undefined;\n\n const done = (): void => {\n this.map.off('style.load', done);\n this.map.off('idle', done);\n removeDestroyHook?.();\n resolve();\n };\n\n // `idle` always fires once the map settles, so a `style.load` that already fired cannot hang the wait.\n this.map.once('style.load', done);\n this.map.once('idle', done);\n removeDestroyHook = destroyRef?.onDestroy(done);\n });\n }\n\n /**\n * Return the current viewport as a closed GeoJSON-style polygon ring\n * (`[sw, se, ne, nw, sw]`). Useful for point-in-polygon queries against the\n * visible area.\n */\n public getViewportPolygon(): Position[][] {\n const bounds = this.map.getBounds() as mapboxgl.LngLatBounds;\n\n const sw = bounds.getSouthWest();\n const se = bounds.getSouthEast();\n const ne = bounds.getNorthEast();\n const nw = bounds.getNorthWest();\n\n return [\n [\n [sw.lng, sw.lat],\n [se.lng, se.lat],\n [ne.lng, ne.lat],\n [nw.lng, nw.lat],\n [sw.lng, sw.lat],\n ],\n ];\n }\n\n /**\n * Extract `properties` from the first feature under a click/hover event,\n * cast to `T`. Returns `undefined` when no feature was hit or it has no props.\n */\n public getFeatureProperties<T>(mouseEvent: mapboxgl.MapMouseEvent): T | undefined {\n const feature = mouseEvent.features?.[0];\n\n if (!feature) {\n return undefined;\n }\n\n const properties = feature.properties;\n\n if (!properties) {\n return undefined;\n }\n\n return properties as T;\n }\n\n /**\n * Expand a cluster into its individual leaf features (up to `limit`, paginated\n * via `offset`). Rejects if `sourceId` is missing or not a clustered GeoJSON source.\n */\n public async getClusterProperties(\n sourceId: string,\n clusterId: number,\n limit = 10000,\n offset = 0,\n ): Promise<mapboxgl.GeoJSONFeature[]> {\n return new Promise((resolve, reject) => {\n const src = this.clusterSourceOf(sourceId);\n\n if (!src) {\n reject(this.notClusteredError(sourceId));\n\n return;\n }\n\n src.getClusterLeaves(clusterId, limit, offset, (err, features) => {\n if (err) {\n reject(err);\n } else {\n resolve(features as mapboxgl.GeoJSONFeature[]);\n }\n });\n });\n }\n\n /**\n * The zoom at which a cluster splits into its children, e.g. to `easeTo` it. Rejects as `getClusterProperties` does,\n * and when mapbox answers with no zoom.\n */\n public getClusterExpansionZoom(sourceId: string, clusterId: number): Promise<number> {\n return new Promise((resolve, reject) => {\n const source = this.clusterSourceOf(sourceId);\n\n if (!source) {\n reject(this.notClusteredError(sourceId));\n\n return;\n }\n\n source.getClusterExpansionZoom(clusterId, (error, expansionZoom) => {\n if (error) {\n reject(error);\n } else if (typeof expansionZoom !== 'number') {\n reject(new Error(`Cluster ${clusterId} in source '${sourceId}' gave no expansion zoom.`));\n } else {\n resolve(expansionZoom);\n }\n });\n });\n }\n\n /**\n * Features rendered at a screen point or in a `[corner, corner]` box (the whole viewport when `geometry` is\n * undefined), kept to `layers` and `filter`. Returns `[]` when the map has not been initialised yet.\n */\n public getRenderedFeatures(geometry?: MapQueryGeometry, query?: MapFeatureQuery): mapboxgl.GeoJSONFeature[] {\n return this.map ? this.map.queryRenderedFeatures(geometry as MapQueryGeometry, query) : [];\n }\n\n /** Whether `lngLat` projects inside the canvas, `insets` pixels in from its edges. False before the map exists. */\n public isPointOnScreen(lngLat: mapboxgl.LngLatLike, insets: MapInsets = 0): boolean {\n if (!this.mapInitialised) {\n return false;\n }\n\n const point = this.map.project(lngLat);\n const canvas = this.map.getCanvas();\n\n return point.x >= this.insetOf(insets, 'left')\n && point.y >= this.insetOf(insets, 'top')\n && point.x <= canvas.clientWidth - this.insetOf(insets, 'right')\n && point.y <= canvas.clientHeight - this.insetOf(insets, 'bottom');\n }\n\n /** Whether the shared map is on screen inside `element`: its active container is `element` or below it. */\n public isShownIn(element: Node): boolean {\n const active = this._activeContainer();\n\n return active !== null && element.contains(active);\n }\n\n /**\n * Swap the base style. `{ diff: false }` rebuilds it from scratch, for a swap where mapbox's diff keeps a source the\n * rebuild then trips over. Custom sources/layers you added must be re-applied after `styledata`.\n */\n public setStyle(styleUrl: string, options?: MapStyleOptions): void {\n const cachedStyle = styleCache.get(styleUrl);\n\n // The typings mark mapbox's optional font options as required.\n this.map.setStyle((cachedStyle ?? styleUrl) as string, options as Parameters<mapboxgl.Map['setStyle']>[1]);\n\n if (!cachedStyle) {\n this.map.once('style.load', () => {\n styleCache.set(styleUrl, this.map.getStyle() as mapboxgl.StyleSpecification);\n });\n }\n }\n\n /** Animate the camera to `center` at the given zoom (default 13). `flyTo` takes a duration, a curve and event data. */\n public moveCenter(center: [number, number], zoom = 13): void {\n this.map.flyTo({ center, zoom });\n }\n\n /**\n * Fit the viewport to `bounds`. A number is the padding (default 40) of a one-second slide; options (`padding` per\n * side, `maxZoom`, `duration`, `animate: false`, …) lay over those same defaults. `eventData` reaches the move's events.\n */\n public fitBounds(bounds: mapboxgl.LngLatBoundsLike, options: number | MapFitOptions = {}, eventData?: MapEventData): void {\n const overrides = typeof options === 'number' ? { padding: options } : options;\n\n this.map.fitBounds(bounds, { ...this.fitDefaults, ...overrides }, eventData);\n }\n\n /** Fly the camera (mapbox's `flyTo`: `center`, `zoom`, `duration`, `curve`, `offset`, …). */\n public flyTo(options: EasingOptions, eventData?: MapEventData): void {\n this.map.flyTo(options, eventData);\n }\n\n /** Ease the camera (mapbox's `easeTo`), e.g. into a cluster's expansion zoom. */\n public easeTo(options: EasingOptions, eventData?: MapEventData): void {\n this.map.easeTo(options, eventData);\n }\n\n /** Move the camera at once (mapbox's `jumpTo`). */\n public jumpTo(options: CameraOptions, eventData?: MapEventData): void {\n this.map.jumpTo(options, eventData);\n }\n\n /**\n * Have mapbox re-read its container's size, e.g. from a `ResizeObserver`. A resize fires `movestart` / `moveend`, which\n * carry `eventData`. No-op before the map exists.\n */\n public resize(eventData?: MapEventData): void {\n if (this.mapInitialised) {\n this.map.resize(eventData);\n }\n }\n\n /**\n * Add a GeoJSON source. Pass `clustered: true` and optional `clusterRadius`/`clusterMaxZoom`\n * for point clustering. Set `generateId: true` when you plan to use feature-state.\n */\n public addSource(config: SourceConfig): void {\n const src: mapboxgl.GeoJSONSourceSpecification = {\n type: 'geojson',\n data: config.data,\n };\n\n if (config.clustered !== undefined) {\n src.cluster = config.clustered;\n }\n\n if (config.clusterRadius !== undefined) {\n src.clusterRadius = config.clusterRadius;\n }\n\n if (config.clusterMaxZoom !== undefined) {\n src.clusterMaxZoom = config.clusterMaxZoom;\n }\n\n if (config.generateId !== undefined) {\n src.generateId = config.generateId;\n }\n\n this.map.addSource(config.id, src);\n }\n\n /**\n * Add a GeoJSON source, or replace the data of the one already under `config.id` (its other options stay as they\n * were). True when it was added, so the caller adds the layers that draw it.\n */\n public upsertSource(config: SourceConfig): boolean {\n if (this.hasSource(config.id)) {\n this.updateSource(config.id, config.data);\n\n return false;\n }\n\n this.addSource(config);\n\n return true;\n }\n\n /** Replace the data of an existing GeoJSON source in place. No-op if the source is missing. */\n public updateSource(id: string, data: string | GeoJSON.GeoJSON): void {\n const source = this.map.getSource(id);\n\n if (source && 'setData' in source) {\n (source as mapboxgl.GeoJSONSource).setData(data);\n }\n }\n\n /**\n * Add a layer to the style. Pass `beforeId` to insert the new layer beneath\n * an existing one (useful for controlling draw order against style layers).\n */\n public addLayer(layer: LayerSpecification, beforeId?: string): void {\n if (beforeId) {\n this.map.addLayer(layer, beforeId);\n } else {\n this.map.addLayer(layer);\n }\n }\n\n /**\n * Add a raster layer backed by a source with the same id. Starts hidden —\n * toggle with `toggleLayerVisibility(id)` or `setLayoutProperty`.\n */\n public addRasterLayer(id: string, _url: string): void {\n this.map.addLayer({\n id,\n type: 'raster',\n source: id,\n layout: { visibility: 'none' },\n });\n }\n\n /** Add a vector tile source from a TileJSON URL (typically `mapbox://...`). */\n public addVectorSource(id: string, url: string): void {\n this.map.addSource(id, {\n type: 'vector',\n url,\n } as mapboxgl.VectorSourceSpecification);\n }\n\n /**\n * Add a heatmap layer bound to an existing source. `maxzoom` controls the\n * zoom at which the heatmap fades out in favour of individual-point layers.\n */\n public addHeatmapLayer(config: { id: string; source: string; maxzoom?: number; paint: mapboxgl.HeatmapLayerSpecification['paint'] }): void {\n this.map.addLayer({\n id: config.id,\n type: 'heatmap',\n source: config.source,\n maxzoom: config.maxzoom,\n paint: config.paint,\n });\n }\n\n /**\n * Apply a Mapbox filter expression to a layer, or pass `null` to clear it.\n * Silently no-ops if the layer doesn't exist.\n */\n public setFilter(layerId: string, filter: unknown[] | null): void {\n if (this.map.getLayer(layerId)) {\n this.map.setFilter(layerId, filter as mapboxgl.FilterSpecification | null);\n }\n }\n\n /**\n * Change a paint property on any layer (color, opacity, width, etc.).\n * Works on layers from the base style as well as layers you've added.\n * Silently no-ops when the layer is missing so style swaps don't throw.\n *\n * @example\n * map.setPaintProperty('road-primary', 'line-color', '#ff0080');\n * map.setPaintProperty('water', 'fill-opacity', 0.6);\n */\n public setPaintProperty(layerId: string, name: string, value: unknown): void {\n if (this.map.getLayer(layerId)) {\n (this.map.setPaintProperty as (id: string, name: string, value: unknown) => void)(\n layerId,\n name,\n value,\n );\n }\n }\n\n /**\n * Change a layout property on any layer (visibility, icon-image, text-field, etc.).\n *\n * @example\n * map.setLayoutProperty('poi-label', 'visibility', 'none');\n * map.setLayoutProperty('road-label', 'text-size', 14);\n */\n public setLayoutProperty(layerId: string, name: string, value: unknown): void {\n if (this.map.getLayer(layerId)) {\n (this.map.setLayoutProperty as (id: string, name: string, value: unknown) => void)(\n layerId,\n name,\n value,\n );\n }\n }\n\n /**\n * Return every layer id currently in the style.\n * Useful for discovering layer names from a custom Studio style so you can target them at runtime.\n */\n public getLayerIds(): string[] {\n return this.map.getStyle().layers.map((l) => l.id);\n }\n\n /** Move a layer to the top, or just under `beforeId`. No-op when the layer is missing. */\n public moveLayer(id: string, beforeId?: string): void {\n if (this.hasLayer(id)) {\n this.map.moveLayer(id, beforeId);\n }\n }\n\n /** `true` when a layer with this id exists in the current style. */\n public hasLayer(id: string): boolean {\n return !!this.map.getLayer(id);\n }\n\n /** `true` when a source with this id exists. */\n public hasSource(id: string): boolean {\n return !!this.map.getSource(id);\n }\n\n /** Remove a layer if present. Useful during style swaps or layer teardown. */\n public safeRemoveLayer(id: string): void {\n if (this.hasLayer(id)) {\n this.map.removeLayer(id);\n }\n }\n\n /** Convert geographic coordinates into pixel coordinates within the map container. */\n public project(lngLat: mapboxgl.LngLatLike): mapboxgl.Point {\n return this.map.project(lngLat);\n }\n\n /**\n * Register an image for use with `icon-image` in symbol layers. Accepts\n * either a pre-loaded `HTMLImageElement` or a URL to fetch. Updates an\n * existing entry when the id is already registered.\n */\n public async addImage(id: string, img: HTMLImageElement | string): Promise<void> {\n const imgEl = typeof img === 'string' ? await this.loadImage(img) : img;\n\n if (!this.map.hasImage(id)) {\n this.map.addImage(id, imgEl, { sdf: false });\n\n return;\n }\n\n this.map.updateImage(id, imgEl);\n }\n\n /**\n * Register `image` under `id`, replacing any image already there. Unlike `addImage`'s in-place update, the size and\n * the options (`pixelRatio`, `stretchX` / `stretchY`, `content`) may change, as a re-baked canvas sprite needs.\n */\n public replaceImage(id: string, image: MapImageSource, options?: MapImageOptions): void {\n if (this.map.hasImage(id)) {\n this.map.removeImage(id);\n }\n\n this.map.addImage(id, image, options);\n }\n\n /** Flip a layer's `visibility` between `'visible'` and `'none'`. */\n public toggleLayerVisibility(layerId: string): void {\n const vis = this.map.getLayoutProperty(layerId, 'visibility');\n\n this.map.setLayoutProperty(\n layerId,\n 'visibility',\n vis === 'visible' ? 'none' : 'visible',\n );\n }\n\n /**\n * Subscribe to a raw Mapbox event. Supports both the two-arg form\n * (`on(event, handler)`) and the layer-scoped form (`on(event, layerId, handler)`).\n */\n public on(event: string, ...args: unknown[]): void {\n (this.map as unknown as { on: (e: string, ...a: unknown[]) => void }).on(event, ...args);\n }\n\n /** Remove an event listener previously registered with `on`. */\n public off(event: string, ...args: unknown[]): void {\n (this.map as unknown as { off: (e: string, ...a: unknown[]) => void }).off(event, ...args);\n }\n\n /** Remove a source from the style. Remove any layers using it first. */\n public removeSource(id: string): void {\n this.map.removeSource(id);\n }\n\n /** Set arbitrary feature-state for a feature in a GeoJSON source. */\n public setFeatureState(\n sourceId: string,\n featureId: number | string,\n state: Record<string, unknown>,\n ): void {\n if (!this.map.getSource(sourceId)) {\n return;\n }\n\n this.map.setFeatureState({ source: sourceId, id: featureId }, state);\n }\n\n /** Remove a specific feature-state key, or all state for the feature when `key` is omitted. */\n public clearFeatureState(sourceId: string, featureId: number | string, key?: string): void {\n if (!this.map.getSource(sourceId)) {\n return;\n }\n\n if (!key) {\n this.map.removeFeatureState({ source: sourceId, id: featureId });\n\n return;\n }\n\n this.map.setFeatureState({ source: sourceId, id: featureId }, { [key]: false });\n }\n\n /**\n * Enter polygon-drawing mode. Lazily mounts a `@mapbox/mapbox-gl-draw` control,\n * hides its default UI (consumer controls the toggle), and switches to `draw_polygon`.\n * The user clicks vertices and double-clicks (or clicks the first vertex) to close.\n * The completed polygon is emitted on `polygonCreate`. `keepPanZoom` leaves drag and zoom on.\n */\n public enableDrawPolygon(options?: MapDrawOptions): void {\n if (!this.draw) {\n this.draw = new MapboxDraw({\n displayControlsDefault: false,\n controls: {},\n });\n\n this.map.addControl(this.draw);\n }\n\n if (!this.onDrawCreate) {\n this.onDrawCreate = (e) => {\n const polygon = e.features.find(\n (f) => f.geometry.type === 'Polygon',\n ) as GeoJSON.Feature<GeoJSON.Polygon> | undefined;\n\n if (polygon) {\n this.polygonCreate.next(polygon);\n }\n };\n\n (this.map as unknown as { on: (e: string, h: unknown) => void }).on(\n 'draw.create',\n this.onDrawCreate,\n );\n }\n\n this.lockInteractions(options?.keepPanZoom === true);\n\n this.draw.changeMode('draw_polygon');\n }\n\n /**\n * Close the polygon being drawn, as a double-click would: it is emitted on `polygonCreate` when it has three corners\n * or more. Draw mode (and its gesture lock) stays until `disableDrawPolygon`. No-op when not drawing.\n */\n public finishDrawPolygon(): void {\n this.draw?.changeMode('simple_select');\n }\n\n /** Exit polygon-drawing mode and remove any in-progress or drawn polygons. */\n public disableDrawPolygon(): void {\n if (this.onDrawCreate) {\n (this.map as unknown as { off: (e: string, h: unknown) => void }).off(\n 'draw.create',\n this.onDrawCreate,\n );\n this.onDrawCreate = undefined;\n }\n\n if (this.draw) {\n this.draw.deleteAll();\n this.map.removeControl(this.draw);\n this.draw = undefined;\n }\n\n this.unlockInteractions();\n }\n\n /**\n * Disable pan/zoom handlers so the viewport stays fixed while the user draws (drag, wheel and pinch stay on with\n * `keepPanZoom`). Saves the prior enabled-state for each handler so it can be restored by\n * `unlockInteractions`. Safe to call repeatedly — a second call is a no-op\n * because saved state is only captured on the first lock.\n */\n private lockInteractions(keepPanZoom: boolean): void {\n if (this.savedInteractions) {\n return;\n }\n\n this.savedInteractions = {\n dragPan: this.map.dragPan.isEnabled(),\n scrollZoom: this.map.scrollZoom.isEnabled(),\n boxZoom: this.map.boxZoom.isEnabled(),\n doubleClickZoom: this.map.doubleClickZoom.isEnabled(),\n touchZoomRotate: this.map.touchZoomRotate.isEnabled(),\n keyboard: this.map.keyboard.isEnabled(),\n };\n\n if (!keepPanZoom) {\n this.map.dragPan.disable();\n this.map.scrollZoom.disable();\n this.map.touchZoomRotate.disable();\n }\n\n this.map.boxZoom.disable();\n this.map.doubleClickZoom.disable();\n this.map.keyboard.disable();\n }\n\n /**\n * Restore every pan/zoom handler to the enabled-state captured by\n * `lockInteractions`. No-op when interactions were never locked.\n */\n private unlockInteractions(): void {\n if (!this.savedInteractions) {\n return;\n }\n\n const prev = this.savedInteractions;\n\n if (prev.dragPan) this.map.dragPan.enable();\n if (prev.scrollZoom) this.map.scrollZoom.enable();\n if (prev.boxZoom) this.map.boxZoom.enable();\n if (prev.doubleClickZoom) this.map.doubleClickZoom.enable();\n if (prev.touchZoomRotate) this.map.touchZoomRotate.enable();\n if (prev.keyboard) this.map.keyboard.enable();\n\n this.savedInteractions = undefined;\n }\n\n /** Remove every polygon the user has drawn, keeping draw mode active. */\n public clearDrawnPolygons(): void {\n this.draw?.deleteAll();\n }\n\n\n // The GeoJSON source under `sourceId` (it has the cluster calls), or null when it is missing or another kind.\n private clusterSourceOf(sourceId: string): mapboxgl.GeoJSONSource | null {\n const source = this.map.getSource(sourceId) as { getClusterLeaves?: unknown } | undefined;\n\n return source && typeof source.getClusterLeaves === 'function' ? source as unknown as mapboxgl.GeoJSONSource : null;\n }\n\n private notClusteredError(sourceId: string): Error {\n return new Error(`Source '${sourceId}' is not a clustered GeoJSON source or is missing.`);\n }\n\n private insetOf(insets: MapInsets, side: keyof PaddingOptions): number {\n return typeof insets === 'number' ? insets : insets[side] ?? 0;\n }\n\n /** `isStyleLoaded()` also waits for tiles; what addSource needs is mapbox's one-shot \"style parsed\" flag. */\n private isStyleParsed(): boolean {\n return this.map.isStyleLoaded() || !!(this.map as unknown as { style?: { _loaded?: boolean } }).style?._loaded;\n }\n\n /** Fetch a URL into an `HTMLImageElement`. Resolves on `load`, rejects on `error`. */\n private loadImage(url: string): Promise<HTMLImageElement> {\n return new Promise((res, rej) => {\n const img = new Image();\n\n img.onload = () => res(img);\n img.onerror = rej;\n img.src = url;\n });\n }\n\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n effect,\n inject,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport type mapboxgl from 'mapbox-gl';\nimport type { StyleSpecification } from 'mapbox-gl';\n\nimport { MapboxService } from '../mapbox.service';\n\n/**\n * Thin host component that mounts a Mapbox map into a container div, forwards\n * lifecycle/events from `MapboxService`, and cleans up on destroy.\n *\n * Consumers interact with the underlying map via the public `map` (MapboxService)\n * instance — use `viewChild(ApexMapComponent)` in a parent to reach `component.map`\n * and call `addSource()`, `addLayer()`, `moveCenter()`, etc.\n *\n * Example:\n * <apex-map [center]=\"[-80.84, 35.22]\" [zoom]=\"11\" (mapReady)=\"onReady()\"/>\n */\n\n@Component({\n selector: 'apex-map',\n standalone: true,\n templateUrl: './apex-map.component.html',\n styleUrls: ['./apex-map.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\n\nexport class ApexMapComponent {\n\n public center = input<[number, number]>([-80.8431, 35.2271]);\n public zoom = input<number>(10);\n public mapStyle = input<string | StyleSpecification | undefined>(undefined);\n public maxBounds = input<mapboxgl.LngLatBoundsLike | undefined>(undefined);\n public showNavigation = input<boolean>(true);\n\n public mapReady = output<void>();\n public mapClick = output<mapboxgl.MapMouseEvent>();\n public featureClick = output<mapboxgl.MapMouseEvent>();\n\n readonly map = inject(MapboxService);\n\n private readonly platformId = inject(PLATFORM_ID);\n private readonly destroyRef = inject(DestroyRef);\n private readonly container = viewChild.required<ElementRef<HTMLElement>>('container');\n\n /**\n * Wire a reactive effect that emits `mapReady` once the underlying Mapbox\n * `load` event fires and `MapboxService.ready()` flips to `true`.\n */\n constructor() {\n effect(() => {\n if (this.map.ready()) {\n this.mapReady.emit();\n }\n });\n }\n\n /**\n * Initialise the Mapbox instance into the `#container` div, forward\n * `mapClick`/`featureClick` streams as component outputs, and register\n * teardown so the map is destroyed with the component.\n * No-op on non-browser platforms (SSR).\n */\n public ngAfterViewInit(): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n this.map.init({\n container: this.container().nativeElement,\n center: this.center(),\n zoom: this.zoom(),\n mapStyle: this.mapStyle(),\n maxBounds: this.maxBounds(),\n showNavigation: this.showNavigation(),\n });\n\n this.map.mapClick\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((e) => this.mapClick.emit(e));\n\n this.map.featureClick\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((e) => this.featureClick.emit(e));\n\n this.destroyRef.onDestroy(() => this.map.deactivate(this.container().nativeElement));\n }\n\n}\n","<div #container class=\"apex-map__container\"></div>\n","import { Directive, ElementRef, OnDestroy, inject } from '@angular/core';\n\nimport { MapboxService } from './mapbox.service';\n\n/**\n * A trackpad pinch arrives as a ctrl+wheel. Over anything laid on the map (a card, the map's buttons, a legend, a top\n * bar) it would zoom the page; this hands it to the shared map under it instead. Put it on the overlay itself, or on a\n * container holding the map and its overlays.\n */\n@Directive({\n selector: '[apexMapPinchZoom]',\n standalone: true,\n})\nexport class ApexMapPinchZoomDirective implements OnDestroy {\n\n constructor() {\n // Not passive, so the pinch can stop the page from zooming.\n this.host.nativeElement.addEventListener('wheel', this.onWheel, { passive: false });\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly map = inject(MapboxService);\n\n /** Stops listening. */\n public ngOnDestroy(): void {\n this.host.nativeElement.removeEventListener('wheel', this.onWheel);\n }\n\n private readonly onWheel = (event: WheelEvent): void => {\n // Taken already (mapbox over its own canvas, an overlay nested in this one), or our own re-dispatch (untrusted).\n if (!event.ctrlKey || !event.isTrusted || event.defaultPrevented || !this.holdsShownMap()) {\n return;\n }\n\n const rawMap = this.map.getMap();\n\n if (!rawMap?.scrollZoom.isEnabled()) {\n return;\n }\n\n // Only over the map itself, measured on its container: the canvas container mapbox listens on has no height.\n const rect = rawMap.getContainer().getBoundingClientRect();\n\n if (event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom) {\n return;\n }\n\n event.preventDefault();\n\n rawMap.getCanvasContainer().dispatchEvent(new WheelEvent('wheel', {\n bubbles: true,\n cancelable: true,\n ctrlKey: true,\n shiftKey: event.shiftKey,\n clientX: event.clientX,\n clientY: event.clientY,\n deltaX: event.deltaX,\n deltaY: event.deltaY,\n deltaMode: event.deltaMode,\n }));\n };\n\n // The one map moves between surfaces: zoom it only while it is shown inside this element (a container) or inside the\n // element this one is positioned in (a card anchored over the map).\n private holdsShownMap(): boolean {\n const host = this.host.nativeElement;\n const anchor = host.offsetParent;\n\n return this.map.isShownIn(host) || (anchor !== null && this.map.isShownIn(anchor));\n }\n\n}\n","import { signal } from '@angular/core';\n\nimport { MapGeolocationUtil, type MapLngLat, type MapLocateOptions, type MapLocateResult } from '@apexara/map/geo';\n\nimport type * as GeoJSON from 'geojson';\n\nimport type { MapboxService } from './mapbox.service';\nimport { MapUserLocationConfig, MapUserLocationStyle } from './map.types';\n\n/**\n * The reader's location as a dot on the map, in the consumer's `style`, and the camera move to it at the consumer's\n * `zoom`. Not injectable: a map surface builds one with the `MapboxService` it draws on, repaints it after a style swap\n * and destroys it on teardown.\n */\nexport class MapUserLocationLayer {\n\n constructor(\n private readonly map: MapboxService,\n config: MapUserLocationConfig) {\n this.sourceId = config.sourceId ?? 'user-location';\n this.layerId = config.layerId ?? 'user-location-dot';\n this.zoom = config.zoom;\n this.style = { ...config.style };\n }\n\n /** The last location read, as `[lng, lat]`; null until one is. */\n public readonly location = signal<MapLngLat | null>(null);\n\n private readonly sourceId: string;\n private readonly layerId: string;\n private readonly zoom: number;\n private readonly style: MapUserLocationStyle;\n\n /** Reads the location once and draws the dot; the camera stays where it is. */\n public async init(options?: MapLocateOptions): Promise<MapLocateResult> {\n const result = await MapGeolocationUtil.locate(options);\n\n if (result.status === 'located') {\n this.location.set(result.position);\n this.repaint();\n }\n\n return result;\n }\n\n /** Flies to the location (at the configured zoom), reading it first when none is known yet. */\n public async locate(options?: MapLocateOptions): Promise<MapLocateResult> {\n const known = this.location();\n\n if (known) {\n this.map.moveCenter(known, this.zoom);\n\n return { status: 'located', position: known };\n }\n\n const result = await this.init(options);\n\n if (result.status === 'located') {\n this.map.moveCenter(result.position, this.zoom);\n }\n\n return result;\n }\n\n /** Puts the dot (back) on the map, e.g. after a style swap. No-op until a location is known. */\n public repaint(): void {\n const position = this.location();\n\n if (!position) {\n return;\n }\n\n this.map.upsertSource({ id: this.sourceId, data: this.pointOf(position) });\n\n if (this.map.hasLayer(this.layerId)) {\n return;\n }\n\n this.map.addLayer({\n id: this.layerId,\n type: 'circle',\n source: this.sourceId,\n paint: {\n 'circle-radius': this.style.circleRadius,\n 'circle-color': this.style.circleColor,\n 'circle-stroke-color': this.style.strokeColor,\n 'circle-stroke-width': this.style.strokeWidth,\n },\n });\n }\n\n /** Takes the dot off the map; the location is kept for the next `repaint`. */\n public destroy(): void {\n this.map.safeRemoveLayer(this.layerId);\n\n if (this.map.hasSource(this.sourceId)) {\n this.map.removeSource(this.sourceId);\n }\n }\n\n private pointOf(position: MapLngLat): GeoJSON.FeatureCollection<GeoJSON.Point> {\n return {\n type: 'FeatureCollection',\n features: [{ type: 'Feature', geometry: { type: 'Point', coordinates: position }, properties: {} }],\n };\n }\n\n}\n","import type mapboxgl from 'mapbox-gl';\nimport type { Position } from 'geojson';\n\nimport { MapGeometryUtil, type MapBoundsOptions } from '@apexara/map/geo';\n\ntype Coord = [number, number];\n\n/**\n * Recursively flatten any nesting of GeoJSON coordinates down to a flat list of [lng, lat] pairs.\n * Handles Point, LineString, Polygon, and MultiPolygon coordinate shapes uniformly.\n */\nexport function flattenCoords(arr: Position | Position[] | Position[][] | Position[][][]): Coord[] {\n const out: Coord[] = [];\n\n MapGeometryUtil.forEachPosition(arr, (position) => out.push(position as Coord));\n\n return out;\n}\n\n/**\n * Compute the [[minLng, minLat], [maxLng, maxLat]] bounds of a flat list of coordinates, compatible with\n * `mapboxgl.LngLatBoundsLike`. `wrapAntimeridian` frames a shape across ±180° by its narrower side. No coordinates give\n * `[[180, 90], [-180, -90]]`. For whole GeoJSON, `MapGeometryUtil.boundsOf` walks it without flattening.\n */\nexport function calculateBounds(coords: Coord[], options?: MapBoundsOptions): mapboxgl.LngLatBoundsLike {\n return MapGeometryUtil.boundsOf({ type: 'MultiPoint', coordinates: coords }, options) ?? [[180, 90], [-180, -90]];\n}\n\n/**\n * Build a closed square polygon of side `2 * radiusKm` centered at `center`.\n * Useful when you need a small viewport-like polygon for point-in-polygon queries.\n */\nexport function calculateViewportPolygonFromCenter(center: Coord, radiusKm = 0.5): number[][][] {\n const [lng, lat] = center;\n\n const degreesPerMeterLng = 1 / (111320 * Math.cos((lat * Math.PI) / 180));\n const degreesPerMeterLat = 1 / 110540;\n\n const radiusMeters = radiusKm * 1000;\n const lngDelta = radiusMeters * degreesPerMeterLng;\n const latDelta = radiusMeters * degreesPerMeterLat;\n\n return [\n [\n [lng - lngDelta, lat - latDelta],\n [lng + lngDelta, lat - latDelta],\n [lng + lngDelta, lat + latDelta],\n [lng - lngDelta, lat + latDelta],\n [lng - lngDelta, lat - latDelta],\n ],\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AA2BA;;;;;;;;;;;;AAYG;AAEH;AACA;AACA;AACA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAuC;MAGpD,aAAa,CAAA;AAD1B,IAAA,WAAA,GAAA;;AAIS,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,OAAO,EAA0B;;AAGhD,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAA0B;;AAGpD,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,OAAO,EAAoC;AAErD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAU,KAAK,kDAAC;;AAGhC,QAAA,IAAA,CAAA,KAAK,GAAoB,IAAI,CAAC,MAAM;;AAGpC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAA0B,IAAI,kDAAC;;AAG9C,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAgB,IAAI,gDAAC;;AAGlC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAA8C,IAAI,kDAAC;;AAGlE,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAU,KAAK,oDAAC;;;QAKzC,IAAA,CAAA,cAAc,GAAG,KAAK;AAEb,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;AAC3B,QAAA,IAAA,CAAA,U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AC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AACnH;AAEA;;;AAGG;SACa,kCAAkC,CAAC,MAAa,EAAE,QAAQ,GAAG,GAAG,EAAA;AAC9E,IAAA,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,MAAM;IAEzB,MAAM,kBAAkB,GAAG,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;AACzE,IAAA,MAAM,kBAAkB,GAAG,CAAC,GAAG,MAAM;AAErC,IAAA,MAAM,YAAY,GAAG,QAAQ,GAAG,IAAI;AACpC,IAAA,MAAM,QAAQ,GAAG,YAAY,GAAG,kBAAkB;AAClD,IAAA,MAAM,QAAQ,GAAG,YAAY,GAAG,kBAAkB;IAElD,OAAO;AACL,QAAA;AACE,YAAA,CAAC,GAAG,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,CAAC;AAChC,YAAA,CAAC,GAAG,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,CAAC;AAChC,YAAA,CAAC,GAAG,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,CAAC;AAChC,YAAA,CAAC,GAAG,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,CAAC;AAChC,YAAA,CAAC,GAAG,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,CAAC;AACjC,SAAA;KACF;AACH;;ACnDA;;AAEG;;;;"}
1
+ {"version":3,"file":"apexara-map.mjs","sources":["../../../../projects/apexara/map/src/lib/mapbox.service.ts","../../../../projects/apexara/map/src/lib/apex-map/apex-map.component.ts","../../../../projects/apexara/map/src/lib/apex-map/apex-map.component.html","../../../../projects/apexara/map/src/lib/apex-map-pinch-zoom.directive.ts","../../../../projects/apexara/map/src/lib/map-user-location.layer.ts","../../../../projects/apexara/map/src/lib/map.utils.ts","../../../../projects/apexara/map/apexara-map.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Injectable, PLATFORM_ID, Signal, WritableSignal, inject, signal } from '@angular/core';\n\nimport { Subject } from 'rxjs';\n\nimport MapboxDraw from '@mapbox/mapbox-gl-draw';\nimport mapboxgl, { CameraOptions, EasingOptions, LayerSpecification, PaddingOptions } from 'mapbox-gl';\n\nimport { MAP_CONFIG, MapStyles } from '@apexara/map/config';\n\nimport type * as GeoJSON from 'geojson';\nimport type { Position } from 'geojson';\n\nimport {\n MapDrawOptions,\n MapEventData,\n MapFeatureQuery,\n MapFitOptions,\n MapImageOptions,\n MapImageSource,\n MapInitOptions,\n MapInsets,\n MapQueryGeometry,\n MapStyleOptions,\n SourceConfig,\n} from './map.types';\n\n/**\n * Mapbox Service — wrapper around a `mapboxgl.Map` instance.\n *\n * Terms:\n * - Feature: A GeoJSON geometry (Point/LineString/Polygon/…) drawn on the map.\n * - Properties: Arbitrary key-value pairs on `feature.properties`.\n * - Source: Raw data (GeoJSON, vector tiles, raster tiles) added with `addSource`.\n * - Layer: A visual rendering (circle, fill, heatmap, raster, …) bound to a source.\n * - Cluster: A grouped feature emitted when `cluster: true` is set on a GeoJSON source.\n *\n * Browser-only: `init()` is a no-op on the server. Methods other than `init()` assume\n * the map instance exists and must only be called after `ready()` becomes true.\n */\n\n// Process-lifetime cache of parsed Mapbox style JSON keyed by URL. Subsequent\n// inits with the same URL pass the cached object to the Map constructor\n// instead of re-fetching `api.mapbox.com/styles/v1/...`.\nconst styleCache = new Map<string, mapboxgl.StyleSpecification>();\n\n@Injectable({ providedIn: 'root' })\nexport class MapboxService {\n\n /** Click on empty canvas (no features under the cursor). Event stream. */\n public mapClick = new Subject<mapboxgl.MapMouseEvent>();\n\n /** Click on a feature (wired by consumers via `on('click', layerId, ...)`). Event stream. */\n public featureClick = new Subject<mapboxgl.MapMouseEvent>();\n\n /** Fires when the user completes a polygon in draw mode (double-click or first-vertex click). */\n public polygonCreate = new Subject<GeoJSON.Feature<GeoJSON.Polygon>>();\n\n private readonly _ready = signal<boolean>(false);\n\n /** Reactive state: `true` once the map's `load` event has fired. */\n public readonly ready: Signal<boolean> = this._ready;\n\n /** Reactive state: current center `[lng, lat]`. Updates on `moveend`. `null` before init. */\n public readonly center = signal<[number, number] | null>(null);\n\n /** Reactive state: current zoom level. Updates on `moveend`. `null` before init. */\n public readonly zoom = signal<number | null>(null);\n\n /** Reactive state: current viewport bounds `[[swLng, swLat], [neLng, neLat]]`. Updates on `moveend`. */\n public readonly bounds = signal<[[number, number], [number, number]] | null>(null);\n\n /** Reactive state: `true` while the map is panning/zooming (between `movestart` and `moveend`). */\n public readonly isMoving = signal<boolean>(false);\n\n private map!: mapboxgl.Map;\n // `map` stays non-null-typed so existing call-sites don't need guards;\n // this flag tracks whether the constructor has actually run.\n private mapInitialised = false;\n private draw?: MapboxDraw;\n private readonly config = inject(MAP_CONFIG);\n private readonly platformId = inject(PLATFORM_ID);\n\n private onDrawCreate?: (e: { features: GeoJSON.Feature[] }) => void;\n private savedInteractions?: Record<'dragPan' | 'scrollZoom' | 'boxZoom' | 'doubleClickZoom' | 'touchZoomRotate' | 'keyboard', boolean>;\n\n // mapbox-gl is given this stable element (not the consumer's `<div>`).\n // The service re-parents `hostDiv` between consumer containers on context\n // swaps so the underlying `mapboxgl.Map` survives → one billed load per session.\n private hostDiv: HTMLDivElement | null = null;\n\n private containerStack: HTMLElement[] = [];\n\n private readonly _activeContainer: WritableSignal<HTMLElement | null> = signal(null);\n public readonly activeContainer: Signal<HTMLElement | null> = this._activeContainer;\n\n // Whether this browser can run mapbox; null until asked. Kept, since mapbox's check builds a worker and a canvas.\n private supported: boolean | null = null;\n\n // What `fitBounds` has always done: 40 px all round, a one-second slide. The padding frames that one fit: kept as the\n // map's own, it would shrink every later getBounds / getViewportPolygon / `bounds` to the inset box.\n private readonly fitDefaults: MapFitOptions = { padding: 40, duration: 1000, retainPadding: false };\n\n /** Back-compat wrapper around `activate`. SSR-safe. */\n public async init(options: MapInitOptions): Promise<void> {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n this.activate(options.container, options);\n }\n\n /** Whether this browser can run mapbox (WebGL2, workers, canvas reads). Asked once; false on the server. */\n public isSupported(): boolean {\n this.supported ??= isPlatformBrowser(this.platformId) && mapboxgl.supported();\n\n return this.supported;\n }\n\n /**\n * Puts the shared map on `container`. False when it did not start there: on the server, in a browser that cannot run\n * mapbox, or when the first start throws (undone and reported). A running map's errors still throw.\n */\n public activate(container: HTMLElement, options: MapInitOptions): boolean {\n if (!this.isSupported()) {\n return false;\n }\n\n if (!this.mapInitialised) {\n return this.startMap(container, options);\n }\n\n const active = this._activeContainer();\n\n if (active === container) {\n if (options.center) {\n this.map.jumpTo({ center: options.center, zoom: options.zoom ?? this.map.getZoom() });\n }\n requestAnimationFrame(() => this.map.resize());\n\n return true;\n }\n\n this.hostDiv?.remove();\n if (this.hostDiv) {\n this.hostDiv.style.display = '';\n container.appendChild(this.hostDiv);\n }\n\n this.containerStack = this.containerStack.filter((c) => c !== container);\n this.containerStack.push(container);\n this._activeContainer.set(container);\n\n if (options.center) {\n this.map.jumpTo({ center: options.center, zoom: options.zoom ?? this.map.getZoom() });\n }\n requestAnimationFrame(() => this.map.resize());\n\n return true;\n }\n\n public deactivate(container: HTMLElement): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const wasActive = this._activeContainer() === container;\n this.containerStack = this.containerStack.filter((c) => c !== container);\n\n if (!wasActive) {\n return;\n }\n\n const next = this.containerStack[this.containerStack.length - 1];\n\n this.hostDiv?.remove();\n\n if (next && this.hostDiv) {\n this.hostDiv.style.display = '';\n next.appendChild(this.hostDiv);\n this._activeContainer.set(next);\n requestAnimationFrame(() => this.map.resize());\n return;\n }\n\n if (this.hostDiv) {\n document.body.appendChild(this.hostDiv);\n this.hostDiv.style.display = 'none';\n }\n this._activeContainer.set(null);\n }\n\n // The first start. It can pass isSupported and still throw (e.g. at the browser's limit of WebGL contexts) after its\n // host div went into the container: the div comes back out, so the container is left as it was.\n private startMap(container: HTMLElement, options: MapInitOptions): boolean {\n try {\n this.createMap(container, options);\n } catch (error) {\n this.hostDiv?.remove();\n this.hostDiv = null;\n console.error('[@apexara/map] The map failed to start.', error);\n\n return false;\n }\n\n this.containerStack.push(container);\n this._activeContainer.set(container);\n\n return true;\n }\n\n private createMap(container: HTMLElement, options: MapInitOptions): void {\n const defaultBounds: mapboxgl.LngLatBoundsLike = [\n [-175, -85],\n [175, 85],\n ];\n\n const styleInput = options.mapStyle || this.config.defaultStyle || MapStyles.Streets;\n const styleUrl = typeof styleInput === 'string' ? styleInput : null;\n const cachedStyle = styleUrl ? styleCache.get(styleUrl) : undefined;\n\n this.hostDiv = document.createElement('div');\n this.hostDiv.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;';\n container.appendChild(this.hostDiv);\n\n this.map = new mapboxgl.Map({\n center: options.center,\n zoom: options.zoom || 10,\n accessToken: this.config.accessToken,\n container: this.hostDiv,\n style: (cachedStyle ?? styleInput) as string,\n fadeDuration: 0,\n pitch: 0,\n bearing: 0,\n dragRotate: false,\n pitchWithRotate: false,\n projection: 'mercator',\n maxBounds: options.maxBounds ?? defaultBounds,\n renderWorldCopies: false,\n // Required for `canvas.toDataURL()` to return pixels — consumers that\n // snapshot the canvas (e.g. freeze-frame overlays) rely on this.\n preserveDrawingBuffer: true,\n });\n this.mapInitialised = true;\n\n if (styleUrl && !cachedStyle) {\n this.map.once('style.load', () => {\n styleCache.set(styleUrl, this.map.getStyle() as mapboxgl.StyleSpecification);\n });\n }\n\n this.center.set(options.center);\n this.zoom.set(options.zoom ?? 10);\n\n this.map.on('movestart', () => this.isMoving.set(true));\n\n this.map.on('moveend', () => {\n const c = this.map.getCenter();\n const b = this.map.getBounds() as mapboxgl.LngLatBounds;\n const sw = b.getSouthWest();\n const ne = b.getNorthEast();\n\n this.center.set([c.lng, c.lat]);\n this.zoom.set(this.map.getZoom());\n this.bounds.set([[sw.lng, sw.lat], [ne.lng, ne.lat]]);\n this.isMoving.set(false);\n });\n\n this.map.once('load', () => {\n if (options.showNavigation !== false) {\n this.map.addControl(\n new mapboxgl.NavigationControl({ showCompass: false, showZoom: true }),\n );\n }\n\n this._ready.set(true);\n });\n }\n\n /** Current map center as a `LngLat`. Prefer the `center` signal for reactive reads. */\n public getCenter(): mapboxgl.LngLat {\n return this.map.getCenter();\n }\n\n /** Current zoom level. Prefer the `zoom` signal for reactive reads. */\n public getZoom(): number {\n return this.map.getZoom();\n }\n\n /** The live `mapboxgl.Map`, for mapbox APIs this service does not wrap. `undefined` until the first `init`/`activate`. */\n public getMap(): mapboxgl.Map | undefined {\n return this.mapInitialised ? this.map : undefined;\n }\n\n /**\n * Resolves once the style is parsed, so sources and layers can be added: after a re-parent `ready()` (a one-time\n * latch) says nothing about that. Resolves at once with no map; pass `destroyRef` to resolve on teardown, not hang.\n */\n public whenStyleReady(destroyRef?: DestroyRef): Promise<void> {\n if (!this.mapInitialised || this.isStyleParsed()) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n let removeDestroyHook: (() => void) | undefined;\n\n const done = (): void => {\n this.map.off('style.load', done);\n this.map.off('idle', done);\n removeDestroyHook?.();\n resolve();\n };\n\n // `idle` always fires once the map settles, so a `style.load` that already fired cannot hang the wait.\n this.map.once('style.load', done);\n this.map.once('idle', done);\n removeDestroyHook = destroyRef?.onDestroy(done);\n });\n }\n\n /**\n * Return the current viewport as a closed GeoJSON-style polygon ring\n * (`[sw, se, ne, nw, sw]`). Useful for point-in-polygon queries against the\n * visible area.\n */\n public getViewportPolygon(): Position[][] {\n const bounds = this.map.getBounds() as mapboxgl.LngLatBounds;\n\n const sw = bounds.getSouthWest();\n const se = bounds.getSouthEast();\n const ne = bounds.getNorthEast();\n const nw = bounds.getNorthWest();\n\n return [\n [\n [sw.lng, sw.lat],\n [se.lng, se.lat],\n [ne.lng, ne.lat],\n [nw.lng, nw.lat],\n [sw.lng, sw.lat],\n ],\n ];\n }\n\n /**\n * Extract `properties` from the first feature under a click/hover event,\n * cast to `T`. Returns `undefined` when no feature was hit or it has no props.\n */\n public getFeatureProperties<T>(mouseEvent: mapboxgl.MapMouseEvent): T | undefined {\n const feature = mouseEvent.features?.[0];\n\n if (!feature) {\n return undefined;\n }\n\n const properties = feature.properties;\n\n if (!properties) {\n return undefined;\n }\n\n return properties as T;\n }\n\n /**\n * Expand a cluster into its individual leaf features (up to `limit`, paginated\n * via `offset`). Rejects if `sourceId` is missing or not a clustered GeoJSON source.\n */\n public async getClusterProperties(\n sourceId: string,\n clusterId: number,\n limit = 10000,\n offset = 0,\n ): Promise<mapboxgl.GeoJSONFeature[]> {\n return new Promise((resolve, reject) => {\n const src = this.clusterSourceOf(sourceId);\n\n if (!src) {\n reject(this.notClusteredError(sourceId));\n\n return;\n }\n\n src.getClusterLeaves(clusterId, limit, offset, (err, features) => {\n if (err) {\n reject(err);\n } else {\n resolve(features as mapboxgl.GeoJSONFeature[]);\n }\n });\n });\n }\n\n /**\n * The zoom at which a cluster splits into its children, e.g. to `easeTo` it. Rejects as `getClusterProperties` does,\n * and when mapbox answers with no zoom.\n */\n public getClusterExpansionZoom(sourceId: string, clusterId: number): Promise<number> {\n return new Promise((resolve, reject) => {\n const source = this.clusterSourceOf(sourceId);\n\n if (!source) {\n reject(this.notClusteredError(sourceId));\n\n return;\n }\n\n source.getClusterExpansionZoom(clusterId, (error, expansionZoom) => {\n if (error) {\n reject(error);\n } else if (typeof expansionZoom !== 'number') {\n reject(new Error(`Cluster ${clusterId} in source '${sourceId}' gave no expansion zoom.`));\n } else {\n resolve(expansionZoom);\n }\n });\n });\n }\n\n /**\n * Features rendered at a screen point or in a `[corner, corner]` box (the whole viewport when `geometry` is\n * undefined), kept to `layers` and `filter`. Returns `[]` when the map has not been initialised yet.\n */\n public getRenderedFeatures(geometry?: MapQueryGeometry, query?: MapFeatureQuery): mapboxgl.GeoJSONFeature[] {\n return this.map ? this.map.queryRenderedFeatures(geometry as MapQueryGeometry, query) : [];\n }\n\n /** Whether `lngLat` projects inside the canvas, `insets` pixels in from its edges. False before the map exists. */\n public isPointOnScreen(lngLat: mapboxgl.LngLatLike, insets: MapInsets = 0): boolean {\n if (!this.mapInitialised) {\n return false;\n }\n\n const point = this.map.project(lngLat);\n const canvas = this.map.getCanvas();\n\n return point.x >= this.insetOf(insets, 'left')\n && point.y >= this.insetOf(insets, 'top')\n && point.x <= canvas.clientWidth - this.insetOf(insets, 'right')\n && point.y <= canvas.clientHeight - this.insetOf(insets, 'bottom');\n }\n\n /** Whether the shared map is on screen inside `element`: its active container is `element` or below it. */\n public isShownIn(element: Node): boolean {\n const active = this._activeContainer();\n\n return active !== null && element.contains(active);\n }\n\n /**\n * Swap the base style. `{ diff: false }` rebuilds it from scratch, for a swap where mapbox's diff keeps a source the\n * rebuild then trips over. Custom sources/layers you added must be re-applied after `styledata`.\n */\n public setStyle(styleUrl: string, options?: MapStyleOptions): void {\n const cachedStyle = styleCache.get(styleUrl);\n\n // The typings mark mapbox's optional font options as required.\n this.map.setStyle((cachedStyle ?? styleUrl) as string, options as Parameters<mapboxgl.Map['setStyle']>[1]);\n\n if (!cachedStyle) {\n this.map.once('style.load', () => {\n styleCache.set(styleUrl, this.map.getStyle() as mapboxgl.StyleSpecification);\n });\n }\n }\n\n /** Animate the camera to `center` at the given zoom (default 13). `flyTo` takes a duration, a curve and event data. */\n public moveCenter(center: [number, number], zoom = 13): void {\n this.map.flyTo({ center, zoom });\n }\n\n /**\n * Fit the viewport to `bounds`. A number is the padding (default 40) of a one-second slide; options (`padding` per\n * side, `maxZoom`, `duration`, `animate: false`, …) lay over those same defaults. `eventData` reaches the move's events.\n * The padding frames this fit only and the map's own padding stays as it was; `retainPadding: true` keeps it instead.\n */\n public fitBounds(bounds: mapboxgl.LngLatBoundsLike, options: number | MapFitOptions = {}, eventData?: MapEventData): void {\n const overrides = typeof options === 'number' ? { padding: options } : options;\n\n this.map.fitBounds(bounds, { ...this.fitDefaults, ...overrides }, eventData);\n }\n\n /** Fly the camera (mapbox's `flyTo`: `center`, `zoom`, `duration`, `curve`, `offset`, …). */\n public flyTo(options: EasingOptions, eventData?: MapEventData): void {\n this.map.flyTo(options, eventData);\n }\n\n /** Ease the camera (mapbox's `easeTo`), e.g. into a cluster's expansion zoom. */\n public easeTo(options: EasingOptions, eventData?: MapEventData): void {\n this.map.easeTo(options, eventData);\n }\n\n /** Move the camera at once (mapbox's `jumpTo`). */\n public jumpTo(options: CameraOptions, eventData?: MapEventData): void {\n this.map.jumpTo(options, eventData);\n }\n\n /**\n * Have mapbox re-read its container's size, e.g. from a `ResizeObserver`. A resize fires `movestart` / `moveend`, which\n * carry `eventData`. No-op before the map exists.\n */\n public resize(eventData?: MapEventData): void {\n if (this.mapInitialised) {\n this.map.resize(eventData);\n }\n }\n\n /**\n * Add a GeoJSON source. Pass `clustered: true` and optional `clusterRadius`/`clusterMaxZoom`\n * for point clustering. Set `generateId: true` when you plan to use feature-state.\n */\n public addSource(config: SourceConfig): void {\n const src: mapboxgl.GeoJSONSourceSpecification = {\n type: 'geojson',\n data: config.data,\n };\n\n if (config.clustered !== undefined) {\n src.cluster = config.clustered;\n }\n\n if (config.clusterRadius !== undefined) {\n src.clusterRadius = config.clusterRadius;\n }\n\n if (config.clusterMaxZoom !== undefined) {\n src.clusterMaxZoom = config.clusterMaxZoom;\n }\n\n if (config.generateId !== undefined) {\n src.generateId = config.generateId;\n }\n\n this.map.addSource(config.id, src);\n }\n\n /**\n * Add a GeoJSON source, or replace the data of the one already under `config.id` (its other options stay as they\n * were). True when it was added, so the caller adds the layers that draw it.\n */\n public upsertSource(config: SourceConfig): boolean {\n if (this.hasSource(config.id)) {\n this.updateSource(config.id, config.data);\n\n return false;\n }\n\n this.addSource(config);\n\n return true;\n }\n\n /** Replace the data of an existing GeoJSON source in place. No-op if the source is missing. */\n public updateSource(id: string, data: string | GeoJSON.GeoJSON): void {\n const source = this.map.getSource(id);\n\n if (source && 'setData' in source) {\n (source as mapboxgl.GeoJSONSource).setData(data);\n }\n }\n\n /**\n * Add a layer to the style. Pass `beforeId` to insert the new layer beneath\n * an existing one (useful for controlling draw order against style layers).\n */\n public addLayer(layer: LayerSpecification, beforeId?: string): void {\n if (beforeId) {\n this.map.addLayer(layer, beforeId);\n } else {\n this.map.addLayer(layer);\n }\n }\n\n /**\n * Add a raster layer backed by a source with the same id. Starts hidden —\n * toggle with `toggleLayerVisibility(id)` or `setLayoutProperty`.\n */\n public addRasterLayer(id: string, _url: string): void {\n this.map.addLayer({\n id,\n type: 'raster',\n source: id,\n layout: { visibility: 'none' },\n });\n }\n\n /** Add a vector tile source from a TileJSON URL (typically `mapbox://...`). */\n public addVectorSource(id: string, url: string): void {\n this.map.addSource(id, {\n type: 'vector',\n url,\n } as mapboxgl.VectorSourceSpecification);\n }\n\n /**\n * Add a heatmap layer bound to an existing source. `maxzoom` controls the\n * zoom at which the heatmap fades out in favour of individual-point layers.\n */\n public addHeatmapLayer(config: { id: string; source: string; maxzoom?: number; paint: mapboxgl.HeatmapLayerSpecification['paint'] }): void {\n this.map.addLayer({\n id: config.id,\n type: 'heatmap',\n source: config.source,\n maxzoom: config.maxzoom,\n paint: config.paint,\n });\n }\n\n /**\n * Apply a Mapbox filter expression to a layer, or pass `null` to clear it.\n * Silently no-ops if the layer doesn't exist.\n */\n public setFilter(layerId: string, filter: unknown[] | null): void {\n if (this.map.getLayer(layerId)) {\n this.map.setFilter(layerId, filter as mapboxgl.FilterSpecification | null);\n }\n }\n\n /**\n * Change a paint property on any layer (color, opacity, width, etc.).\n * Works on layers from the base style as well as layers you've added.\n * Silently no-ops when the layer is missing so style swaps don't throw.\n *\n * @example\n * map.setPaintProperty('road-primary', 'line-color', '#ff0080');\n * map.setPaintProperty('water', 'fill-opacity', 0.6);\n */\n public setPaintProperty(layerId: string, name: string, value: unknown): void {\n if (this.map.getLayer(layerId)) {\n (this.map.setPaintProperty as (id: string, name: string, value: unknown) => void)(\n layerId,\n name,\n value,\n );\n }\n }\n\n /**\n * Change a layout property on any layer (visibility, icon-image, text-field, etc.).\n *\n * @example\n * map.setLayoutProperty('poi-label', 'visibility', 'none');\n * map.setLayoutProperty('road-label', 'text-size', 14);\n */\n public setLayoutProperty(layerId: string, name: string, value: unknown): void {\n if (this.map.getLayer(layerId)) {\n (this.map.setLayoutProperty as (id: string, name: string, value: unknown) => void)(\n layerId,\n name,\n value,\n );\n }\n }\n\n /**\n * Return every layer id currently in the style.\n * Useful for discovering layer names from a custom Studio style so you can target them at runtime.\n */\n public getLayerIds(): string[] {\n return this.map.getStyle().layers.map((l) => l.id);\n }\n\n /** Move a layer to the top, or just under `beforeId`. No-op when the layer is missing. */\n public moveLayer(id: string, beforeId?: string): void {\n if (this.hasLayer(id)) {\n this.map.moveLayer(id, beforeId);\n }\n }\n\n /** `true` when a layer with this id exists in the current style. */\n public hasLayer(id: string): boolean {\n return !!this.map.getLayer(id);\n }\n\n /** `true` when a source with this id exists. */\n public hasSource(id: string): boolean {\n return !!this.map.getSource(id);\n }\n\n /** Remove a layer if present. Useful during style swaps or layer teardown. */\n public safeRemoveLayer(id: string): void {\n if (this.hasLayer(id)) {\n this.map.removeLayer(id);\n }\n }\n\n /** Convert geographic coordinates into pixel coordinates within the map container. */\n public project(lngLat: mapboxgl.LngLatLike): mapboxgl.Point {\n return this.map.project(lngLat);\n }\n\n /**\n * Register an image for use with `icon-image` in symbol layers. Accepts\n * either a pre-loaded `HTMLImageElement` or a URL to fetch. Updates an\n * existing entry when the id is already registered.\n */\n public async addImage(id: string, img: HTMLImageElement | string): Promise<void> {\n const imgEl = typeof img === 'string' ? await this.loadImage(img) : img;\n\n if (!this.map.hasImage(id)) {\n this.map.addImage(id, imgEl, { sdf: false });\n\n return;\n }\n\n this.map.updateImage(id, imgEl);\n }\n\n /**\n * Register `image` under `id`, replacing any image already there. Unlike `addImage`'s in-place update, the size and\n * the options (`pixelRatio`, `stretchX` / `stretchY`, `content`) may change, as a re-baked canvas sprite needs.\n */\n public replaceImage(id: string, image: MapImageSource, options?: MapImageOptions): void {\n if (this.map.hasImage(id)) {\n this.map.removeImage(id);\n }\n\n this.map.addImage(id, image, options);\n }\n\n /** Flip a layer's `visibility` between `'visible'` and `'none'`. */\n public toggleLayerVisibility(layerId: string): void {\n const vis = this.map.getLayoutProperty(layerId, 'visibility');\n\n this.map.setLayoutProperty(\n layerId,\n 'visibility',\n vis === 'visible' ? 'none' : 'visible',\n );\n }\n\n /**\n * Subscribe to a raw Mapbox event. Supports both the two-arg form\n * (`on(event, handler)`) and the layer-scoped form (`on(event, layerId, handler)`).\n */\n public on(event: string, ...args: unknown[]): void {\n (this.map as unknown as { on: (e: string, ...a: unknown[]) => void }).on(event, ...args);\n }\n\n /** Remove an event listener previously registered with `on`. */\n public off(event: string, ...args: unknown[]): void {\n (this.map as unknown as { off: (e: string, ...a: unknown[]) => void }).off(event, ...args);\n }\n\n /** Remove a source from the style. Remove any layers using it first. */\n public removeSource(id: string): void {\n this.map.removeSource(id);\n }\n\n /** Set arbitrary feature-state for a feature in a GeoJSON source. */\n public setFeatureState(\n sourceId: string,\n featureId: number | string,\n state: Record<string, unknown>,\n ): void {\n if (!this.map.getSource(sourceId)) {\n return;\n }\n\n this.map.setFeatureState({ source: sourceId, id: featureId }, state);\n }\n\n /** Remove a specific feature-state key, or all state for the feature when `key` is omitted. */\n public clearFeatureState(sourceId: string, featureId: number | string, key?: string): void {\n if (!this.map.getSource(sourceId)) {\n return;\n }\n\n if (!key) {\n this.map.removeFeatureState({ source: sourceId, id: featureId });\n\n return;\n }\n\n this.map.setFeatureState({ source: sourceId, id: featureId }, { [key]: false });\n }\n\n /**\n * Enter polygon-drawing mode. Lazily mounts a `@mapbox/mapbox-gl-draw` control,\n * hides its default UI (consumer controls the toggle), and switches to `draw_polygon`.\n * The user clicks vertices and double-clicks (or clicks the first vertex) to close.\n * The completed polygon is emitted on `polygonCreate`. `keepPanZoom` leaves drag and zoom on.\n */\n public enableDrawPolygon(options?: MapDrawOptions): void {\n if (!this.draw) {\n this.draw = new MapboxDraw({\n displayControlsDefault: false,\n controls: {},\n });\n\n this.map.addControl(this.draw);\n }\n\n if (!this.onDrawCreate) {\n this.onDrawCreate = (e) => {\n const polygon = e.features.find(\n (f) => f.geometry.type === 'Polygon',\n ) as GeoJSON.Feature<GeoJSON.Polygon> | undefined;\n\n if (polygon) {\n this.polygonCreate.next(polygon);\n }\n };\n\n (this.map as unknown as { on: (e: string, h: unknown) => void }).on(\n 'draw.create',\n this.onDrawCreate,\n );\n }\n\n this.lockInteractions(options?.keepPanZoom === true);\n\n this.draw.changeMode('draw_polygon');\n }\n\n /**\n * Close the polygon being drawn, as a double-click would: it is emitted on `polygonCreate` when it has three corners\n * or more. Draw mode (and its gesture lock) stays until `disableDrawPolygon`. No-op when not drawing.\n */\n public finishDrawPolygon(): void {\n this.draw?.changeMode('simple_select');\n }\n\n /** Exit polygon-drawing mode and remove any in-progress or drawn polygons. */\n public disableDrawPolygon(): void {\n if (this.onDrawCreate) {\n (this.map as unknown as { off: (e: string, h: unknown) => void }).off(\n 'draw.create',\n this.onDrawCreate,\n );\n this.onDrawCreate = undefined;\n }\n\n if (this.draw) {\n this.draw.deleteAll();\n this.map.removeControl(this.draw);\n this.draw = undefined;\n }\n\n this.unlockInteractions();\n }\n\n /**\n * Disable pan/zoom handlers so the viewport stays fixed while the user draws (drag, wheel and pinch stay on with\n * `keepPanZoom`). Saves the prior enabled-state for each handler so it can be restored by\n * `unlockInteractions`. Safe to call repeatedly — a second call is a no-op\n * because saved state is only captured on the first lock.\n */\n private lockInteractions(keepPanZoom: boolean): void {\n if (this.savedInteractions) {\n return;\n }\n\n this.savedInteractions = {\n dragPan: this.map.dragPan.isEnabled(),\n scrollZoom: this.map.scrollZoom.isEnabled(),\n boxZoom: this.map.boxZoom.isEnabled(),\n doubleClickZoom: this.map.doubleClickZoom.isEnabled(),\n touchZoomRotate: this.map.touchZoomRotate.isEnabled(),\n keyboard: this.map.keyboard.isEnabled(),\n };\n\n if (!keepPanZoom) {\n this.map.dragPan.disable();\n this.map.scrollZoom.disable();\n this.map.touchZoomRotate.disable();\n }\n\n this.map.boxZoom.disable();\n this.map.doubleClickZoom.disable();\n this.map.keyboard.disable();\n }\n\n /**\n * Restore every pan/zoom handler to the enabled-state captured by\n * `lockInteractions`. No-op when interactions were never locked.\n */\n private unlockInteractions(): void {\n if (!this.savedInteractions) {\n return;\n }\n\n const prev = this.savedInteractions;\n\n if (prev.dragPan) this.map.dragPan.enable();\n if (prev.scrollZoom) this.map.scrollZoom.enable();\n if (prev.boxZoom) this.map.boxZoom.enable();\n if (prev.doubleClickZoom) this.map.doubleClickZoom.enable();\n if (prev.touchZoomRotate) this.map.touchZoomRotate.enable();\n if (prev.keyboard) this.map.keyboard.enable();\n\n this.savedInteractions = undefined;\n }\n\n /** Remove every polygon the user has drawn, keeping draw mode active. */\n public clearDrawnPolygons(): void {\n this.draw?.deleteAll();\n }\n\n\n // The GeoJSON source under `sourceId` (it has the cluster calls), or null when it is missing or another kind.\n private clusterSourceOf(sourceId: string): mapboxgl.GeoJSONSource | null {\n const source = this.map.getSource(sourceId) as { getClusterLeaves?: unknown } | undefined;\n\n return source && typeof source.getClusterLeaves === 'function' ? source as unknown as mapboxgl.GeoJSONSource : null;\n }\n\n private notClusteredError(sourceId: string): Error {\n return new Error(`Source '${sourceId}' is not a clustered GeoJSON source or is missing.`);\n }\n\n private insetOf(insets: MapInsets, side: keyof PaddingOptions): number {\n return typeof insets === 'number' ? insets : insets[side] ?? 0;\n }\n\n /** `isStyleLoaded()` also waits for tiles; what addSource needs is mapbox's one-shot \"style parsed\" flag. */\n private isStyleParsed(): boolean {\n return this.map.isStyleLoaded() || !!(this.map as unknown as { style?: { _loaded?: boolean } }).style?._loaded;\n }\n\n /** Fetch a URL into an `HTMLImageElement`. Resolves on `load`, rejects on `error`. */\n private loadImage(url: string): Promise<HTMLImageElement> {\n return new Promise((res, rej) => {\n const img = new Image();\n\n img.onload = () => res(img);\n img.onerror = rej;\n img.src = url;\n });\n }\n\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n effect,\n inject,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport type mapboxgl from 'mapbox-gl';\nimport type { StyleSpecification } from 'mapbox-gl';\n\nimport { MapboxService } from '../mapbox.service';\n\n/**\n * Thin host component that mounts a Mapbox map into a container div, forwards\n * lifecycle/events from `MapboxService`, and cleans up on destroy.\n *\n * Consumers interact with the underlying map via the public `map` (MapboxService)\n * instance — use `viewChild(ApexMapComponent)` in a parent to reach `component.map`\n * and call `addSource()`, `addLayer()`, `moveCenter()`, etc.\n *\n * Example:\n * <apex-map [center]=\"[-80.84, 35.22]\" [zoom]=\"11\" (mapReady)=\"onReady()\"/>\n */\n\n@Component({\n selector: 'apex-map',\n standalone: true,\n templateUrl: './apex-map.component.html',\n styleUrls: ['./apex-map.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\n\nexport class ApexMapComponent {\n\n public center = input<[number, number]>([-80.8431, 35.2271]);\n public zoom = input<number>(10);\n public mapStyle = input<string | StyleSpecification | undefined>(undefined);\n public maxBounds = input<mapboxgl.LngLatBoundsLike | undefined>(undefined);\n public showNavigation = input<boolean>(true);\n\n public mapReady = output<void>();\n public mapClick = output<mapboxgl.MapMouseEvent>();\n public featureClick = output<mapboxgl.MapMouseEvent>();\n\n readonly map = inject(MapboxService);\n\n private readonly platformId = inject(PLATFORM_ID);\n private readonly destroyRef = inject(DestroyRef);\n private readonly container = viewChild.required<ElementRef<HTMLElement>>('container');\n\n /**\n * Wire a reactive effect that emits `mapReady` once the underlying Mapbox\n * `load` event fires and `MapboxService.ready()` flips to `true`.\n */\n constructor() {\n effect(() => {\n if (this.map.ready()) {\n this.mapReady.emit();\n }\n });\n }\n\n /**\n * Initialise the Mapbox instance into the `#container` div, forward\n * `mapClick`/`featureClick` streams as component outputs, and register\n * teardown so the map is destroyed with the component.\n * No-op on non-browser platforms (SSR).\n */\n public ngAfterViewInit(): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n this.map.init({\n container: this.container().nativeElement,\n center: this.center(),\n zoom: this.zoom(),\n mapStyle: this.mapStyle(),\n maxBounds: this.maxBounds(),\n showNavigation: this.showNavigation(),\n });\n\n this.map.mapClick\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((e) => this.mapClick.emit(e));\n\n this.map.featureClick\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((e) => this.featureClick.emit(e));\n\n this.destroyRef.onDestroy(() => this.map.deactivate(this.container().nativeElement));\n }\n\n}\n","<div #container class=\"apex-map__container\"></div>\n","import { Directive, ElementRef, OnDestroy, inject } from '@angular/core';\n\nimport { MapboxService } from './mapbox.service';\n\n/**\n * A trackpad pinch arrives as a ctrl+wheel. Over anything laid on the map (a card, the map's buttons, a legend, a top\n * bar) it would zoom the page; this hands it to the shared map under it instead. Put it on the overlay itself, or on a\n * container holding the map and its overlays.\n */\n@Directive({\n selector: '[apexMapPinchZoom]',\n standalone: true,\n})\nexport class ApexMapPinchZoomDirective implements OnDestroy {\n\n constructor() {\n // Not passive, so the pinch can stop the page from zooming.\n this.host.nativeElement.addEventListener('wheel', this.onWheel, { passive: false });\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly map = inject(MapboxService);\n\n /** Stops listening. */\n public ngOnDestroy(): void {\n this.host.nativeElement.removeEventListener('wheel', this.onWheel);\n }\n\n private readonly onWheel = (event: WheelEvent): void => {\n // Taken already (mapbox over its own canvas, an overlay nested in this one), or our own re-dispatch (untrusted).\n if (!event.ctrlKey || !event.isTrusted || event.defaultPrevented || !this.holdsShownMap()) {\n return;\n }\n\n const rawMap = this.map.getMap();\n\n if (!rawMap?.scrollZoom.isEnabled()) {\n return;\n }\n\n // Only over the map itself, measured on its container: the canvas container mapbox listens on has no height.\n const rect = rawMap.getContainer().getBoundingClientRect();\n\n if (event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom) {\n return;\n }\n\n event.preventDefault();\n\n rawMap.getCanvasContainer().dispatchEvent(new WheelEvent('wheel', {\n bubbles: true,\n cancelable: true,\n ctrlKey: true,\n shiftKey: event.shiftKey,\n clientX: event.clientX,\n clientY: event.clientY,\n deltaX: event.deltaX,\n deltaY: event.deltaY,\n deltaMode: event.deltaMode,\n }));\n };\n\n // The one map moves between surfaces: zoom it only while it is shown inside this element (a container) or inside the\n // element this one is positioned in (a card anchored over the map).\n private holdsShownMap(): boolean {\n const host = this.host.nativeElement;\n const anchor = host.offsetParent;\n\n return this.map.isShownIn(host) || (anchor !== null && this.map.isShownIn(anchor));\n }\n\n}\n","import { signal } from '@angular/core';\n\nimport { MapGeolocationUtil, type MapLngLat, type MapLocateOptions, type MapLocateResult } from '@apexara/map/geo';\n\nimport type * as GeoJSON from 'geojson';\n\nimport type { MapboxService } from './mapbox.service';\nimport { MapUserLocationConfig, MapUserLocationStyle } from './map.types';\n\n/**\n * The reader's location as a dot on the map, in the consumer's `style`, and the camera move to it at the consumer's\n * `zoom`. Not injectable: a map surface builds one with the `MapboxService` it draws on, repaints it after a style swap\n * and destroys it on teardown.\n */\nexport class MapUserLocationLayer {\n\n constructor(\n private readonly map: MapboxService,\n config: MapUserLocationConfig) {\n this.sourceId = config.sourceId ?? 'user-location';\n this.layerId = config.layerId ?? 'user-location-dot';\n this.zoom = config.zoom;\n this.style = { ...config.style };\n }\n\n /** The last location read, as `[lng, lat]`; null until one is. */\n public readonly location = signal<MapLngLat | null>(null);\n\n private readonly sourceId: string;\n private readonly layerId: string;\n private readonly zoom: number;\n private readonly style: MapUserLocationStyle;\n\n /** Reads the location once and draws the dot; the camera stays where it is. */\n public async init(options?: MapLocateOptions): Promise<MapLocateResult> {\n const result = await MapGeolocationUtil.locate(options);\n\n if (result.status === 'located') {\n this.location.set(result.position);\n this.repaint();\n }\n\n return result;\n }\n\n /** Flies to the location (at the configured zoom), reading it first when none is known yet. */\n public async locate(options?: MapLocateOptions): Promise<MapLocateResult> {\n const known = this.location();\n\n if (known) {\n this.map.moveCenter(known, this.zoom);\n\n return { status: 'located', position: known };\n }\n\n const result = await this.init(options);\n\n if (result.status === 'located') {\n this.map.moveCenter(result.position, this.zoom);\n }\n\n return result;\n }\n\n /** Puts the dot (back) on the map, e.g. after a style swap. No-op until a location is known. */\n public repaint(): void {\n const position = this.location();\n\n if (!position) {\n return;\n }\n\n this.map.upsertSource({ id: this.sourceId, data: this.pointOf(position) });\n\n if (this.map.hasLayer(this.layerId)) {\n return;\n }\n\n this.map.addLayer({\n id: this.layerId,\n type: 'circle',\n source: this.sourceId,\n paint: {\n 'circle-radius': this.style.circleRadius,\n 'circle-color': this.style.circleColor,\n 'circle-stroke-color': this.style.strokeColor,\n 'circle-stroke-width': this.style.strokeWidth,\n },\n });\n }\n\n /** Takes the dot off the map; the location is kept for the next `repaint`. */\n public destroy(): void {\n this.map.safeRemoveLayer(this.layerId);\n\n if (this.map.hasSource(this.sourceId)) {\n this.map.removeSource(this.sourceId);\n }\n }\n\n private pointOf(position: MapLngLat): GeoJSON.FeatureCollection<GeoJSON.Point> {\n return {\n type: 'FeatureCollection',\n features: [{ type: 'Feature', geometry: { type: 'Point', coordinates: position }, properties: {} }],\n };\n }\n\n}\n","import type mapboxgl from 'mapbox-gl';\nimport type { Position } from 'geojson';\n\nimport { MapGeometryUtil, type MapBoundsOptions } from '@apexara/map/geo';\n\ntype Coord = [number, number];\n\n/**\n * Recursively flatten any nesting of GeoJSON coordinates down to a flat list of [lng, lat] pairs.\n * Handles Point, LineString, Polygon, and MultiPolygon coordinate shapes uniformly.\n */\nexport function flattenCoords(arr: Position | Position[] | Position[][] | Position[][][]): Coord[] {\n const out: Coord[] = [];\n\n MapGeometryUtil.forEachPosition(arr, (position) => out.push(position as Coord));\n\n return out;\n}\n\n/**\n * Compute the [[minLng, minLat], [maxLng, maxLat]] bounds of a flat list of coordinates, compatible with\n * `mapboxgl.LngLatBoundsLike`. `wrapAntimeridian` frames a shape across ±180° by its narrower side. No coordinates give\n * `[[180, 90], [-180, -90]]`. For whole GeoJSON, `MapGeometryUtil.boundsOf` walks it without flattening.\n */\nexport function calculateBounds(coords: Coord[], options?: MapBoundsOptions): mapboxgl.LngLatBoundsLike {\n return MapGeometryUtil.boundsOf({ type: 'MultiPoint', coordinates: coords }, options) ?? [[180, 90], [-180, -90]];\n}\n\n/**\n * Build a closed square polygon of side `2 * radiusKm` centered at `center`.\n * Useful when you need a small viewport-like polygon for point-in-polygon queries.\n */\nexport function calculateViewportPolygonFromCenter(center: Coord, radiusKm = 0.5): number[][][] {\n const [lng, lat] = center;\n\n const degreesPerMeterLng = 1 / (111320 * Math.cos((lat * Math.PI) / 180));\n const degreesPerMeterLat = 1 / 110540;\n\n const radiusMeters = radiusKm * 1000;\n const lngDelta = radiusMeters * degreesPerMeterLng;\n const latDelta = radiusMeters * degreesPerMeterLat;\n\n return [\n [\n [lng - lngDelta, lat - latDelta],\n [lng + lngDelta, lat - latDelta],\n [lng + lngDelta, lat + latDelta],\n [lng - lngDelta, lat + latDelta],\n [lng - lngDelta, lat - latDelta],\n ],\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AA2BA;;;;;;;;;;;;AAYG;AAEH;AACA;AACA;AACA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAuC;MAGpD,aAAa,CAAA;AAD1B,IAAA,WAAA,GAAA;;AAIS,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,OAAO,EAA0B;;AAGhD,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAA0B;;AAGpD,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,OAAO,EAAoC;AAErD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAU,KAAK,kDAAC;;AAGhC,Q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ChC,YAAA,CAAC,GAAG,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,CAAC;AAChC,YAAA,CAAC,GAAG,GAAG,QAAQ,EAAE,GAAG,GAAG,QAAQ,CAAC;AACjC,SAAA;KACF;AACH;;ACnDA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexara/map",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=21.2.0",
@@ -54,5 +54,5 @@
54
54
  "default": "./fesm2022/apexara-map-search.mjs"
55
55
  }
56
56
  },
57
- "gitHead": "7991b10400fc8a2215a08618bfa8325a6ade565a"
57
+ "gitHead": "24e01801a5ad0cd07d3d65f7c980be6afc99d2ca"
58
58
  }
@@ -180,6 +180,7 @@ declare class MapboxService {
180
180
  /**
181
181
  * Fit the viewport to `bounds`. A number is the padding (default 40) of a one-second slide; options (`padding` per
182
182
  * side, `maxZoom`, `duration`, `animate: false`, …) lay over those same defaults. `eventData` reaches the move's events.
183
+ * The padding frames this fit only and the map's own padding stays as it was; `retainPadding: true` keeps it instead.
183
184
  */
184
185
  fitBounds(bounds: mapboxgl.LngLatBoundsLike, options?: number | MapFitOptions, eventData?: MapEventData): void;
185
186
  /** Fly the camera (mapbox's `flyTo`: `center`, `zoom`, `duration`, `curve`, `offset`, …). */