@apexara/map 1.1.0 → 1.1.1
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 +12 -1
- package/fesm2022/apexara-map.mjs +32 -7
- package/fesm2022/apexara-map.mjs.map +1 -1
- package/package.json +1 -1
- package/types/apexara-map.d.ts +9 -1
package/README.md
CHANGED
|
@@ -199,6 +199,13 @@ constructor() {
|
|
|
199
199
|
One `mapboxgl.Map` serves every consumer: the service re-parents it between containers (`activate` / `deactivate`)
|
|
200
200
|
instead of building a new one.
|
|
201
201
|
|
|
202
|
+
- `isSupported()` — whether this browser can run mapbox (WebGL2, workers, canvas reads). Asked once and kept; `false`
|
|
203
|
+
on the server. Check it before taking the map from another container.
|
|
204
|
+
- `activate(container, options)` — puts the map on `container` and returns `true`. Returns `false` when it did not
|
|
205
|
+
start: on the server, when `isSupported()` is false, or when the first start throws (some browsers pass the check
|
|
206
|
+
and still fail, e.g. at their limit of WebGL contexts). A failed start takes its host div back out of the container
|
|
207
|
+
and logs the error, so the consumer shows its own message in the box instead of a blank page. An error from a map
|
|
208
|
+
that is already running (a bad centre on a hand-off) still throws.
|
|
202
209
|
- `getMap()` — the live `mapboxgl.Map`, for mapbox APIs the service does not wrap (`jumpTo` with event data,
|
|
203
210
|
`getCanvas`, `scrollZoom`, …). `undefined` until the first `init` / `activate`. Use it instead of reaching into the
|
|
204
211
|
service's private field.
|
|
@@ -361,7 +368,9 @@ runtime images go with it.
|
|
|
361
368
|
|
|
362
369
|
### Teardown
|
|
363
370
|
|
|
364
|
-
|
|
371
|
+
The shared map is never destroyed. `deactivate(container)` takes it off `container`: it moves back to the container
|
|
372
|
+
that held it before, or waits hidden until the next `activate`. `<apex-map>` calls it through `DestroyRef`, so call it
|
|
373
|
+
yourself only for a container you passed to `activate()` / `init()`.
|
|
365
374
|
|
|
366
375
|
---
|
|
367
376
|
|
|
@@ -469,6 +478,7 @@ map.setStyle(MapStyles.DarkV11);
|
|
|
469
478
|
## SSR notes
|
|
470
479
|
|
|
471
480
|
- `MapboxService.init` is a no-op on the server, and `<apex-map>` guards its `ngAfterViewInit` with `isPlatformBrowser`, so the component renders an empty container during SSR without throwing.
|
|
481
|
+
- `activate` returns `false` on the server and `isSupported()` is `false` there: a consumer that shows a "can't show maps" message on `false` should show it only in the browser.
|
|
472
482
|
- Avoid calling mutating methods (`addSource`, `addLayer`, etc.) during SSR — gate them on `map.ready()`.
|
|
473
483
|
|
|
474
484
|
---
|
|
@@ -476,6 +486,7 @@ map.setStyle(MapStyles.DarkV11);
|
|
|
476
486
|
## Troubleshooting
|
|
477
487
|
|
|
478
488
|
- **Blank map** — the container has no height. Give `<apex-map>` an explicit size.
|
|
489
|
+
- **`activate` returns `false` in a browser** — the browser cannot run mapbox (no WebGL2, hardware acceleration off) or the first start failed; the console shows `[@apexara/map] The map failed to start.` with mapbox's error for the second case.
|
|
479
490
|
- **`401 Unauthorized` tiles** — the access token passed to `provideMap` is wrong or not a public (`pk.*`) token.
|
|
480
491
|
- **Sources/layers disappear after `setStyle`** — Mapbox replaces the entire style. Re-add them in a `styledata` listener.
|
|
481
492
|
- **`setFeatureState` does nothing** — the source was added without `generateId: true` and features have no numeric `id`.
|
package/fesm2022/apexara-map.mjs
CHANGED
|
@@ -56,6 +56,8 @@ class MapboxService {
|
|
|
56
56
|
this.containerStack = [];
|
|
57
57
|
this._activeContainer = signal(null, ...(ngDevMode ? [{ debugName: "_activeContainer" }] : []));
|
|
58
58
|
this.activeContainer = this._activeContainer;
|
|
59
|
+
// Whether this browser can run mapbox; null until asked. Kept, since mapbox's check builds a worker and a canvas.
|
|
60
|
+
this.supported = null;
|
|
59
61
|
}
|
|
60
62
|
/** Back-compat wrapper around `activate`. SSR-safe. */
|
|
61
63
|
async init(options) {
|
|
@@ -64,15 +66,21 @@ class MapboxService {
|
|
|
64
66
|
}
|
|
65
67
|
this.activate(options.container, options);
|
|
66
68
|
}
|
|
69
|
+
/** Whether this browser can run mapbox (WebGL2, workers, canvas reads). Asked once; false on the server. */
|
|
70
|
+
isSupported() {
|
|
71
|
+
this.supported ??= isPlatformBrowser(this.platformId) && mapboxgl.supported();
|
|
72
|
+
return this.supported;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Puts the shared map on `container`. False when it did not start there: on the server, in a browser that cannot run
|
|
76
|
+
* mapbox, or when the first start throws (undone and reported). A running map's errors still throw.
|
|
77
|
+
*/
|
|
67
78
|
activate(container, options) {
|
|
68
|
-
if (!
|
|
69
|
-
return;
|
|
79
|
+
if (!this.isSupported()) {
|
|
80
|
+
return false;
|
|
70
81
|
}
|
|
71
82
|
if (!this.mapInitialised) {
|
|
72
|
-
this.
|
|
73
|
-
this.containerStack.push(container);
|
|
74
|
-
this._activeContainer.set(container);
|
|
75
|
-
return;
|
|
83
|
+
return this.startMap(container, options);
|
|
76
84
|
}
|
|
77
85
|
const active = this._activeContainer();
|
|
78
86
|
if (active === container) {
|
|
@@ -80,7 +88,7 @@ class MapboxService {
|
|
|
80
88
|
this.map.jumpTo({ center: options.center, zoom: options.zoom ?? this.map.getZoom() });
|
|
81
89
|
}
|
|
82
90
|
requestAnimationFrame(() => this.map.resize());
|
|
83
|
-
return;
|
|
91
|
+
return true;
|
|
84
92
|
}
|
|
85
93
|
this.hostDiv?.remove();
|
|
86
94
|
if (this.hostDiv) {
|
|
@@ -94,6 +102,7 @@ class MapboxService {
|
|
|
94
102
|
this.map.jumpTo({ center: options.center, zoom: options.zoom ?? this.map.getZoom() });
|
|
95
103
|
}
|
|
96
104
|
requestAnimationFrame(() => this.map.resize());
|
|
105
|
+
return true;
|
|
97
106
|
}
|
|
98
107
|
deactivate(container) {
|
|
99
108
|
if (!isPlatformBrowser(this.platformId)) {
|
|
@@ -119,6 +128,22 @@ class MapboxService {
|
|
|
119
128
|
}
|
|
120
129
|
this._activeContainer.set(null);
|
|
121
130
|
}
|
|
131
|
+
// The first start. It can pass isSupported and still throw (e.g. at the browser's limit of WebGL contexts) after its
|
|
132
|
+
// host div went into the container: the div comes back out, so the container is left as it was.
|
|
133
|
+
startMap(container, options) {
|
|
134
|
+
try {
|
|
135
|
+
this.createMap(container, options);
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
this.hostDiv?.remove();
|
|
139
|
+
this.hostDiv = null;
|
|
140
|
+
console.error('[@apexara/map] The map failed to start.', error);
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
this.containerStack.push(container);
|
|
144
|
+
this._activeContainer.set(container);
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
122
147
|
createMap(container, options) {
|
|
123
148
|
const defaultBounds = [
|
|
124
149
|
[-175, -85],
|
|
@@ -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/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, { LayerSpecification } 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 { MapImageOptions, MapImageSource, MapInitOptions, SourceConfig } 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 /** 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 public activate(container: HTMLElement, options: MapInitOptions): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n if (!this.mapInitialised) {\n this.createMap(container, options);\n this.containerStack.push(container);\n this._activeContainer.set(container);\n return;\n }\n\n const active = this._activeContainer();\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 return;\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\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 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.map.getSource(sourceId) as unknown as {\n getClusterLeaves?: (\n clusterId: number,\n limit: number,\n offset: number,\n callback: (err: unknown, features: mapboxgl.GeoJSONFeature[]) => void,\n ) => void;\n };\n\n if (!src || typeof src.getClusterLeaves !== 'function') {\n reject(\n new Error(`Source '${sourceId}' is not a clustered GeoJSON source or is missing.`),\n );\n\n return;\n }\n\n src.getClusterLeaves(clusterId, limit, offset, (err, features) => {\n if (err) {\n reject(err);\n } else {\n resolve(features);\n }\n });\n });\n }\n\n /**\n * Query features rendered at a screen point, optionally restricted to specific layers.\n * Returns `[]` when the map has not been initialised yet.\n */\n public getRenderedFeatures(point: mapboxgl.PointLike, params?: { layers?: string[] }): mapboxgl.GeoJSONFeature[] {\n return this.map ? this.map.queryRenderedFeatures(point, params) : [];\n }\n\n /** Swap the base style. Custom sources/layers you added must be re-applied after `styledata`. */\n public setStyle(styleUrl: string): void {\n const cachedStyle = styleCache.get(styleUrl);\n this.map.setStyle((cachedStyle ?? styleUrl) as string);\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). */\n public moveCenter(center: [number, number], zoom = 13): void {\n this.map.flyTo({ center, zoom });\n }\n\n /** Fit the viewport to `bounds` with optional pixel padding (default 40). */\n public fitBounds(bounds: mapboxgl.LngLatBoundsLike, padding = 40): void {\n this.map.fitBounds(bounds, { padding, duration: 1000 });\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 /** Replace the data of an existing GeoJSON source in place. No-op if the source is missing. */\n public updateSource(id: string, data: GeoJSON.FeatureCollection): 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 /** `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`.\n */\n public enableDrawPolygon(): 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();\n\n this.draw.changeMode('draw_polygon');\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.\n * 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(): 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 this.map.dragPan.disable();\n this.map.scrollZoom.disable();\n this.map.boxZoom.disable();\n this.map.doubleClickZoom.disable();\n this.map.touchZoomRotate.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 /** `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 type mapboxgl from 'mapbox-gl';\nimport type { Position } from 'geojson';\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 const recurse = (node: unknown): void => {\n if (\n Array.isArray(node) &&\n typeof node[0] === 'number' &&\n typeof node[1] === 'number'\n ) {\n out.push(node as Coord);\n } else if (Array.isArray(node)) {\n node.forEach(recurse);\n }\n };\n\n recurse(arr);\n\n return out;\n}\n\n/**\n * Compute the [[minLng, minLat], [maxLng, maxLat]] bounds of a flat list of coordinates.\n * Return value is compatible with `mapboxgl.LngLatBoundsLike`.\n */\nexport function calculateBounds(coords: Coord[]): mapboxgl.LngLatBoundsLike {\n let minX = 180;\n let minY = 90;\n let maxX = -180;\n let maxY = -90;\n\n coords.forEach(([lng, lat]) => {\n if (lng < minX) minX = lng;\n if (lng > maxX) maxX = lng;\n if (lat < minY) minY = lat;\n if (lat > maxY) maxY = lat;\n });\n\n return [\n [minX, minY],\n [maxX, maxY],\n ];\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":";;;;;;;;;;AAeA;;;;;;;;;;;;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,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;;;;QAQzC,IAAA,CAAA,OAAO,GAA0B,IAAI;QAErC,IAAA,CAAA,cAAc,GAAkB,EAAE;AAEzB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
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/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, { LayerSpecification } 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 { MapImageOptions, MapImageSource, MapInitOptions, SourceConfig } 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 /** 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.map.getSource(sourceId) as unknown as {\n getClusterLeaves?: (\n clusterId: number,\n limit: number,\n offset: number,\n callback: (err: unknown, features: mapboxgl.GeoJSONFeature[]) => void,\n ) => void;\n };\n\n if (!src || typeof src.getClusterLeaves !== 'function') {\n reject(\n new Error(`Source '${sourceId}' is not a clustered GeoJSON source or is missing.`),\n );\n\n return;\n }\n\n src.getClusterLeaves(clusterId, limit, offset, (err, features) => {\n if (err) {\n reject(err);\n } else {\n resolve(features);\n }\n });\n });\n }\n\n /**\n * Query features rendered at a screen point, optionally restricted to specific layers.\n * Returns `[]` when the map has not been initialised yet.\n */\n public getRenderedFeatures(point: mapboxgl.PointLike, params?: { layers?: string[] }): mapboxgl.GeoJSONFeature[] {\n return this.map ? this.map.queryRenderedFeatures(point, params) : [];\n }\n\n /** Swap the base style. Custom sources/layers you added must be re-applied after `styledata`. */\n public setStyle(styleUrl: string): void {\n const cachedStyle = styleCache.get(styleUrl);\n this.map.setStyle((cachedStyle ?? styleUrl) as string);\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). */\n public moveCenter(center: [number, number], zoom = 13): void {\n this.map.flyTo({ center, zoom });\n }\n\n /** Fit the viewport to `bounds` with optional pixel padding (default 40). */\n public fitBounds(bounds: mapboxgl.LngLatBoundsLike, padding = 40): void {\n this.map.fitBounds(bounds, { padding, duration: 1000 });\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 /** Replace the data of an existing GeoJSON source in place. No-op if the source is missing. */\n public updateSource(id: string, data: GeoJSON.FeatureCollection): 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 /** `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`.\n */\n public enableDrawPolygon(): 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();\n\n this.draw.changeMode('draw_polygon');\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.\n * 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(): 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 this.map.dragPan.disable();\n this.map.scrollZoom.disable();\n this.map.boxZoom.disable();\n this.map.doubleClickZoom.disable();\n this.map.touchZoomRotate.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 /** `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 type mapboxgl from 'mapbox-gl';\nimport type { Position } from 'geojson';\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 const recurse = (node: unknown): void => {\n if (\n Array.isArray(node) &&\n typeof node[0] === 'number' &&\n typeof node[1] === 'number'\n ) {\n out.push(node as Coord);\n } else if (Array.isArray(node)) {\n node.forEach(recurse);\n }\n };\n\n recurse(arr);\n\n return out;\n}\n\n/**\n * Compute the [[minLng, minLat], [maxLng, maxLat]] bounds of a flat list of coordinates.\n * Return value is compatible with `mapboxgl.LngLatBoundsLike`.\n */\nexport function calculateBounds(coords: Coord[]): mapboxgl.LngLatBoundsLike {\n let minX = 180;\n let minY = 90;\n let maxX = -180;\n let maxY = -90;\n\n coords.forEach(([lng, lat]) => {\n if (lng < minX) minX = lng;\n if (lng > maxX) maxX = lng;\n if (lat < minY) minY = lat;\n if (lat > maxY) maxY = lat;\n });\n\n return [\n [minX, minY],\n [maxX, maxY],\n ];\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":";;;;;;;;;;AAeA;;;;;;;;;;;;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,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;;;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AAI,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;;AC3EA;;AAEG;;;;"}
|
package/package.json
CHANGED
package/types/apexara-map.d.ts
CHANGED
|
@@ -70,10 +70,18 @@ declare class MapboxService {
|
|
|
70
70
|
private containerStack;
|
|
71
71
|
private readonly _activeContainer;
|
|
72
72
|
readonly activeContainer: Signal<HTMLElement | null>;
|
|
73
|
+
private supported;
|
|
73
74
|
/** Back-compat wrapper around `activate`. SSR-safe. */
|
|
74
75
|
init(options: MapInitOptions): Promise<void>;
|
|
75
|
-
|
|
76
|
+
/** Whether this browser can run mapbox (WebGL2, workers, canvas reads). Asked once; false on the server. */
|
|
77
|
+
isSupported(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Puts the shared map on `container`. False when it did not start there: on the server, in a browser that cannot run
|
|
80
|
+
* mapbox, or when the first start throws (undone and reported). A running map's errors still throw.
|
|
81
|
+
*/
|
|
82
|
+
activate(container: HTMLElement, options: MapInitOptions): boolean;
|
|
76
83
|
deactivate(container: HTMLElement): void;
|
|
84
|
+
private startMap;
|
|
77
85
|
private createMap;
|
|
78
86
|
/** Current map center as a `LngLat`. Prefer the `center` signal for reactive reads. */
|
|
79
87
|
getCenter(): mapboxgl.LngLat;
|