isard 1.0.0 → 1.2.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/CHANGELOG.md +51 -0
- package/dist/{basemaps.d.ts → basemap/basemaps.d.ts} +3 -3
- package/dist/{basemaps.js → basemap/basemaps.js} +3 -3
- package/dist/basemap/basemaps.js.map +1 -0
- package/dist/{grid.d.ts → basemap/grid.d.ts} +6 -6
- package/dist/{grid.js → basemap/grid.js} +61 -67
- package/dist/basemap/grid.js.map +1 -0
- package/dist/{mvt.d.ts → basemap/mvt.d.ts} +1 -1
- package/dist/{mvt.js → basemap/mvt.js} +6 -6
- package/dist/basemap/mvt.js.map +1 -0
- package/dist/{pmtiles.d.ts → basemap/pmtiles.d.ts} +16 -10
- package/dist/{pmtiles.js → basemap/pmtiles.js} +41 -33
- package/dist/basemap/pmtiles.js.map +1 -0
- package/dist/{resample.d.ts → basemap/resample.d.ts} +11 -2
- package/dist/{resample.js → basemap/resample.js} +18 -16
- package/dist/basemap/resample.js.map +1 -0
- package/dist/{terrain.d.ts → basemap/terrain.d.ts} +3 -3
- package/dist/{terrain.js → basemap/terrain.js} +7 -7
- package/dist/basemap/terrain.js.map +1 -0
- package/dist/{vectorstyle.d.ts → basemap/vectorstyle.d.ts} +12 -10
- package/dist/{vectorstyle.js → basemap/vectorstyle.js} +129 -111
- package/dist/basemap/vectorstyle.js.map +1 -0
- package/dist/{vectortiles.d.ts → basemap/vectortiles.d.ts} +18 -18
- package/dist/{vectortiles.js → basemap/vectortiles.js} +157 -109
- package/dist/basemap/vectortiles.js.map +1 -0
- package/dist/{wmts.d.ts → basemap/wmts.d.ts} +3 -3
- package/dist/{wmts.js → basemap/wmts.js} +19 -14
- package/dist/basemap/wmts.js.map +1 -0
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +14 -13
- package/dist/bind/layers.d.ts +46 -0
- package/dist/bind/layers.js +154 -0
- package/dist/bind/layers.js.map +1 -0
- package/dist/{crs.d.ts → data/crs.d.ts} +11 -11
- package/dist/{crs.js → data/crs.js} +38 -34
- package/dist/data/crs.js.map +1 -0
- package/dist/{gpx.d.ts → data/gpx.d.ts} +2 -2
- package/dist/{gpx.js → data/gpx.js} +20 -20
- package/dist/data/gpx.js.map +1 -0
- package/dist/{kml.d.ts → data/kml.d.ts} +2 -2
- package/dist/{kml.js → data/kml.js} +42 -39
- package/dist/data/kml.js.map +1 -0
- package/dist/{topojson.d.ts → data/topojson.d.ts} +2 -2
- package/dist/{topojson.js → data/topojson.js} +15 -10
- package/dist/data/topojson.js.map +1 -0
- package/dist/{xml.d.ts → data/xml.d.ts} +5 -5
- package/dist/{xml.js → data/xml.js} +19 -18
- package/dist/data/xml.js.map +1 -0
- package/dist/decoder.worker.js +4 -4
- package/dist/decoder.worker.js.map +7 -7
- package/dist/{decoders.d.ts → engine/decoders.d.ts} +3 -3
- package/dist/{decoders.js → engine/decoders.js} +28 -25
- package/dist/engine/decoders.js.map +1 -0
- package/dist/{loader.d.ts → engine/loader.d.ts} +1 -1
- package/dist/{loader.js → engine/loader.js} +17 -14
- package/dist/engine/loader.js.map +1 -0
- package/dist/{protocol.d.ts → engine/protocol.d.ts} +1 -1
- package/dist/engine/protocol.js +3 -0
- package/dist/engine/protocol.js.map +1 -0
- package/dist/{requests.d.ts → engine/requests.d.ts} +1 -1
- package/dist/{requests.js → engine/requests.js} +19 -16
- package/dist/engine/requests.js.map +1 -0
- package/dist/engine-loader.d.ts +13 -9
- package/dist/engine-loader.js +30 -30
- package/dist/engine-loader.js.map +1 -1
- package/dist/formats.d.ts +3 -3
- package/dist/formats.js +3 -3
- package/dist/formats.js.map +1 -1
- package/dist/geoplateforme.d.ts +13 -13
- package/dist/geoplateforme.js +23 -21
- package/dist/geoplateforme.js.map +1 -1
- package/dist/index.d.ts +30 -29
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/isard_bg.wasm +0 -0
- package/dist/isard_core_bg.wasm +0 -0
- package/dist/isard_points_bg.wasm +0 -0
- package/dist/{extrusions.d.ts → layers/extrusions.d.ts} +1 -1
- package/dist/{extrusions.js → layers/extrusions.js} +10 -5
- package/dist/layers/extrusions.js.map +1 -0
- package/dist/{features.d.ts → layers/features.d.ts} +10 -10
- package/dist/{features.js → layers/features.js} +44 -45
- package/dist/layers/features.js.map +1 -0
- package/dist/{glyphs.d.ts → layers/glyphs.d.ts} +6 -6
- package/dist/{glyphs.js → layers/glyphs.js} +45 -41
- package/dist/layers/glyphs.js.map +1 -0
- package/dist/{icons.d.ts → layers/icons.d.ts} +10 -10
- package/dist/{icons.js → layers/icons.js} +84 -69
- package/dist/layers/icons.js.map +1 -0
- package/dist/{layers.d.ts → layers/layers.d.ts} +9 -4
- package/dist/{layers.js → layers/layers.js} +35 -31
- package/dist/layers/layers.js.map +1 -0
- package/dist/{panoramas.d.ts → layers/panoramas.d.ts} +3 -3
- package/dist/{panoramas.js → layers/panoramas.js} +54 -43
- package/dist/layers/panoramas.js.map +1 -0
- package/dist/{pointclouds.d.ts → layers/pointclouds.d.ts} +5 -5
- package/dist/{pointclouds.js → layers/pointclouds.js} +26 -34
- package/dist/layers/pointclouds.js.map +1 -0
- package/dist/{symbols.d.ts → layers/symbols.d.ts} +3 -3
- package/dist/{symbols.js → layers/symbols.js} +69 -72
- package/dist/layers/symbols.js.map +1 -0
- package/dist/map/basemap-layers.d.ts +26 -0
- package/dist/map/basemap-layers.js +61 -0
- package/dist/map/basemap-layers.js.map +1 -0
- package/dist/map/canvas.d.ts +17 -0
- package/dist/map/canvas.js +56 -0
- package/dist/map/canvas.js.map +1 -0
- package/dist/map/checks.d.ts +11 -0
- package/dist/map/checks.js +39 -0
- package/dist/map/checks.js.map +1 -0
- package/dist/map/credits.d.ts +17 -0
- package/dist/map/credits.js +34 -0
- package/dist/map/credits.js.map +1 -0
- package/dist/map/engine-settings.d.ts +15 -0
- package/dist/map/engine-settings.js +45 -0
- package/dist/map/engine-settings.js.map +1 -0
- package/dist/map/engines.d.ts +41 -0
- package/dist/map/engines.js +77 -0
- package/dist/map/engines.js.map +1 -0
- package/dist/map/events.d.ts +14 -0
- package/dist/map/events.js +46 -0
- package/dist/map/events.js.map +1 -0
- package/dist/map/frame-loop.d.ts +61 -0
- package/dist/map/frame-loop.js +139 -0
- package/dist/map/frame-loop.js.map +1 -0
- package/dist/map/hover-pick.d.ts +30 -0
- package/dist/map/hover-pick.js +56 -0
- package/dist/map/hover-pick.js.map +1 -0
- package/dist/map/layer-spec.d.ts +42 -0
- package/dist/map/layer-spec.js +34 -0
- package/dist/map/layer-spec.js.map +1 -0
- package/dist/map/layer-stack.d.ts +36 -0
- package/dist/map/layer-stack.js +101 -0
- package/dist/map/layer-stack.js.map +1 -0
- package/dist/map/overlay-host.d.ts +36 -0
- package/dist/map/overlay-host.js +101 -0
- package/dist/map/overlay-host.js.map +1 -0
- package/dist/map/panorama-host.d.ts +5 -0
- package/dist/map/panorama-host.js +32 -0
- package/dist/map/panorama-host.js.map +1 -0
- package/dist/map/raster-source.d.ts +11 -0
- package/dist/map/raster-source.js +26 -0
- package/dist/map/raster-source.js.map +1 -0
- package/dist/map/symbol-atlases.d.ts +26 -0
- package/dist/map/symbol-atlases.js +59 -0
- package/dist/map/symbol-atlases.js.map +1 -0
- package/dist/map/viewshed.d.ts +5 -0
- package/dist/map/viewshed.js +28 -0
- package/dist/map/viewshed.js.map +1 -0
- package/dist/map/workers.d.ts +46 -0
- package/dist/map/workers.js +73 -0
- package/dist/map/workers.js.map +1 -0
- package/dist/map.d.ts +46 -127
- package/dist/map.js +183 -698
- package/dist/map.js.map +1 -1
- package/dist/projections.d.ts +3 -3
- package/dist/projections.js +2 -2
- package/dist/projections.js.map +1 -1
- package/dist/react/Control.d.ts +11 -0
- package/dist/react/Control.js +18 -0
- package/dist/react/Control.js.map +1 -0
- package/dist/react/CustomLayer.d.ts +11 -0
- package/dist/react/CustomLayer.js +30 -0
- package/dist/react/CustomLayer.js.map +1 -0
- package/dist/react/IsardMap.d.ts +43 -0
- package/dist/react/IsardMap.js +146 -0
- package/dist/react/IsardMap.js.map +1 -0
- package/dist/react/Layer.d.ts +42 -0
- package/dist/react/Layer.js +74 -0
- package/dist/react/Layer.js.map +1 -0
- package/dist/react/Marker.d.ts +24 -0
- package/dist/react/Marker.js +53 -0
- package/dist/react/Marker.js.map +1 -0
- package/dist/react/Panel.d.ts +11 -0
- package/dist/react/Panel.js +37 -0
- package/dist/react/Panel.js.map +1 -0
- package/dist/react/Popup.d.ts +18 -0
- package/dist/react/Popup.js +60 -0
- package/dist/react/Popup.js.map +1 -0
- package/dist/react/Swipe.d.ts +9 -0
- package/dist/react/Swipe.js +41 -0
- package/dist/react/Swipe.js.map +1 -0
- package/dist/react/Viewshed.d.ts +5 -0
- package/dist/react/Viewshed.js +28 -0
- package/dist/react/Viewshed.js.map +1 -0
- package/dist/react/context.d.ts +32 -0
- package/dist/react/context.js +20 -0
- package/dist/react/context.js.map +1 -0
- package/dist/react/index.d.ts +26 -0
- package/dist/react/index.js +22 -0
- package/dist/react/index.js.map +1 -0
- package/dist/settings.d.ts +6 -10
- package/dist/settings.js +19 -17
- package/dist/settings.js.map +1 -1
- package/dist/types.d.ts +8 -8
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/dist/{controls.d.ts → ui/controls.d.ts} +1 -1
- package/dist/{controls.js → ui/controls.js} +6 -4
- package/dist/ui/controls.js.map +1 -0
- package/dist/{interaction.d.ts → ui/interaction.d.ts} +9 -5
- package/dist/{interaction.js → ui/interaction.js} +9 -8
- package/dist/ui/interaction.js.map +1 -0
- package/dist/{overlay.d.ts → ui/overlay.d.ts} +2 -2
- package/dist/{overlay.js → ui/overlay.js} +18 -20
- package/dist/ui/overlay.js.map +1 -0
- package/dist/{style.d.ts → ui/style.d.ts} +1 -1
- package/dist/{style.js → ui/style.js} +2 -2
- package/dist/ui/style.js.map +1 -0
- package/dist/{animation.d.ts → util/animation.d.ts} +9 -5
- package/dist/{animation.js → util/animation.js} +6 -6
- package/dist/util/animation.js.map +1 -0
- package/dist/{color.d.ts → util/color.d.ts} +1 -1
- package/dist/{color.js → util/color.js} +14 -16
- package/dist/util/color.js.map +1 -0
- package/dist/{geo.d.ts → util/geo.d.ts} +6 -6
- package/dist/{geo.js → util/geo.js} +12 -12
- package/dist/util/geo.js.map +1 -0
- package/dist/util/guards.d.ts +7 -0
- package/dist/util/guards.js +8 -0
- package/dist/util/guards.js.map +1 -0
- package/dist/util/lru.js.map +1 -0
- package/dist/wasm/isard.d.ts +168 -0
- package/dist/wasm/isard.js +146 -0
- package/dist/wasm/isard_core.d.ts +144 -0
- package/dist/wasm/isard_core.js +122 -0
- package/dist/{basemap.worker.d.ts → workers/basemap.worker.d.ts} +17 -7
- package/dist/workers/basemap.worker.js +658 -0
- package/dist/workers/basemap.worker.js.map +1 -0
- package/package.json +24 -1
- package/vite.js +1 -1
- package/dist/animation.js.map +0 -1
- package/dist/basemaps.js.map +0 -1
- package/dist/color.js.map +0 -1
- package/dist/controls.js.map +0 -1
- package/dist/crs.js.map +0 -1
- package/dist/decoders.js.map +0 -1
- package/dist/extrusions.js.map +0 -1
- package/dist/features.js.map +0 -1
- package/dist/geo.js.map +0 -1
- package/dist/glyphs.js.map +0 -1
- package/dist/gpx.js.map +0 -1
- package/dist/grid.js.map +0 -1
- package/dist/icons.js.map +0 -1
- package/dist/interaction.js.map +0 -1
- package/dist/kml.js.map +0 -1
- package/dist/layers.js.map +0 -1
- package/dist/loader.js.map +0 -1
- package/dist/lru.js.map +0 -1
- package/dist/mvt.js.map +0 -1
- package/dist/overlay.js.map +0 -1
- package/dist/panoramas.js.map +0 -1
- package/dist/pmtiles.js.map +0 -1
- package/dist/pointclouds.js.map +0 -1
- package/dist/protocol.js +0 -2
- package/dist/protocol.js.map +0 -1
- package/dist/requests.js.map +0 -1
- package/dist/resample.js.map +0 -1
- package/dist/style.js.map +0 -1
- package/dist/symbols.js.map +0 -1
- package/dist/terrain.js.map +0 -1
- package/dist/topojson.js.map +0 -1
- package/dist/vectorstyle.js.map +0 -1
- package/dist/vectortiles.js.map +0 -1
- package/dist/wmts.js.map +0 -1
- package/dist/xml.js.map +0 -1
- /package/dist/{lru.d.ts → util/lru.d.ts} +0 -0
- /package/dist/{lru.js → util/lru.js} +0 -0
package/dist/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAa,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAsC,MAAM,eAAe,CAAC;AACvF,OAAO,EACL,eAAe,EAEf,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAyB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EACL,WAAW,EAEX,WAAW,EAEX,SAAS,EAET,SAAS,EACT,SAAS,EAET,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAA2B,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAkC,UAAU,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,WAAW,EAEX,WAAW,EAGX,UAAU,EAEV,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,aAAa,EAA2D,MAAM,gBAAg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AAC,CAAC,MAAM,EAAE,CAAC;QAChE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC7C,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;YAAE,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3E,CAAC;CACF;AAED,uGAAuG;AACvG,SAAS,WAAW,CAAC,MAAc,EAAE,KAAkB;IACrD,MAAM,CAAC,iBAAiB,CACtB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,EAC/B,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,EACrE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAC/D,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The map: canvas, camera, layers, events, overlays, credits and the frame loop. Frames are drawn on demand only: an\n * idle map costs nothing. Hover events are coalesced to one per frame, so the values computed for a mouse position are\n * drawn in the same frame. The engine's loading is in engine-loader.ts, its settings from the options in settings.ts,\n * the camera animations in animation.ts.\n */\nimport { easeTo, flyTo, type Step } from './animation.ts';\nimport { BASEMAPS, HILLSHADE, RENAMED_BASEMAPS, SEA } from './basemaps.ts';\nimport { AttributionControl, type Control, type ControlPosition } from './controls.ts';\nimport {\n destroyedEngine,\n type EngineClass,\n engineUrl,\n loadEngine,\n loadFullEngineLater,\n preloadFullEngine,\n startTileLoader,\n} from './engine-loader.ts';\nimport { ExtrusionLayer, type ExtrusionOptions, extrusionStyle } from './extrusions.ts';\nimport {\n CircleLayer,\n type CircleOptions,\n circleStyle,\n type Feature,\n FillLayer,\n type FillOptions,\n fillStyle,\n LineLayer,\n type LineOptions,\n lineStyle,\n} from './features.ts';\nimport { IGN_PRESETS } from './geoplateforme.ts';\nimport { Glyphs } from './glyphs.ts';\nimport { equirectangularGrid, gridLoader, gridZooms, type RemoteReprojection, resolveGrid } from './grid.ts';\nimport { Icons, type ImageOptions, type Pixels, readPixels } from './icons.ts';\nimport { Interaction } from './interaction.ts';\nimport {\n CustomLayer,\n type CustomLayerInterface,\n GroundLayer,\n type GroundOptions,\n type Layer,\n ModelLayer,\n type ModelOptions,\n NetworkLayer,\n RasterLayer,\n Tiles3dLayer,\n} from './layers.ts';\nimport type { TileLoader } from './loader.ts';\nimport type { Positioned } from './overlay.ts';\nimport { loadPanoramas, type PanoramaHost, type PanoramaOptions, type Panoramas } from './panoramas.ts';\nimport { PointCloudLayer, type PointCloudOptions } from './pointclouds.ts';\nimport { type HeaderRules, headerRules, onHeaderRules } from './requests.ts';\nimport {\n atmosphereSettings,\n bodySettings,\n haloSettings,\n rgb,\n type Settings,\n type TerrainLoader,\n terrainSettings,\n} from './settings.ts';\nimport { injectStyle } from './style.ts';\nimport { SymbolLayer, type SymbolOptions, symbolStyle } from './symbols.ts';\nimport { encodedTerrainLoader, type PngEncoding, type RemoteHeights } from './terrain.ts';\nimport type {\n AnimationOptions,\n AtmosphereOptions,\n Basemap,\n BasemapName,\n CelestialBody,\n FeatureHit,\n FirstPersonView,\n FlyToOptions,\n GeoMapOptions,\n LoadingMode,\n LonLat,\n MapEvents,\n NetworkOptions,\n Point,\n Projection,\n RasterOptions,\n SwipeOptions,\n TerrainModel,\n TerrainOptions,\n Tiles3dOptions,\n ViewshedOptions,\n} from './types.ts';\nimport {\n BasemapWorkers,\n defaultWorkerCount,\n defaultWorkerUrl,\n type PmtilesOptions,\n pmtilesLayer,\n pmtilesRasterLoader,\n VECTOR_BASEMAPS,\n VectorTiles,\n type VectorTilesOptions,\n} from './vectortiles.ts';\nimport type { Camera, Engine, PickHit, PickResult, RasterLayerStats } from './wasm/isard.js';\n\n/** Reports an error without throwing it here: the console shows it, as an uncaught one */\nfunction report(error: unknown): void {\n if (typeof reportError === 'function') reportError(error);\n else\n queueMicrotask(() => {\n throw error;\n });\n}\n\ntype Listeners = { [K in keyof MapEvents]: Set<(event: MapEvents[K]) => void> };\n\n/** Checks a network's arrays before the engine reads them: node index pairs, indices of existing nodes */\nfunction validateNetwork(nodes: Float64Array, edges: Uint32Array): void {\n if (nodes.length % 2 !== 0) throw new Error(`isard: network nodes must be lon, lat pairs (length ${nodes.length})`);\n if (edges.length % 2 !== 0) throw new Error(`isard: network edges must be node index pairs (length ${edges.length})`);\n const count = nodes.length / 2;\n for (let i = 0; i < edges.length; i += 1) {\n const node = edges[i] as number;\n if (node >= count) throw new Error(`isard: network edge ${i >> 1} refers to node ${node}, of ${count} nodes`);\n }\n}\n\nconst CORNERS: readonly ControlPosition[] = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];\n\n/** Frames the hover picking waits for its answer at most (usually one) */\nconst MAX_POLLS = 30;\n\n/** The name of a basemap, checked: an unknown one throws */\nfunction checkBasemap(basemap: Basemap): BasemapName {\n const renamed = RENAMED_BASEMAPS[basemap];\n if (renamed) throw new Error(`isard: the basemap '${basemap}' is now named '${renamed}'`);\n if (basemap !== 'none' && !(basemap in VECTOR_BASEMAPS) && !(basemap in BASEMAPS)) {\n throw new Error(`isard: unknown basemap '${basemap}'`);\n }\n return basemap;\n}\n\n/** A map (see `GeoMap.create`); layers take it as their host */\nexport class GeoMap {\n readonly canvas: HTMLCanvasElement;\n #glyphs: Glyphs | undefined;\n #icons: Icons | undefined;\n /** Layers new layers go under */\n private readonly onTop = new Set<Layer>();\n /** The vector basemap, if any: its tiles' workers and its labels */\n private vector: { tiles: VectorTiles; labels: SymbolLayer<unknown> } | undefined;\n private readonly glyphsUrl: string | undefined;\n private readonly basemapWorkerUrl: string | URL;\n /** Texture size of the vector basemap's tiles */\n private readonly basemapTileSize: number | undefined;\n private readonly container: HTMLElement;\n /** Markers and popups, over the canvas */\n private readonly overlay: HTMLDivElement;\n private readonly corners: Record<ControlPosition, HTMLDivElement>;\n private readonly controls = new Map<Control, HTMLElement>();\n private readonly positioned = new Set<Positioned>();\n /** Canvas size in CSS pixels, kept on resize so placing overlays never reads the layout */\n private size: Point = [0, 0];\n #engine: Engine;\n /** Layers in drawing order (bottom first), to recreate them after a context loss */\n private readonly layers: Layer[] = [];\n private readonly settings: Settings;\n /** The WebGL context is lost: nothing is drawn until it is restored */\n private lost = false;\n private readonly listeners: Listeners = {\n movestart: new Set(),\n move: new Set(),\n moveend: new Set(),\n resize: new Set(),\n hover: new Set(),\n hoverfeature: new Set(),\n click: new Set(),\n render: new Set(),\n idle: new Set(),\n leave: new Set(),\n };\n private readonly resizeObserver: ResizeObserver;\n private readonly interaction: Interaction | undefined;\n private loader: TileLoader | undefined;\n /** The class of the engine: without 3D Tiles until a 3D Tiles layer is added, unless asked for from the start */\n private engineClass: EngineClass;\n /** The module of the engine with 3D Tiles once it runs this map (the decoding workers run it too) */\n private tiles3dModule: WebAssembly.Module | undefined;\n /** The engine with 3D Tiles is loading, for the 3D Tiles layers added on the core engine */\n private upgrading: Promise<void> | undefined;\n /** What loading the engine with 3D Tiles and its workers needs */\n private readonly tiles3dOptions: Pick<\n GeoMapOptions,\n 'wasmUrl' | 'workers' | 'workerUrl' | 'decoders' | 'pointsWasmUrl' | 'assetsUrl'\n >;\n private gone = false;\n /** The map is of the Earth: a basemap by default */\n private readonly earth: boolean;\n /** The body, as the option named it */\n private readonly body: CelestialBody | undefined;\n private basemap: RasterLayer | undefined;\n private hillshade: RasterLayer | undefined;\n /** Called when the credits of the layers or relief change (the attribution controls) */\n private readonly attributionListeners = new Set<() => void>();\n /** Credits of the raster layers that have some (basemaps, hillshade, the Géoplateforme's rasters…) */\n private readonly rasterCredits = new Map<object, string>();\n private animation: Step | undefined;\n private hoverPoint: Point | undefined;\n /** Frame polling the engine for the answer of the hover picking, 0 if none */\n private hoverPoll = 0;\n /** Polls of the hover picking under way: given up after `MAX_POLLS` (an answer that never comes) */\n private hoverPolls = 0;\n /** What 'hoverfeature' looks for: within `radius` CSS pixels, in `layers` only if given */\n hoverPicking: { radius?: number; layers?: readonly Layer[] } = {};\n private frameRequest = 0;\n private lastCamera = '';\n /** The camera moved since the last 'moveend' */\n private moving = false;\n /** The last frame found everything loaded ('idle' sent) */\n private settled = false;\n private inFrame = false;\n /** The camera of the frame being drawn: what `getCamera` gives the custom layers while the engine is busy */\n private frameCamera: Camera | undefined;\n /** Vector tiles made by `vectorTiles()`, destroyed with the map */\n private readonly vectorSets = new Set<VectorTiles>();\n /** The workers drawing vector tiles, shared by every `VectorTiles` of the map; created on first use */\n private basemapPool: BasemapWorkers | undefined;\n /** Stops watching the device pixel ratio */\n private unwatchRatio: (() => void) | undefined;\n /** Stops following the page's request headers (`setRequestHeaders`) */\n private unwatchHeaders: () => void = () => undefined;\n /** Stops listening to the canvas's context loss and restoration */\n private readonly unwatchContext: () => void;\n\n /** The loaders of the relief by encoding, URL and floor: the same loader for the same tiles (the engine keeps its\n * tiles when only the exaggeration changes) */\n private readonly terrainLoaders = new Map<string, TerrainLoader>();\n\n /** Loads the engine (once per page) and creates a map filling `container` */\n static async create(container: HTMLElement, given: GeoMapOptions = {}): Promise<GeoMap> {\n // A preset under the options given\n const options: GeoMapOptions = given.preset ? { ...IGN_PRESETS[given.preset], ...given } : given;\n // With 3D Tiles from the start when asked, or when only that engine's URL is given (as before the core engine)\n const full = options.tiles3d === true || (options.wasmUrl !== undefined && options.coreWasmUrl === undefined);\n // Before anything is created\n if (options.basemap !== undefined) checkBasemap(options.basemap);\n const kind = full ? 'full' : 'core';\n const bindings = await loadEngine(kind, engineUrl(kind, options));\n const map = new GeoMap(container, options, bindings.Engine, full ? bindings.module : undefined);\n if (options.tiles3d === 'preload' && !full) map.preloadTiles3d();\n return map;\n }\n\n private constructor(\n container: HTMLElement,\n options: GeoMapOptions,\n engineClass: EngineClass,\n tiles3dModule: WebAssembly.Module | undefined,\n ) {\n this.engineClass = engineClass;\n this.tiles3dModule = tiles3dModule;\n this.tiles3dOptions = { ...options };\n this.glyphsUrl = options.glyphs;\n this.basemapWorkerUrl = options.basemapWorkerUrl ?? defaultWorkerUrl(options.assetsUrl);\n this.basemapTileSize = options.basemapTileSize;\n this.container = container;\n this.canvas = document.createElement('canvas');\n Object.assign(this.canvas.style, { display: 'block', width: '100%', height: '100%', touchAction: 'none' });\n // Overlays and controls are positioned against the container\n injectStyle(container.ownerDocument);\n if (getComputedStyle(container).position === 'static') container.style.position = 'relative';\n container.classList.add('isard-map');\n this.overlay = document.createElement('div');\n this.overlay.className = 'isard-overlay';\n const corner = (position: ControlPosition) => {\n const element = document.createElement('div');\n element.className = `isard-ctrl-${position}`;\n return element;\n };\n this.corners = {\n 'top-left': corner('top-left'),\n 'top-right': corner('top-right'),\n 'bottom-left': corner('bottom-left'),\n 'bottom-right': corner('bottom-right'),\n };\n container.append(this.canvas, this.overlay, ...CORNERS.map((position) => this.corners[position]));\n this.earth = (options.body ?? 'earth') === 'earth';\n this.body = options.body;\n const body = bodySettings(options.body);\n this.settings = {\n body,\n zoomRange: [options.minZoom ?? 0, options.maxZoom ?? 22],\n maxPitch: options.maxPitch ?? 70,\n globe: (options.projection ?? 'globe') === 'globe',\n sky: options.sky ?? true,\n atmosphere: atmosphereSettings(options.atmosphere),\n terrain: terrainSettings(options.terrain, options.body, body.radius, this.terrainLoader),\n loading: options.loading ?? 'immediate',\n background: rgb(options.background ?? (this.earth ? '#f2f2f0' : '#000000')),\n globeColor: this.earth ? SEA['osm-positron'] : rgb(body.color),\n };\n this.#engine = this.createEngine();\n // Once it has an engine: a map whose creation failed before is not left following them\n this.unwatchHeaders = onHeaderRules((rules) => sendHeaders(this.#engine, rules));\n // The browser may take the GPU away (driver reset, background tab on mobile): the map waits, then rebuilds\n const lost = (event: Event) => {\n event.preventDefault();\n this.lost = true;\n cancelAnimationFrame(this.frameRequest);\n this.frameRequest = 0;\n };\n const restored = () => this.restore();\n this.canvas.addEventListener('webglcontextlost', lost);\n this.canvas.addEventListener('webglcontextrestored', restored);\n this.unwatchContext = () => {\n this.canvas.removeEventListener('webglcontextlost', lost);\n this.canvas.removeEventListener('webglcontextrestored', restored);\n };\n const start: Camera = this.earth\n ? { center: [2.4246, 48.8457], zoom: 13, pitch: 0, bearing: 0 }\n : { center: [0, 0], zoom: 2, pitch: 0, bearing: 0 };\n this.setCamera({ ...start, ...options });\n this.setBasemap(options.basemap ?? (this.earth ? 'osm-positron' : 'none'), options.hillshade ?? 0);\n this.resizeObserver = new ResizeObserver(() => this.resize());\n this.resizeObserver.observe(container);\n this.watchRatio();\n this.resize();\n const interactive = options.interactive ?? true;\n const keyboard = interactive && (options.keyboard ?? true);\n this.interaction = interactive ? new Interaction(this, { keyboard }) : undefined;\n // Reached with Tab when the keys move it; named for screen readers either way\n this.canvas.classList.add('isard-canvas');\n this.canvas.setAttribute('role', keyboard ? 'application' : 'region');\n this.canvas.setAttribute('aria-roledescription', 'map');\n this.canvas.setAttribute('aria-label', options.ariaLabel ?? 'Map');\n if (keyboard) this.canvas.tabIndex = 0;\n const attribution = options.attributionControl ?? true;\n if (attribution !== false) {\n this.addControl(new AttributionControl(attribution === true ? {} : attribution), 'bottom-right');\n }\n }\n\n /** The element the map was created in */\n getContainer(): HTMLElement {\n return this.container;\n }\n\n getCanvas(): HTMLCanvasElement {\n return this.canvas;\n }\n\n /** @internal The engine (replaced after a context loss) */\n get engine(): Engine {\n return this.#engine;\n }\n\n private createEngine(): Engine {\n const engine = new this.engineClass(this.canvas, () => this.requestRender());\n // The body first: the layers' shaders may take its size\n const { radius, flattening, atmosphere: air, relief } = this.settings.body;\n engine.setBody(radius, flattening, haloSettings(air), ...relief);\n sendHeaders(engine, headerRules());\n const { zoomRange, maxPitch, globe, sky, atmosphere, terrain, loading, background, globeColor } = this.settings;\n engine.setZoomRange(...zoomRange);\n engine.setMaxPitch(maxPitch);\n engine.setGlobe(globe);\n engine.setSky(sky);\n engine.setAtmosphere(atmosphere);\n engine.setTerrain(terrain?.url, terrain?.exaggeration ?? 1, terrain?.maxZoom, terrain?.geoid, terrain?.loader);\n engine.setImmediateLoading(loading === 'immediate');\n engine.setBackground(...background);\n engine.setGlobeColor(...globeColor);\n this.loader ??= this.startLoader(engine);\n if (this.loader) engine.setTileLoader(this.loader);\n return engine;\n }\n\n /** The decoding workers of 3D Tiles, with the engine that has them (they run its module) and unless turned off */\n private startLoader(engine: Engine): TileLoader | undefined {\n return this.tiles3dModule && startTileLoader(this.tiles3dModule, this.tiles3dOptions, engine);\n }\n\n /** A 3D Tiles layer or a model on the core engine: loads the engine with 3D Tiles, then rebuilds the map on it\n * (camera, settings and layers kept, as after a context loss); the layer is created then */\n private upgrade(): void {\n this.upgrading ??= loadFullEngineLater(engineUrl('full', this.tiles3dOptions)).then(\n ({ module, Engine }) => {\n this.upgrading = undefined;\n if (this.gone) return;\n this.engineClass = Engine;\n this.tiles3dModule = module;\n // A lost context: the engine is rebuilt on it once restored\n if (!this.lost) this.restore();\n },\n (error: unknown) => {\n // The 3D Tiles layers stay empty; the next one added tries again\n this.upgrading = undefined;\n if (this.gone) return;\n report(error);\n this.requestRender();\n },\n );\n }\n\n /** Downloads and compiles the engine with 3D Tiles once the map is idle (`tiles3d: 'preload'`), without running\n * it: the first 3D Tiles layer then only instantiates it */\n private preloadTiles3d(): void {\n const url = engineUrl('full', this.tiles3dOptions);\n const later = () => preloadFullEngine(url, () => !this.gone && !this.tiles3dModule);\n if (this.settled) later();\n else {\n const off = this.on('idle', () => {\n off();\n later();\n });\n }\n }\n\n /** After a context loss: a new engine with the same camera, settings and layers (same handles, same order) */\n private restore(): void {\n if (this.gone) return;\n this.cancelHoverPick();\n const camera = this.getCamera();\n this.#engine.free();\n this.#engine = this.createEngine();\n this.lost = false;\n this.setCamera(camera);\n this.#glyphs?.attach(this.#engine);\n this.#icons?.attach(this.#engine);\n const engine = this.#engine;\n // No layer refers to an id of the old engine while the others are created\n for (const layer of this.layers) layer.forgetEngine();\n for (const layer of this.layers) {\n // Still waiting for the engine with 3D Tiles (loading, or failed): created with it\n if (layer.needsFullEngine && !this.tiles3dModule) continue;\n // A layer that fails is reported and left out; the others are created\n try {\n layer.attach(engine);\n } catch (error) {\n report(error);\n }\n }\n // Links between layers, once every layer has its new id (buildings colored by a network above them)\n for (const layer of this.layers) {\n if (layer.id < 0) continue;\n try {\n layer.relink(engine);\n } catch (error) {\n report(error);\n }\n }\n this.applySwipe();\n // A street-level eye stays one in the new engine\n if (this.#firstPerson) this.setFirstPerson(this.#firstPerson);\n // What the old engine drew over the scene: the viewshed, the panoramas shown\n if (this.viewshed) this.setViewshed(this.viewshed);\n for (const set of this.panoramaSets) if (set.current) void set.show(set.current.index).catch(report);\n this.resize();\n }\n\n /** The street-level eye, while there is one (`setFirstPerson`) */\n #firstPerson: Required<FirstPersonView> | undefined;\n\n /** The street-level eye, if the camera is one */\n get firstPerson(): Readonly<Required<FirstPersonView>> | undefined {\n return this.#firstPerson;\n }\n\n /**\n * Puts the camera at street level: an eye `height` metres above the ground, looking `bearing` and `pitch`, the\n * drag turning it around (the wheel narrows or widens its field of view); undefined gives back the camera turning\n * around a point, above where the eye stood, facing the same way\n */\n setFirstPerson(view: FirstPersonView | undefined): void {\n if (!view) {\n const was = this.#firstPerson;\n this.#firstPerson = undefined;\n if (was) this.setCamera({ center: was.lonLat, zoom: 18, pitch: 60, bearing: was.bearing });\n return;\n }\n const eye = {\n height: 1.7,\n pitch: 90,\n fov: 75,\n ...view,\n lonLat: [view.lonLat[0], view.lonLat[1]] as LonLat,\n };\n eye.pitch = Math.max(1, Math.min(179, eye.pitch));\n eye.fov = Math.max(10, Math.min(140, eye.fov));\n eye.bearing = ((eye.bearing % 360) + 360) % 360;\n this.#firstPerson = eye;\n this.engine.setFirstPerson(eye.lonLat[0], eye.lonLat[1], eye.height, eye.bearing, eye.pitch, eye.fov);\n this.requestRender();\n }\n\n /** The swipe set (`setSwipe`), applied again with the layers' ids of a new engine */\n private swipe: SwipeOptions | undefined;\n\n /**\n * Compares two states of a place: `layers` shown on one side of a vertical line only, at `position` CSS pixels\n * from the left of the map (left of it by default, `side: 'right'` for the other), the layers beneath them on the\n * other side. Set again as the line moves (a slider, a drag); undefined stops\n */\n setSwipe(options: SwipeOptions | undefined): void {\n this.swipe = options && options.layers.length > 0 ? { ...options, layers: [...options.layers] } : undefined;\n this.applySwipe();\n this.requestRender();\n }\n\n private applySwipe(): void {\n const s = this.swipe;\n const ids = Uint32Array.from(\n (s?.layers ?? []).filter((l) => l.id >= 0),\n (l) => l.id,\n );\n this.engine.setSwipe(s && ids.length > 0 ? s.position : Number.NaN, s?.side === 'right', ids);\n }\n\n /** @internal Forgets a removed layer */\n detach(layer: object): void {\n this.unlist(layer);\n this.onTop.delete(layer as Layer);\n if (this.rasterCredits.delete(layer)) this.attributionChanged();\n }\n\n /** @internal The layer is on the map */\n hasLayer(layer: object): boolean {\n return !this.gone && this.layers.includes(layer as Layer);\n }\n\n /** Takes a layer out of the drawing order (to put it back elsewhere, or for good) */\n private unlist(layer: object): void {\n const index = this.layers.indexOf(layer as Layer);\n if (index >= 0) this.layers.splice(index, 1);\n }\n\n private addLayer<L extends Layer>(layer: L): L {\n // On the core engine, a 3D Tiles layer or a model waits for the engine with 3D Tiles: it is created with the\n // others on it\n if (layer.needsFullEngine && !this.tiles3dModule) this.upgrade();\n else layer.attach(this.engine);\n this.layers.push(layer);\n // Under the layers kept on top (the basemap's labels)\n const top = this.layers.find((l) => this.onTop.has(l) && l !== layer);\n if (top) this.moveLayer(layer, top);\n this.requestRender();\n return layer;\n }\n\n /** @internal Keeps a layer above the layers added after it (they go under it), as the labels of a basemap */\n keepOnTop(layer: Layer): void {\n this.onTop.add(layer);\n }\n\n /** @internal Moves a layer under `before`, or on top of all */\n moveLayer(layer: object, before: object | undefined): void {\n const handle = layer as Layer;\n this.unlist(handle);\n const index = before ? this.layers.indexOf(before as Layer) : -1;\n const at = index < 0 ? this.layers.length : index;\n this.layers.splice(at, 0, handle);\n if (handle.id >= 0) this.engine.moveLayer(handle.id, this.engineIndex(at));\n this.requestRender();\n }\n\n /** @internal See `LayerHost.replaceLayer` */\n replaceLayer(layer: object, old: number): void {\n this.engine.removeLayer(old);\n const index = this.layers.indexOf(layer as Layer);\n if (index >= 0) this.engine.moveLayer((layer as Layer).id, this.engineIndex(index));\n }\n\n /** Index in the engine of the layer at `index`: the layers waiting for the engine with 3D Tiles are not in it yet */\n private engineIndex(index: number): number {\n let count = 0;\n for (let i = 0; i < index; i += 1) if ((this.layers[i]?.id ?? -1) >= 0) count += 1;\n return count;\n }\n\n /** Moves a layer under all the others */\n private toBottom(layer: Layer): void {\n this.engine.moveLayer(layer.id, 0);\n this.unlist(layer);\n this.layers.unshift(layer);\n }\n\n // ── Events ──\n\n /** Listens to an event; returns the function that stops listening */\n on<K extends keyof MapEvents>(type: K, listener: (event: MapEvents[K]) => void): () => void {\n const listeners: Set<(event: MapEvents[K]) => void> = this.listeners[type];\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n\n /** @internal Calls the listeners; one that throws is reported and does not stop the others nor the frame */\n emit<K extends keyof MapEvents>(type: K, event: MapEvents[K]): void {\n const listeners: Set<(event: MapEvents[K]) => void> = this.listeners[type];\n for (const listener of listeners) {\n try {\n listener(event);\n } catch (error) {\n report(error);\n }\n }\n }\n\n // ── Camera ──\n\n /**\n * The camera's methods together: `get`, `set`, `easeTo`, `flyTo`, `bounds`, `firstPerson` and `setFirstPerson`\n * (street level), `project`, `unproject`; the same as the map's own (`getCamera`, `setCamera`…)\n */\n readonly camera = {\n get: (): Camera => this.getCamera(),\n set: (camera: Partial<Camera>): void => this.setCamera(camera),\n easeTo: (camera: Partial<Camera>, options?: number | AnimationOptions): void => this.easeTo(camera, options),\n flyTo: (camera: Partial<Camera>, options?: FlyToOptions): void => this.flyTo(camera, options),\n bounds: (): [west: number, south: number, east: number, north: number] => this.getBounds(),\n firstPerson: (): Readonly<Required<FirstPersonView>> | undefined => this.firstPerson,\n setFirstPerson: (view: FirstPersonView | undefined): void => this.setFirstPerson(view),\n project: (lonLat: LonLat, height?: number): Point | undefined => this.project(lonLat, height),\n unproject: (point: Point): LonLat | undefined => this.unproject(point),\n } as const;\n\n /**\n * What lies under a point or at a position, together: `feature` (`pickFeature`), `surface` (`pickSurface`),\n * `surfaceAt`, `elevationAt`, `metersPerPixel`\n */\n readonly query = {\n feature: (point: Point, options?: { radius?: number; layers?: readonly Layer[] }): FeatureHit | undefined =>\n this.pickFeature(point, options),\n surface: (point: Point): { lonLat: LonLat; height: number } | undefined => this.pickSurface(point),\n surfaceAt: (lonLat: LonLat): number | undefined => this.surfaceAt(lonLat),\n elevationAt: (lonLat: LonLat): number | undefined => this.elevationAt(lonLat),\n metersPerPixel: (point?: Point): number | undefined => this.metersPerPixel(point),\n } as const;\n\n /** What is drawn over the scene, together: `viewshed` (`setViewshed`), `swipe` (`setSwipe`) */\n readonly effects = {\n viewshed: (options: ViewshedOptions | readonly ViewshedOptions[] | undefined): void => this.setViewshed(options),\n swipe: (options: SwipeOptions | undefined): void => this.setSwipe(options),\n } as const;\n\n getCamera(): Camera {\n return this.frameCamera ?? this.engine.camera();\n }\n\n setCamera(camera: Partial<Camera>): void {\n const c = { ...this.getCamera(), ...camera };\n this.engine.setCamera(c.center[0], c.center[1], c.zoom, c.pitch, c.bearing);\n this.requestRender();\n }\n\n /** Animated move to a camera: over `duration` milliseconds (or the options), ease-out by default */\n easeTo(camera: Partial<Camera>, options: number | AnimationOptions = 600): void {\n const from = this.getCamera();\n const to = { ...from, ...camera };\n this.animate(easeTo(() => this.engine, from, to, options));\n // The destination's tiles load during the flight (as Cesium does)\n this.engine.preload(to.center[0], to.center[1], to.zoom, to.pitch, to.bearing);\n }\n\n /**\n * Flight to a camera that zooms out on its way and back in (van Wijk and Nuij's optimal path, as MapLibre's\n * `flyTo`): long moves stay readable. Pitch and bearing follow the progress.\n */\n flyTo(camera: Partial<Camera>, options: FlyToOptions = {}): void {\n const from = this.getCamera();\n const to = { ...from, ...camera };\n const viewport = Math.max(this.canvas.clientWidth, this.canvas.clientHeight);\n this.animate(flyTo(() => this.engine, from, to, viewport, options));\n this.engine.preload(to.center[0], to.center[1], to.zoom, to.pitch, to.bearing);\n }\n\n /** Longitudes and latitudes the view covers on the ground: `[west, south, east, north]` */\n getBounds(): [west: number, south: number, east: number, north: number] {\n const [west = -180, south = -85, east = 180, north = 85] = this.engine.bounds();\n return [west, south, east, north];\n }\n\n /** Lowest zoom the camera accepts (the widest view) */\n setMinZoom(zoom: number): void {\n this.settings.zoomRange[0] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n setMaxZoom(zoom: number): void {\n this.settings.zoomRange[1] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n /** Highest pitch, degrees, up to 85 */\n setMaxPitch(pitch: number): void {\n this.settings.maxPitch = pitch;\n this.engine.setMaxPitch(pitch);\n this.requestRender();\n }\n\n /** Sky over the plane and the fog of the ground (see `GeoMapOptions.atmosphere`); undefined to remove them */\n setAtmosphere(options: AtmosphereOptions | undefined): void {\n this.settings.atmosphere = atmosphereSettings(options);\n this.engine.setAtmosphere(this.settings.atmosphere);\n this.requestRender();\n }\n\n setProjection(projection: Projection): void {\n this.settings.globe = projection === 'globe';\n this.engine.setGlobe(this.settings.globe);\n this.requestRender();\n }\n\n /** How tiles load and show (see `LoadingMode`) */\n setLoading(mode: LoadingMode): void {\n this.settings.loading = mode;\n this.engine.setImmediateLoading(mode === 'immediate');\n this.requestRender();\n }\n\n /** Space behind the globe (stars, atmosphere halo) */\n setSky(enabled: boolean): void {\n this.settings.sky = enabled;\n this.engine.setSky(enabled);\n this.requestRender();\n }\n\n /** Tints what can be seen from a point and what is hidden from it, within a range, all around or within a cone\n * (`direction`): the relief, extrusions, 3D Tiles and models hide what lies behind them (only what the map has\n * loaded for its view). Several observers (16 at most): what any of them sees is seen, what is hidden from all those\n * that reach it is hidden, in the colors and opacity of the first. Undefined or none removes it */\n /** The viewshed set, set again in a new engine */\n private viewshed: ViewshedOptions | readonly ViewshedOptions[] | undefined;\n\n setViewshed(options: ViewshedOptions | readonly ViewshedOptions[] | undefined): void {\n this.viewshed = options;\n let observers: readonly ViewshedOptions[] = [];\n if (options) observers = 'position' in options ? [options] : options;\n const [first] = observers;\n if (!first) {\n this.engine.clearViewshed();\n return;\n }\n this.engine.setViewshed(\n new Float64Array(\n observers.flatMap((o) => [\n o.position[0],\n o.position[1],\n o.height ?? 1.7,\n o.range ?? 1000,\n ...(o.direction === undefined\n ? [Number.NaN, 0, 0, 0]\n : [o.direction, o.tilt ?? 0, o.fov ?? 60, o.verticalFov ?? 40]),\n ]),\n ),\n new Float32Array(rgb(first.visibleColor ?? '#2f9e44')),\n new Float32Array(rgb(first.hiddenColor ?? '#e03131')),\n first.opacity ?? 0.7,\n new Float32Array(first.coneColor ? rgb(first.coneColor) : []),\n );\n this.requestRender();\n }\n\n /** Relief under the basemap: true for the body's terrain model (on the Earth the worldwide Terrain Tiles, NASA's\n * on the Moon and Mars), one of the Earth's models by name (`'ign'`), its options, or false; on another body, its\n * options with a `url` */\n setTerrain(terrain: boolean | TerrainModel | TerrainOptions): void {\n this.settings.terrain = terrainSettings(terrain, this.body, this.settings.body.radius, this.terrainLoader);\n const t = this.settings.terrain;\n this.engine.setTerrain(t?.url, t?.exaggeration ?? 1, t?.maxZoom, t?.geoid, t?.loader);\n this.attributionChanged();\n this.requestRender();\n }\n\n /** @internal The credits of the raster layers (the basemap first) and of the relief in use, each once */\n attributions(): string[] {\n const layers = this.layers.map((layer) => this.rasterCredits.get(layer));\n const credits = [...layers, this.settings.terrain?.attribution];\n return [...new Set(credits.filter((c): c is string => c !== undefined))];\n }\n\n /** @internal Calls `listener` when the credits change; returns what stops it */\n onAttributionChange(listener: () => void): () => void {\n this.attributionListeners.add(listener);\n return () => this.attributionListeners.delete(listener);\n }\n\n private attributionChanged(): void {\n for (const listener of this.attributionListeners) listener();\n }\n\n /** Color behind the map, a CSS color (its alpha ignored) */\n setBackground(color: string): void {\n this.settings.background = rgb(color);\n this.engine.setBackground(...this.settings.background);\n this.requestRender();\n }\n\n /** Tile counters of the raster layers, for diagnostics */\n stats(): RasterLayerStats[] {\n return this.engine.stats();\n }\n\n /**\n * The feature under a screen point (CSS pixels), undefined if none: its layer id and index. Reads one pixel of an\n * offscreen picking pass, whatever the number of features, but waits for the GPU to finish the frame (a stall): for\n * clicks and one-off queries. On hover, listen to 'hoverfeature' instead, which picks without waiting.\n */\n pick(point: Point, radius = 0, layers?: readonly Layer[]): PickHit | undefined {\n const only = layers && Uint32Array.from(layers.map((l) => l.id));\n return this.engine.pick(point[0], point[1], radius, only);\n }\n\n /**\n * The feature under a screen point (CSS pixels), or the nearest one within `radius` pixels: its layer handle, its\n * index there and, for line, circle and fill layers, the feature itself; undefined if none. `layers` restricts the\n * search to some layers (the others hide nothing).\n */\n pickFeature(point: Point, options: { radius?: number; layers?: readonly Layer[] } = {}): FeatureHit | undefined {\n const hit = this.pick(point, options.radius ?? 0, options.layers);\n return hit && this.featureHit(hit);\n }\n\n /** A hit with its layer handle and feature; undefined if the layer is gone */\n private featureHit(hit: PickHit): FeatureHit | undefined {\n const layer = this.layers.find((l) => l.id === hit.layer);\n if (!layer) return undefined;\n const feature =\n 'featureAt' in layer && typeof layer.featureAt === 'function'\n ? (layer.featureAt(hit.index) as Feature | undefined)\n : undefined;\n return { layer, index: hit.index, feature };\n }\n\n /** Asks the engine what is under the pointer; its answer, read without waiting for the GPU, comes on a later frame */\n private requestHoverPick(point: Point): void {\n const { radius = 0, layers } = this.hoverPicking;\n const only = layers && Uint32Array.from(layers.map((l) => l.id));\n // The engine cannot pick (no request in flight): the poll under way would wait for nothing\n if (!this.engine.requestPick(point[0], point[1], radius, only)) {\n this.cancelHoverPick();\n return;\n }\n // A new request replaces the one in flight (in the engine too): one poll loop at most\n this.hoverPolls = 0;\n if (!this.hoverPoll) this.hoverPoll = requestAnimationFrame(this.pollHoverPick);\n }\n\n private readonly pollHoverPick = (): void => {\n this.hoverPoll = 0;\n if (this.lost) return;\n const result: PickResult | undefined = this.engine.pollPick();\n if (!result) {\n // The GPU is not done yet (usually a frame): asked again next frame, without drawing; given up at last\n this.hoverPolls += 1;\n if (this.hoverPolls < MAX_POLLS) this.hoverPoll = requestAnimationFrame(this.pollHoverPick);\n return;\n }\n this.emit('hoverfeature', {\n point: [result.x, result.y],\n lonLat: result.lonLat,\n hit: result.hit && this.featureHit(result.hit),\n });\n };\n\n private cancelHoverPick(): void {\n cancelAnimationFrame(this.hoverPoll);\n this.hoverPoll = 0;\n }\n\n /** Screen point (CSS pixels) of a position on the ground (the relief), or `height` metres above it, undefined\n * behind the camera */\n project(lonLat: LonLat, height = 0): Point | undefined {\n return this.engine.project(lonLat[0], lonLat[1], height);\n }\n\n /** Position under a screen point (CSS pixels), undefined above the horizon */\n unproject(point: Point): LonLat | undefined {\n return this.engine.ground(point[0], point[1]);\n }\n\n /**\n * Street-level panoramas (oriented images of a vehicle's cameras, the iTowns immersive format): their positions\n * and calibrations loaded, none shown until `show`, which projects one onto the scene around it\n */\n async addPanoramas(options: PanoramaOptions): Promise<Panoramas> {\n // Drawn by the engine with 3D Tiles: loaded first if needed\n if (!this.tiles3dModule) {\n this.upgrade();\n await this.upgrading;\n if (!this.tiles3dModule) throw new Error('isard: panoramas need the engine with 3D Tiles, which failed to load');\n }\n const host: PanoramaHost = {\n setPanorama: (...args) => {\n this.engine.setPanorama(...args);\n this.requestRender();\n },\n setPanoramaImage: (index, image) => this.engine.setPanoramaImage(index, image),\n clearPanorama: () => this.engine.clearPanorama(),\n geoidHeight: (lon, lat) => this.engineClass.geoidHeight(lon, lat),\n firstPerson: () => this.firstPerson,\n setFirstPerson: (view) => this.setFirstPerson(view),\n elevationAt: (lonLat) => this.elevationAt(lonLat),\n listen: (click, key, wheel) => {\n const off = this.on('click', ({ lonLat }) => click(lonLat));\n const container = this.getContainer();\n // Before the map's own wheel (its zoom, the eye's field of view)\n const onWheel = (e: WheelEvent) => {\n e.preventDefault();\n e.stopImmediatePropagation();\n wheel(e);\n };\n container.addEventListener('keydown', key);\n container.addEventListener('wheel', onWheel, { capture: true, passive: false });\n return () => {\n off();\n container.removeEventListener('keydown', key);\n container.removeEventListener('wheel', onWheel, { capture: true });\n };\n },\n };\n const panoramas = await loadPanoramas(host, options);\n this.panoramaSets.add(panoramas);\n return panoramas;\n }\n\n /** The panorama sets, their panorama shown again in a new engine */\n private readonly panoramaSets = new Set<Panoramas>();\n\n /** Altitude of the relief at a position, in metres (exaggeration included): from the copy of its tiles the map\n * keeps, as fine as the tiles loaded there; undefined without relief or where none is loaded yet */\n elevationAt(lonLat: LonLat): number | undefined {\n return this.engine.elevationAt(lonLat[0], lonLat[1]);\n }\n\n /** Metres on the ground per CSS pixel at a screen point (default the center of the map), across the screen: for a\n * scale bar; undefined above the horizon */\n metersPerPixel(point?: Point): number | undefined {\n const [x, y] = point ?? [this.canvas.clientWidth / 2, this.canvas.clientHeight / 2];\n const a = this.unproject([x - 0.5, y]);\n const b = this.unproject([x + 0.5, y]);\n if (!a || !b) return undefined;\n // Haversine, on the mean radius of the body\n const rad = Math.PI / 180;\n const [dLat, dLon] = [(b[1] - a[1]) * rad, (b[0] - a[0]) * rad];\n const h = Math.sin(dLat / 2) ** 2 + Math.cos(a[1] * rad) * Math.cos(b[1] * rad) * Math.sin(dLon / 2) ** 2;\n return 2 * this.settings.body.radius * Math.asin(Math.min(1, Math.sqrt(h)));\n }\n\n /** Whether a double click zooms in (Shift: out), on by default: off while a drawing takes double clicks */\n setDoubleClickZoom(enabled: boolean): void {\n if (this.interaction) this.interaction.doubleClickZoom = enabled;\n }\n\n /** What is drawn under a screen point (CSS pixels), on the relief or standing on it (a roof, a wall, a mesh): its\n * position and its height above the relief, in metres; undefined where nothing was drawn. The last frame's scene is\n * drawn again and read back, waiting for the GPU (a stall): for clicks and drags */\n pickSurface(point: Point): { lonLat: LonLat; height: number } | undefined {\n const hit = this.engine.surface(point[0], point[1]);\n return hit && { lonLat: [hit[0], hit[1]], height: hit[2] };\n }\n\n /** The height above the relief, in metres, of the top of what stands at a position: a roof, a mesh, 0 on the bare\n * ground; undefined where nothing of the last frame is there. The scene is drawn from above into a single pixel and\n * read back: cheap, but it waits for the GPU */\n surfaceAt(lonLat: LonLat): number | undefined {\n return this.engine.surfaceAt(lonLat[0], lonLat[1]);\n }\n\n // ── Overlays and controls ──\n\n /** Adds a control in a corner of the map; controls stack from the corner inward */\n addControl(control: Control, position: ControlPosition = 'top-right'): this {\n if (this.controls.has(control)) return this;\n const element = control.onAdd(this);\n element.classList.add('isard-ctrl');\n // In the bottom corners the first control added stays lowest, as in MapLibre\n if (position.startsWith('bottom')) this.corners[position].prepend(element);\n else this.corners[position].append(element);\n this.controls.set(control, element);\n return this;\n }\n\n removeControl(control: Control): this {\n const element = this.controls.get(control);\n if (!element) return this;\n this.controls.delete(control);\n control.onRemove(this);\n element.remove();\n return this;\n }\n\n /** @internal Shows a marker or popup, placed after every frame from now on */\n attachOverlay(item: Positioned, element: HTMLElement): void {\n this.overlay.append(element);\n this.positioned.add(item);\n item.position(this.size);\n }\n\n /** @internal */\n detachOverlay(item: Positioned, element: HTMLElement): void {\n this.positioned.delete(item);\n element.remove();\n }\n\n /** @internal Places one overlay now (it moved), without drawing a frame */\n positionOverlay(item: Positioned): void {\n if (this.positioned.has(item)) item.position(this.size);\n }\n\n // ── Layers ──\n\n /** Replaces the basemap and the IGN hillshade, under the other layers (hillshade by default: 0, none). The former\n * names of the Géoplateforme basemaps throw, naming the new ones */\n setBasemap(basemap: Basemap, hillshade = 0): void {\n const name = checkBasemap(basemap);\n if (this.basemap && this.hasLayer(this.basemap)) this.basemap.remove();\n if (this.hillshade && this.hasLayer(this.hillshade)) this.hillshade.remove();\n // Its raster and labels go with it\n this.vector?.tiles.destroy();\n this.vector = undefined;\n const vector = VECTOR_BASEMAPS[name as keyof typeof VECTOR_BASEMAPS];\n if (vector) {\n const tiles = new VectorTiles(this, {\n style: vector,\n ...(this.basemapWorkerUrl ? { workerUrl: this.basemapWorkerUrl } : {}),\n });\n this.basemap = tiles.raster(this.basemapTileSize ? { size: this.basemapTileSize } : {});\n this.vector = { tiles, labels: tiles.labels() as SymbolLayer<unknown> };\n } else {\n this.basemap = name === 'none' ? undefined : this.addRaster(BASEMAPS[name as keyof typeof BASEMAPS]);\n }\n // Off the Earth, the body's own color\n if (this.earth) this.settings.globeColor = SEA[name];\n this.engine.setGlobeColor(...this.settings.globeColor);\n this.hillshade = hillshade > 0 ? this.addRaster({ ...HILLSHADE, opacity: hillshade }) : undefined;\n if (this.hillshade) this.toBottom(this.hillshade);\n if (this.basemap) this.toBottom(this.basemap);\n this.attributionChanged();\n }\n\n /** Raster tiles ({z}, {x}, {y} URL; Web Mercator, or reprojected from another `grid`: longitudes and latitudes,\n * Lambert-93, UTM…), over the layers already added */\n addRaster(options: RasterOptions & { before?: Layer }): RasterLayer {\n const { url, grid = 'mercator', opacity = 1, saturation = 1, size, before } = options;\n let { minZoom = 0, maxZoom = 19 } = options;\n // A PMTiles archive (`pmtiles://…`): its tiles read by range requests\n let loader = options.loader ?? pmtilesRasterLoader(url, size ?? 256);\n if (grid !== 'mercator' && !loader) {\n if (grid === 'equirectangular') {\n // `minZoom` and `maxZoom` are levels of the source: its level n has the pixel size of Mercator level n + 1 at\n // the equator\n loader = gridLoader(\n url,\n resolveGrid(equirectangularGrid(minZoom, maxZoom)),\n size ?? 256,\n this.remoteReprojection,\n );\n [minZoom, maxZoom] = [minZoom + 1, maxZoom + 1];\n } else {\n const resolved = resolveGrid(grid);\n const zooms = gridZooms(resolved);\n minZoom = options.minZoom ?? zooms.minZoom;\n maxZoom = options.maxZoom ?? zooms.maxZoom;\n loader = gridLoader(url, resolved, size ?? 256, this.remoteReprojection);\n }\n }\n const layer = new RasterLayer(this, { url, minZoom, maxZoom, opacity, saturation, size, loader });\n this.place(layer, before);\n if (options.attribution) {\n this.rasterCredits.set(layer, options.attribution);\n this.attributionChanged();\n }\n return layer;\n }\n\n /**\n * A PMTiles archive (v3) read by range requests: a raster layer of its images, or vector tiles drawn with `style` (by\n * default a plain style of the archive's layers) with their labels. Its header decides which unless `kind` says;\n * `url` with or without `pmtiles://`, relative to the page, or a `blob:` URL. `addRaster({ url: 'pmtiles://…' })` and\n * a style source `pmtiles://…` in `vectorTiles` read archives too\n */\n addPmtiles(url: string, options: PmtilesOptions = {}): Promise<RasterLayer | VectorTiles> {\n return pmtilesLayer(this, url, options);\n }\n\n /** Line network colored by a value per node; `layer.setValues` recolors it in one texture upload */\n addNetwork(options: NetworkOptions): NetworkLayer {\n const { nodes, edges, lines, costs, edgeWidths, width = 2, max = 1800, contour = 0, opacity = 1 } = options;\n const { halo = 0, haloOpacity = 0.11, ramp, unreachedColor = 'rgba(140, 140, 140, 0.25)', fade = 0 } = options;\n const style = { width, max, contour, opacity, halo, haloOpacity, ramp, unreachedColor, fade };\n validateNetwork(nodes, edges);\n return this.addLayer(new NetworkLayer(this, { nodes, edges, lines }, costs, style, edgeWidths));\n }\n\n /**\n * A layer from its description, as an application's configuration gives it: `{ type, ...options }`, the options of\n * the `add…` method of that type (`'lines'` for `addLines`, `'tiles3d'` for `addTiles3d`…); `before` to go under\n * another layer. The layer's `ready` resolves once the map has drawn it\n */\n add<P = Record<string, unknown>>(spec: LayerSpec<P>): Layer {\n switch (spec.type) {\n case 'lines':\n return this.addLines<P>(spec);\n case 'circles':\n return this.addCircles<P>(spec);\n case 'fills':\n return this.addFills<P>(spec);\n case 'symbols':\n return this.addSymbols<P>(spec);\n case 'extrusions':\n return this.addExtrusions<P>(spec);\n case 'raster':\n return this.addRaster(spec);\n case 'ground':\n return this.addGround(spec);\n case 'network':\n return this.addNetwork(spec);\n case 'tiles3d':\n return this.addTiles3d(spec);\n case 'pointcloud':\n return this.addPointCloud(spec);\n case 'models':\n return this.addModels(spec);\n default:\n throw new Error(`isard: no layer of type ${String((spec as { type?: unknown }).type)}`);\n }\n }\n\n /** @internal Resolves once the map is idle (everything in view loaded and drawn) */\n whenIdle(): Promise<void> {\n if (this.gone) return Promise.resolve();\n return new Promise((resolve) => {\n const off = this.on('idle', () => {\n off();\n resolve();\n });\n this.requestRender();\n });\n }\n\n /** Lines from GeoJSON (line strings, and polygon outlines), styled per feature */\n addLines<P = Record<string, unknown>>(options: LineOptions<P>): LineLayer<P> {\n return this.place(new LineLayer<P>(this, options.data, lineStyle(options)), options.before);\n }\n\n /** Discs from GeoJSON points, styled per feature */\n addCircles<P = Record<string, unknown>>(options: CircleOptions<P>): CircleLayer<P> {\n return this.place(new CircleLayer<P>(this, options.data, circleStyle(options)), options.before);\n }\n\n /** Filled polygons from GeoJSON (holes included), styled per feature; over the relief they lie on the ground */\n addFills<P = Record<string, unknown>>(options: FillOptions<P>): FillLayer<P> {\n return this.place(new FillLayer<P>(this, options.data, fillStyle(options)), options.before);\n }\n\n /** The application's fragment shader over the ground (see `GroundOptions`); under `before` if given */\n addGround(options: GroundOptions & { before?: Layer }): GroundLayer {\n return this.place(new GroundLayer(this, options), options.before);\n }\n\n /** Polygons raised into blocks with depth (buildings), styled per feature; tiles of them come with `setTile` */\n addExtrusions<P = Record<string, unknown>>(options: ExtrusionOptions<P> = {}): ExtrusionLayer<P> {\n return this.place(new ExtrusionLayer<P>(this, options.data, extrusionStyle(options)), options.before);\n }\n\n /** Text labels from GeoJSON (points, the middle of lines, the center of polygons), placed without overlaps */\n addSymbols<P = Record<string, unknown>>(options: SymbolOptions<P>): SymbolLayer<P> {\n return this.place(new SymbolLayer<P>(this, options.data, symbolStyle(options)), options.before);\n }\n\n /** @internal The glyphs of the symbol layers, loaded on first use */\n get glyphs(): Glyphs {\n if (!this.#glyphs) {\n // The engine's context: the atlas stays within its texture size limit\n const gl = this.canvas.getContext('webgl2');\n const max = gl?.getParameter(gl.MAX_TEXTURE_SIZE);\n this.#glyphs = new Glyphs(this.glyphsUrl, typeof max === 'number' ? max : undefined);\n this.#glyphs.attach(this.engine);\n }\n return this.#glyphs;\n }\n\n /** @internal The icons of the symbol layers: the application's images and the vector basemaps' sprites */\n get icons(): Icons {\n if (!this.#icons) {\n const gl = this.canvas.getContext('webgl2');\n const max = gl?.getParameter(gl.MAX_TEXTURE_SIZE);\n this.#icons = new Icons(typeof max === 'number' ? max : undefined);\n this.#icons.attach(this.engine);\n }\n return this.#icons;\n }\n\n /**\n * An image for the symbol layers' icons (`icon: name`), as MapLibre's `addImage`: its pixels (an image, a canvas,\n * `ImageData`, or RGBA bytes with their size), `pixelRatio` 2 for an image drawn at twice its CSS size; `sdf` for a\n * signed distance field drawn in the `iconColor`; `stretchX`, `stretchY` and `content` for an icon stretched around its\n * text. An image of the same name is replaced\n */\n addImage(\n name: string,\n image: Pixels | (CanvasImageSource & { width: number; height: number }),\n options: ImageOptions = {},\n ): void {\n const pixels = 'data' in image ? image : readPixels(image);\n if (!pixels) throw new Error(`isard: the image ${name} has no pixels`);\n this.icons.add(name, pixels, options);\n }\n\n hasImage(name: string): boolean {\n return this.#icons?.has(name) ?? false;\n }\n\n removeImage(name: string): void {\n this.#icons?.remove(name);\n }\n\n /**\n * Vector tiles with a MapLibre style (OpenFreeMap's Positron by default): `tiles.raster(…)` draws its fills and lines\n * (or a subset) as a raster layer, `tiles.labels(…)` its labels. `setBasemap('osm-positron')` does both for the\n * basemap.\n */\n vectorTiles(options: VectorTilesOptions = {}): VectorTiles {\n const tiles = new VectorTiles(this, {\n ...(this.basemapWorkerUrl ? { workerUrl: this.basemapWorkerUrl } : {}),\n ...options,\n });\n // Its workers stop with the map\n this.vectorSets.add(tiles);\n return tiles;\n }\n\n /** @internal Forgets a destroyed `VectorTiles` */\n dropVectorTiles(tiles: VectorTiles): void {\n this.vectorSets.delete(tiles);\n }\n\n /**\n * @internal The workers for a `VectorTiles`: the map's shared pool, or a pool of its own (`own`, to stop with it)\n * when it asks for another count or URL\n */\n basemapWorkers(count?: number, url?: string | URL): { pool: BasemapWorkers; own: boolean } {\n const sharedUrl = this.basemapWorkerUrl;\n const shared = defaultWorkerCount();\n const workers = Math.max(1, count ?? shared);\n const workerUrl = url ?? sharedUrl;\n if (workers === shared && String(workerUrl) === String(sharedUrl)) {\n this.basemapPool ??= new BasemapWorkers(shared, sharedUrl);\n return { pool: this.basemapPool, own: false };\n }\n return { pool: new BasemapWorkers(workers, workerUrl), own: true };\n }\n\n /**\n * The workers decoding the relief and reprojecting rasters: the map's pool, unless the map has no workers\n * (`workers: false` or 0, or none in this browser): that is done in the page then\n */\n private decodingPool(): BasemapWorkers | undefined {\n const { workers } = this.tiles3dOptions;\n if (this.gone || workers === false || (workers !== undefined && workers <= 0)) return undefined;\n if (typeof Worker === 'undefined' || typeof OffscreenCanvas === 'undefined') return undefined;\n return this.basemapWorkers().pool;\n }\n\n private readonly remoteHeights: RemoteHeights = (url, encoding, floor, tile, signal) =>\n this.decodingPool()?.heights(url, encoding, floor, tile, signal, this);\n\n private readonly remoteReprojection: RemoteReprojection = (job, tile, signal) =>\n this.decodingPool()?.reproject(job, tile, signal, this);\n\n /** The loader of the relief tiles of `url` in a PNG encoding (one per URL, encoding and floor) */\n private readonly terrainLoader = (url: string, encoding: PngEncoding, floor?: number): TerrainLoader => {\n const key = `${encoding} ${floor ?? ''} ${url}`;\n let loader = this.terrainLoaders.get(key);\n if (!loader) {\n loader = encodedTerrainLoader(url, encoding, floor, this.remoteHeights);\n this.terrainLoaders.set(key, loader);\n }\n return loader;\n };\n\n /** Adds a layer, under `before` if given */\n private place<L extends Layer>(layer: L, before: Layer | undefined): L {\n this.addLayer(layer);\n if (before) this.moveLayer(layer, before);\n return layer;\n }\n\n /** Textured meshes in 3D Tiles (photogrammetry, buildings), drawn with depth over the basemap */\n addTiles3d(options: Tiles3dOptions): Tiles3dLayer {\n const { url, maxScreenSpaceError = 16, opacity = 1, pointSize, color, geoid = false } = options;\n return this.addLayer(\n new Tiles3dLayer(this, url, geoid, {\n maxScreenSpaceError,\n opacity,\n ...(pointSize !== undefined ? { pointSize } : {}),\n ...(color !== undefined ? { color } : {}),\n }),\n );\n }\n\n /**\n * A point cloud (see `PointCloudOptions`): a COPC file read by range requests (IGN's LiDAR HD…), or 3D Tiles\n * points; with depth, on the engine with 3D Tiles; under `before` if given\n */\n addPointCloud(options: PointCloudOptions & { before?: Layer }): PointCloudLayer {\n return this.place(new PointCloudLayer(this, options), options.before);\n }\n\n /** A glTF model drawn at positions (see `ModelOptions`), with depth; on the engine with 3D Tiles, as they are */\n addModels(options: ModelOptions & { before?: Layer }): ModelLayer {\n return this.place(new ModelLayer(this, options), options.before);\n }\n\n /**\n * The page's own WebGL drawing at its place among the layers, in every frame (see `CustomLayerInterface`): raw\n * WebGL, three.js… with the matrices of the frame (`frame.matrixAt`); under `before` if given\n */\n addCustomLayer(layer: CustomLayerInterface, options: { before?: Layer } = {}): CustomLayer {\n const custom = new CustomLayer(\n this,\n layer,\n this.canvas,\n this,\n (lon, lat, altitude) => this.engineClass.customMatrix(lon, lat, altitude),\n () => this.getCamera(),\n );\n return this.place(custom, options.before);\n }\n\n // ── Frames ──\n\n /** Asks for a frame; several calls before the next frame draw it once */\n requestRender(): void {\n // Changes made by listeners during a frame are drawn by that frame; nothing is drawn without a context\n if (this.inFrame || this.lost) return;\n this.frameRequest ||= requestAnimationFrame((now) => this.frame(now));\n }\n\n /** @internal Runs `step` every frame until it returns false; replaces the running animation */\n animate(step: Step | undefined): void {\n // A flight cut short no longer needs its destination\n if (this.animation) this.engine.clearPreload();\n this.animation = step;\n this.requestRender();\n }\n\n /** @internal The pointer moved over the map (undefined: it left). Without 'hover' and 'hoverfeature' listeners,\n * nothing is drawn: a still map stays idle under a moving mouse */\n hover(point: Point | undefined): void {\n if (!point) {\n this.hoverPoint = undefined;\n this.cancelHoverPick();\n return;\n }\n if (this.listeners.hover.size === 0 && this.listeners.hoverfeature.size === 0) return;\n this.hoverPoint = point;\n this.requestRender();\n }\n\n private frame(now: number): void {\n this.frameRequest = 0;\n try {\n this.inFrame = true;\n this.drawFrame(now);\n } finally {\n // Whatever throws in a frame, the next ones are still drawn\n this.inFrame = false;\n }\n }\n\n private drawFrame(now: number): void {\n if (this.animation && !this.animation(now)) this.animation = undefined;\n const camera = this.getCamera();\n const key = `${camera.center}|${camera.zoom}|${camera.pitch}|${camera.bearing}`;\n const moved = key !== this.lastCamera;\n if (moved) {\n // The first frame is no move\n if (!this.moving && this.lastCamera !== '') {\n this.moving = true;\n this.emit('movestart', camera);\n }\n this.lastCamera = key;\n this.emit('move', camera);\n } else if (this.moving && !this.animation && !this.interaction?.active) {\n this.moving = false;\n this.emit('moveend', camera);\n }\n // Values for the pointer position are computed before drawing, in the same frame\n let hovered: Point | undefined;\n if (this.hoverPoint) {\n const point = this.hoverPoint;\n hovered = point;\n this.hoverPoint = undefined;\n // The position under the pointer for its listeners only (a 'hoverfeature' alone does not need it)\n if (this.listeners.hover.size > 0) this.emit('hover', { point, lonLat: this.unproject(point) });\n }\n const t0 = performance.now();\n // The engine asks for the next frame while it draws (uploads past the frame budget, fades): not ignored\n this.inFrame = false;\n // As the engine has it now (a listener may have moved it), for the custom layers drawn in the frame\n this.frameCamera = this.layers.some((layer) => layer instanceof CustomLayer) ? this.engine.camera() : undefined;\n let loading: boolean;\n try {\n loading = this.engine.render();\n } finally {\n this.frameCamera = undefined;\n }\n this.inFrame = true;\n // The picking pass sees the frame just drawn; its answer comes on a later frame\n if (hovered && this.listeners.hoverfeature.size > 0) this.requestHoverPick(hovered);\n // Overlays follow the frame just drawn (camera, relief altitudes): all in one pass, transforms only\n for (const item of this.positioned) item.position(this.size);\n this.emit('render', { ms: performance.now() - t0 });\n this.inFrame = false;\n // A move goes on until a frame finds the camera still: that frame sends 'moveend'\n if (this.animation || (moved && this.moving)) this.requestRender();\n // Idle: nothing loading (the engine with 3D Tiles neither), no animation, no frame asked for (uploads waiting,\n // fades, listeners)\n if (loading || this.upgrading || this.animation || this.frameRequest !== 0) {\n this.settled = false;\n } else if (!this.settled) {\n this.settled = true;\n this.emit('idle', {});\n }\n }\n\n /** Resizes when the device pixel ratio changes (browser zoom, a window moved to another screen) */\n private watchRatio(): void {\n if (typeof matchMedia !== 'function') return;\n const query = matchMedia(`(resolution: ${window.devicePixelRatio || 1}dppx)`);\n const changed = () => {\n // A query for the new ratio\n this.unwatchRatio?.();\n this.watchRatio();\n this.resize();\n };\n query.addEventListener('change', changed, { once: true });\n this.unwatchRatio = () => query.removeEventListener('change', changed);\n }\n\n private resize(): void {\n if (this.lost) return;\n const { clientWidth: width, clientHeight: height } = this.canvas;\n const ratio = window.devicePixelRatio || 1;\n this.canvas.width = Math.round(width * ratio);\n this.canvas.height = Math.round(height * ratio);\n this.engine.resize(width, height, ratio);\n this.size = [width, height];\n this.emit('resize', { width, height });\n // Draw at once: a resized canvas is cleared, waiting one frame would flash\n cancelAnimationFrame(this.frameRequest);\n this.frame(performance.now());\n }\n\n destroy(): void {\n if (this.gone) return;\n this.gone = true;\n // A context restored later rebuilds nothing\n this.unwatchContext();\n const camera = this.getCamera();\n cancelAnimationFrame(this.frameRequest);\n this.cancelHoverPick();\n this.vector?.tiles.destroy();\n for (const tiles of [...this.vectorSets]) tiles.destroy();\n this.vectorSets.clear();\n this.basemapPool?.terminate();\n this.basemapPool = undefined;\n this.unwatchRatio?.();\n this.unwatchRatio = undefined;\n this.unwatchHeaders();\n this.resizeObserver.disconnect();\n this.interaction?.destroy();\n this.loader?.destroy();\n // Custom layers free their WebGL objects, models their data, while the context is there\n for (const layer of this.layers) layer.dispose();\n this.engine.free();\n // Work still under way (labels being shaped, tiles arriving, timers) may call the engine after this: it finds one\n // that does nothing, and nothing is drawn again\n this.#engine = destroyedEngine(camera);\n // Glyph ranges still arriving upload to it, not to the freed engine\n this.#glyphs?.attach(this.#engine);\n this.#icons?.attach(this.#engine);\n this.lost = true;\n for (const control of [...this.controls.keys()]) this.removeControl(control);\n this.positioned.clear();\n this.canvas.remove();\n this.overlay.remove();\n for (const position of CORNERS) this.corners[position].remove();\n this.container.classList.remove('isard-map');\n for (const listeners of Object.values(this.listeners)) listeners.clear();\n }\n}\n\n/** The page's request headers to an engine (its own requests: raster tiles, tilesets, point clouds) */\nfunction sendHeaders(engine: Engine, rules: HeaderRules): void {\n engine.setRequestHeaders(\n rules.map(([prefix]) => prefix),\n Uint32Array.from(rules, ([, headers]) => Object.keys(headers).length),\n rules.flatMap(([, headers]) => Object.entries(headers).flat()),\n );\n}\n\n/** A layer by its type and the options of its `add…` method (`GeoMap.add`) */\nexport type LayerSpec<P = Record<string, unknown>> =\n | ({ type: 'lines' } & LineOptions<P>)\n | ({ type: 'circles' } & CircleOptions<P>)\n | ({ type: 'fills' } & FillOptions<P>)\n | ({ type: 'symbols' } & SymbolOptions<P>)\n | ({ type: 'extrusions' } & ExtrusionOptions<P>)\n | ({ type: 'raster' } & RasterOptions & { before?: Layer })\n | ({ type: 'ground' } & GroundOptions & { before?: Layer })\n | ({ type: 'network' } & NetworkOptions)\n | ({ type: 'tiles3d' } & Tiles3dOptions)\n | ({ type: 'pointcloud' } & PointCloudOptions & { before?: Layer })\n | ({ type: 'models' } & ModelOptions & { before?: Layer });\n"]}
|
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAEL,gBAAgB,EAEhB,YAAY,EACZ,WAAW,GAEZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAoB,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAyB,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EACL,WAAW,EAEX,WAAW,EAEX,SAAS,EAET,SAAS,EACT,SAAS,EAET,SAAS,GACV,MAA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C,OAAO,EAAE,CAAC;QACxB,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACrC,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACvB,wFAAwF;QACxF,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACnB,kHAAkH;QAClH,gDAAgD;QAChD,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACvC,oEAAoE;QACpE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["/**\n * The map: canvas, camera, layers, events, overlays, credits and the frame loop. Frames are drawn on demand only: an\n * idle map costs nothing. Hover events are coalesced to one per frame, so the values computed for a mouse position are\n * drawn in the same frame. The engine's loading is in engine-loader.ts, its settings from the options in settings.ts,\n * the camera animations in animation.ts; the parts of the map with a state of their own (the drawing order of the\n * layers, the overlays and controls, the frame loop, the hover picking, the workers…) in map/.\n */\n\nimport { SEA } from './basemap/basemaps.ts';\nimport {\n type BasemapWorkers,\n defaultWorkerUrl,\n type PmtilesOptions,\n pmtilesLayer,\n VectorTiles,\n type VectorTilesOptions,\n} from './basemap/vectortiles.ts';\nimport { onHeaderRules } from './engine/requests.ts';\nimport { destroyedEngine, type EngineClass, engineUrl, loadEngine } from './engine-loader.ts';\nimport { IGN_PRESETS } from './geoplateforme.ts';\nimport { ExtrusionLayer, type ExtrusionOptions, extrusionStyle } from './layers/extrusions.ts';\nimport {\n CircleLayer,\n type CircleOptions,\n circleStyle,\n type Feature,\n FillLayer,\n type FillOptions,\n fillStyle,\n LineLayer,\n type LineOptions,\n lineStyle,\n} from './layers/features.ts';\nimport type { Glyphs } from './layers/glyphs.ts';\nimport type { Icons, ImageOptions, Pixels } from './layers/icons.ts';\nimport {\n CustomLayer,\n type CustomLayerInterface,\n GroundLayer,\n type GroundOptions,\n type Layer,\n ModelLayer,\n type ModelOptions,\n NetworkLayer,\n RasterLayer,\n Tiles3dLayer,\n} from './layers/layers.ts';\nimport { loadPanoramas, type PanoramaOptions, type Panoramas } from './layers/panoramas.ts';\nimport { PointCloudLayer, type PointCloudOptions } from './layers/pointclouds.ts';\nimport { SymbolLayer, type SymbolOptions, symbolStyle } from './layers/symbols.ts';\nimport { BasemapLayers } from './map/basemap-layers.ts';\nimport { createCanvas, labelCanvas, watchContext, watchPixelRatio } from './map/canvas.ts';\nimport { checkBasemap, report, validateNetwork } from './map/checks.ts';\nimport { Credits } from './map/credits.ts';\nimport { mapSettings, sendHeaders } from './map/engine-settings.ts';\nimport { MapEngines } from './map/engines.ts';\nimport { MapListeners } from './map/events.ts';\nimport { FrameLoop } from './map/frame-loop.ts';\nimport { HoverPick, type HoverPicking } from './map/hover-pick.ts';\nimport { addSpec, type LayerSpec } from './map/layer-spec.ts';\nimport { LayerStack } from './map/layer-stack.ts';\nimport { OverlayHost } from './map/overlay-host.ts';\nimport { panoramaHost } from './map/panorama-host.ts';\nimport { rasterSource } from './map/raster-source.ts';\nimport { SymbolAtlases } from './map/symbol-atlases.ts';\nimport { applyViewshed } from './map/viewshed.ts';\nimport { MapWorkers } from './map/workers.ts';\nimport { atmosphereSettings, rgb, type Settings, terrainSettings } from './settings.ts';\nimport type {\n AnimationOptions,\n AtmosphereOptions,\n Basemap,\n CelestialBody,\n FeatureHit,\n FirstPersonView,\n FlyToOptions,\n GeoMapOptions,\n LoadingMode,\n LonLat,\n MapEvents,\n NetworkOptions,\n Point,\n Projection,\n RasterOptions,\n SwipeOptions,\n TerrainModel,\n TerrainOptions,\n Tiles3dOptions,\n ViewshedOptions,\n} from './types.ts';\nimport { AttributionControl, type Control, type ControlPosition } from './ui/controls.ts';\nimport { Interaction } from './ui/interaction.ts';\nimport type { Positioned } from './ui/overlay.ts';\nimport { easeTo, flyTo, type Step } from './util/animation.ts';\nimport type { Camera, Engine, PickHit, RasterLayerStats } from './wasm/isard.js';\n\nexport type { LayerSpec } from './map/layer-spec.ts';\n\n/** A layer whose picked features come back with their properties (lines, circles, fills, extrusions, 3D Tiles…) */\nconst hasFeatures = (layer: Layer): layer is Layer & { featureAt(index: number): Feature | undefined } =>\n 'featureAt' in layer && typeof layer.featureAt === 'function';\n\n/** A map (see `GeoMap.create`); layers take it as their host */\nexport class GeoMap {\n readonly canvas: HTMLCanvasElement;\n #engine: Engine;\n /** The engine class (core, or with 3D Tiles) and the engine with 3D Tiles loaded when needed */\n private readonly engines: MapEngines;\n /** The layers in drawing order and those kept on top */\n private readonly stack = new LayerStack(() => this.#engine);\n /** The basemap and the hillshade */\n private readonly basemaps: BasemapLayers;\n /** The glyphs and icons of the symbol layers */\n private readonly atlases: SymbolAtlases;\n /** The workers of the vector tiles, the relief and the reprojected rasters */\n private readonly workers: MapWorkers;\n private readonly container: HTMLElement;\n /** The canvas in the container, the markers and popups over it, the controls in its corners */\n private readonly overlays: OverlayHost;\n private readonly settings: Settings;\n /** The WebGL context is lost: nothing is drawn until it is restored */\n private lost = false;\n private gone = false;\n private readonly listeners = new MapListeners();\n /** Frames drawn on demand, with their events */\n private readonly frames: FrameLoop;\n private readonly resizeObserver: ResizeObserver;\n private readonly interaction: Interaction | undefined;\n /** The map is of the Earth: a basemap by default */\n private readonly earth: boolean;\n /** The body, as the option named it */\n private readonly body: CelestialBody | undefined;\n /** Credits of the raster layers that have some, and the attribution controls told when they change */\n private readonly credits = new Credits();\n /** The picking for 'hoverfeature', its answer emitted on a later frame */\n private readonly hoverPick = new HoverPick(\n () => this.engine,\n () => this.lost,\n (result) =>\n this.emit('hoverfeature', {\n point: [result.x, result.y],\n lonLat: result.lonLat,\n hit: result.hit && this.featureHit(result.hit),\n }),\n );\n /** What 'hoverfeature' looks for: within `radius` CSS pixels, in `layers` only if given */\n hoverPicking: HoverPicking = {};\n /** Vector tiles made by `vectorTiles()`, destroyed with the map */\n private readonly vectorSets = new Set<VectorTiles>();\n /** Stops watching the device pixel ratio */\n private readonly unwatchRatio: () => void;\n /** Stops following the page's request headers (`setRequestHeaders`) */\n private unwatchHeaders: () => void = () => undefined;\n /** Stops listening to the canvas's context loss and restoration */\n private readonly unwatchContext: () => void;\n\n /** Loads the engine (once per page) and creates a map filling `container` */\n static async create(container: HTMLElement, given: GeoMapOptions = {}): Promise<GeoMap> {\n // A preset under the options given\n const options: GeoMapOptions = given.preset ? { ...IGN_PRESETS[given.preset], ...given } : given;\n // With 3D Tiles from the start when asked, or when only that engine's URL is given (as before the core engine)\n const full = options.tiles3d === true || (options.wasmUrl !== undefined && options.coreWasmUrl === undefined);\n\n // Before anything is created\n if (options.basemap !== undefined) checkBasemap(options.basemap);\n\n const kind = full ? 'full' : 'core';\n const bindings = await loadEngine(kind, engineUrl(kind, options));\n const map = new GeoMap(container, options, bindings.Engine, full ? bindings.module : undefined);\n\n if (options.tiles3d === 'preload' && !full) map.preloadTiles3d();\n\n return map;\n }\n\n private constructor(\n container: HTMLElement,\n options: GeoMapOptions,\n engineClass: EngineClass,\n tiles3dModule: WebAssembly.Module | undefined,\n ) {\n this.engines = new MapEngines(engineClass, tiles3dModule, options, () => this.gone);\n\n const workerUrl = options.basemapWorkerUrl ?? defaultWorkerUrl(options.assetsUrl);\n\n this.workers = new MapWorkers(workerUrl, options.workers, () => this.gone, this);\n this.basemaps = new BasemapLayers(this, this.stack, workerUrl, options.basemapTileSize);\n this.container = container;\n this.canvas = createCanvas();\n this.atlases = new SymbolAtlases(this.canvas, options.glyphs, () => this.#engine);\n this.overlays = new OverlayHost(container, this.canvas, this);\n this.earth = (options.body ?? 'earth') === 'earth';\n this.body = options.body;\n this.settings = mapSettings(options, this.earth, this.workers.terrainLoader);\n this.frames = new FrameLoop(\n {\n engine: () => this.engine,\n camera: () => this.getCamera(),\n lost: () => this.lost,\n interacting: () => this.interaction?.active === true,\n customLayers: () => this.layers.some((layer) => layer instanceof CustomLayer),\n upgrading: () => this.engines.upgrading !== undefined,\n drawn: (hovered) => {\n // The picking pass sees the frame just drawn; its answer comes on a later frame\n if (hovered && this.listeners.has('hoverfeature')) this.hoverPick.request(hovered, this.hoverPicking);\n // Overlays follow the frame just drawn\n this.overlays.positionAll();\n },\n },\n this.listeners,\n );\n this.#engine = this.createEngine();\n // Once it has an engine: a map whose creation failed before is not left following them\n this.unwatchHeaders = onHeaderRules((rules) => sendHeaders(this.#engine, rules));\n // The browser may take the GPU away (driver reset, background tab on mobile): the map waits, then rebuilds\n this.unwatchContext = watchContext(\n this.canvas,\n () => {\n this.lost = true;\n this.frames.cancel();\n },\n () => this.restore(),\n );\n\n const start: Camera = this.earth\n ? { center: [2.4246, 48.8457], zoom: 13, pitch: 0, bearing: 0 }\n : { center: [0, 0], zoom: 2, pitch: 0, bearing: 0 };\n\n this.setCamera({ ...start, ...options });\n this.setBasemap(options.basemap ?? (this.earth ? 'osm-positron' : 'none'), options.hillshade ?? 0);\n this.resizeObserver = new ResizeObserver(() => this.resize());\n this.resizeObserver.observe(container);\n this.unwatchRatio = watchPixelRatio(() => this.resize());\n this.resize();\n\n const interactive = options.interactive ?? true;\n const keyboard = interactive && (options.keyboard ?? true);\n\n this.interaction = interactive ? new Interaction(this, { keyboard }) : undefined;\n labelCanvas(this.canvas, keyboard, options.ariaLabel ?? 'Map');\n\n const attribution = options.attributionControl ?? true;\n\n if (attribution !== false) {\n this.addControl(new AttributionControl(attribution === true ? {} : attribution), 'bottom-right');\n }\n }\n\n /** The element the map was created in */\n getContainer(): HTMLElement {\n return this.container;\n }\n\n getCanvas(): HTMLCanvasElement {\n return this.canvas;\n }\n\n /** @internal The engine (replaced after a context loss) */\n get engine(): Engine {\n return this.#engine;\n }\n\n /** Layers in drawing order (bottom first) */\n private get layers(): readonly Layer[] {\n return this.stack.layers;\n }\n\n /** Layers new layers go under */\n private get onTop(): Set<Layer> {\n return this.stack.onTop;\n }\n\n private createEngine(): Engine {\n return this.engines.create(this.canvas, () => this.requestRender(), this.settings);\n }\n\n /** A 3D Tiles layer or a model on the core engine: loads the engine with 3D Tiles, then rebuilds the map on it\n * (camera, settings and layers kept, as after a context loss); the layer is created then */\n private upgrade(): void {\n this.engines.upgrade(\n () => {\n // A lost context: the engine is rebuilt on it once restored\n if (!this.lost) this.restore();\n },\n (error) => {\n // The 3D Tiles layers stay empty; the next one added tries again\n report(error);\n this.requestRender();\n },\n );\n }\n\n /** Downloads and compiles the engine with 3D Tiles once the map is idle (`tiles3d: 'preload'`), without running\n * it: the first 3D Tiles layer then only instantiates it */\n private preloadTiles3d(): void {\n if (this.frames.settled) this.engines.preload();\n else {\n const off = this.on('idle', () => {\n off();\n this.engines.preload();\n });\n }\n }\n\n /** After a context loss: a new engine with the same camera, settings and layers (same handles, same order) */\n private restore(): void {\n if (this.gone) return;\n this.hoverPick.cancel();\n\n const camera = this.getCamera();\n\n this.#engine.free();\n this.#engine = this.createEngine();\n this.lost = false;\n this.setCamera(camera);\n this.atlases.attach(this.#engine);\n // Those still waiting for the engine with 3D Tiles (loading, or failed) are created with it\n this.stack.reattach(this.#engine, (layer) => layer.needsFullEngine && !this.engines.tiles3d);\n this.applySwipe();\n // A street-level eye stays one in the new engine\n if (this.#firstPerson) this.setFirstPerson(this.#firstPerson);\n // What the old engine drew over the scene: the viewshed, the panoramas shown\n if (this.viewshed) this.setViewshed(this.viewshed);\n this.panoramaSets.forEach((set) => {\n if (set.current) void set.show(set.current.index).catch(report);\n });\n this.resize();\n }\n\n /** The street-level eye, while there is one (`setFirstPerson`) */\n #firstPerson: Required<FirstPersonView> | undefined;\n\n /** The street-level eye, if the camera is one */\n get firstPerson(): Readonly<Required<FirstPersonView>> | undefined {\n return this.#firstPerson;\n }\n\n /**\n * Puts the camera at street level: an eye `height` metres above the ground, looking `bearing` and `pitch`, the\n * drag turning it around (the wheel narrows or widens its field of view); undefined gives back the camera turning\n * around a point, above where the eye stood, facing the same way\n */\n setFirstPerson(view: FirstPersonView | undefined): void {\n if (!view) {\n const was = this.#firstPerson;\n\n this.#firstPerson = undefined;\n if (was) this.setCamera({ center: was.lonLat, zoom: 18, pitch: 60, bearing: was.bearing });\n\n return;\n }\n\n const lonLat: LonLat = [view.lonLat[0], view.lonLat[1]];\n const eye = { height: 1.7, pitch: 90, fov: 75, ...view, lonLat };\n\n eye.pitch = Math.max(1, Math.min(179, eye.pitch));\n eye.fov = Math.max(10, Math.min(140, eye.fov));\n eye.bearing = ((eye.bearing % 360) + 360) % 360;\n this.#firstPerson = eye;\n this.engine.setFirstPerson(eye.lonLat[0], eye.lonLat[1], eye.height, eye.bearing, eye.pitch, eye.fov);\n this.requestRender();\n }\n\n /** The swipe set (`setSwipe`), applied again with the layers' ids of a new engine */\n private swipe: SwipeOptions | undefined;\n\n /**\n * Compares two states of a place: `layers` shown on one side of a vertical line only, at `position` CSS pixels\n * from the left of the map (left of it by default, `side: 'right'` for the other), the layers beneath them on the\n * other side. Set again as the line moves (a slider, a drag); undefined stops\n */\n setSwipe(options: SwipeOptions | undefined): void {\n this.swipe = options && options.layers.length > 0 ? { ...options, layers: [...options.layers] } : undefined;\n this.applySwipe();\n this.requestRender();\n }\n\n private applySwipe(): void {\n const s = this.swipe;\n const ids = Uint32Array.from(\n (s?.layers ?? []).filter((l) => l.id >= 0),\n (l) => l.id,\n );\n\n this.engine.setSwipe(s && ids.length > 0 ? s.position : Number.NaN, s?.side === 'right', ids);\n }\n\n /** @internal Forgets a removed layer */\n detach(layer: Layer): void {\n this.stack.forget(layer);\n this.credits.forget(layer);\n }\n\n /** @internal The layer is on the map */\n hasLayer(layer: Layer): boolean {\n return !this.gone && this.stack.has(layer);\n }\n\n private addLayer<L extends Layer>(layer: L): L {\n // On the core engine, a 3D Tiles layer or a model waits for the engine with 3D Tiles: it is created with the\n // others on it\n if (layer.needsFullEngine && !this.engines.tiles3d) this.upgrade();\n else layer.attach(this.engine);\n // Under the layers kept on top (the basemap's labels)\n this.stack.add(layer);\n this.requestRender();\n\n return layer;\n }\n\n /** @internal Keeps a layer above the layers added after it (they go under it), as the labels of a basemap */\n keepOnTop(layer: Layer): void {\n this.onTop.add(layer);\n }\n\n /** @internal Moves a layer under `before`, or on top of all */\n moveLayer(layer: Layer, before: Layer | undefined): void {\n this.stack.move(layer, before);\n this.requestRender();\n }\n\n /** @internal See `LayerHost.replaceLayer` */\n replaceLayer(layer: Layer, old: number): void {\n this.stack.replace(layer, old);\n }\n\n // ── Events ──\n\n /** Listens to an event; returns the function that stops listening */\n on<K extends keyof MapEvents>(type: K, listener: (event: MapEvents[K]) => void): () => void {\n return this.listeners.on(type, listener);\n }\n\n /** @internal Calls the listeners; one that throws is reported and does not stop the others nor the frame */\n emit<K extends keyof MapEvents>(type: K, event: MapEvents[K]): void {\n this.listeners.emit(type, event);\n }\n\n // ── Camera ──\n\n /**\n * The camera's methods together: `get`, `set`, `easeTo`, `flyTo`, `bounds`, `firstPerson` and `setFirstPerson`\n * (street level), `project`, `unproject`; the same as the map's own (`getCamera`, `setCamera`…)\n */\n readonly camera = {\n get: (): Camera => this.getCamera(),\n set: (camera: Partial<Camera>): void => this.setCamera(camera),\n easeTo: (camera: Partial<Camera>, options?: number | AnimationOptions): void => this.easeTo(camera, options),\n flyTo: (camera: Partial<Camera>, options?: FlyToOptions): void => this.flyTo(camera, options),\n bounds: (): [west: number, south: number, east: number, north: number] => this.getBounds(),\n firstPerson: (): Readonly<Required<FirstPersonView>> | undefined => this.firstPerson,\n setFirstPerson: (view: FirstPersonView | undefined): void => this.setFirstPerson(view),\n project: (lonLat: LonLat, height?: number): Point | undefined => this.project(lonLat, height),\n unproject: (point: Point): LonLat | undefined => this.unproject(point),\n } as const;\n\n /**\n * What lies under a point or at a position, together: `feature` (`pickFeature`), `surface` (`pickSurface`),\n * `surfaceAt`, `elevationAt`, `metersPerPixel`\n */\n readonly query = {\n feature: (point: Point, options?: { radius?: number; layers?: readonly Layer[] }): FeatureHit | undefined =>\n this.pickFeature(point, options),\n surface: (point: Point): { lonLat: LonLat; height: number } | undefined => this.pickSurface(point),\n surfaceAt: (lonLat: LonLat): number | undefined => this.surfaceAt(lonLat),\n elevationAt: (lonLat: LonLat): number | undefined => this.elevationAt(lonLat),\n metersPerPixel: (point?: Point): number | undefined => this.metersPerPixel(point),\n } as const;\n\n /** What is drawn over the scene, together: `viewshed` (`setViewshed`), `swipe` (`setSwipe`) */\n readonly effects = {\n viewshed: (options: ViewshedOptions | readonly ViewshedOptions[] | undefined): void => this.setViewshed(options),\n swipe: (options: SwipeOptions | undefined): void => this.setSwipe(options),\n } as const;\n\n getCamera(): Camera {\n return this.frames.camera ?? this.engine.camera();\n }\n\n setCamera(camera: Partial<Camera>): void {\n const c = { ...this.getCamera(), ...camera };\n\n this.engine.setCamera(c.center[0], c.center[1], c.zoom, c.pitch, c.bearing);\n this.requestRender();\n }\n\n /** Animated move to a camera: over `duration` milliseconds (or the options), ease-out by default */\n easeTo(camera: Partial<Camera>, options: number | AnimationOptions = 600): void {\n const from = this.getCamera();\n const to = { ...from, ...camera };\n\n this.animate(easeTo(() => this.engine, from, to, options));\n // The destination's tiles load during the flight (as Cesium does)\n this.engine.preload(to.center[0], to.center[1], to.zoom, to.pitch, to.bearing);\n }\n\n /**\n * Flight to a camera that zooms out on its way and back in (van Wijk and Nuij's optimal path, as MapLibre's\n * `flyTo`): long moves stay readable. Pitch and bearing follow the progress.\n */\n flyTo(camera: Partial<Camera>, options: FlyToOptions = {}): void {\n const from = this.getCamera();\n const to = { ...from, ...camera };\n const viewport = Math.max(this.canvas.clientWidth, this.canvas.clientHeight);\n\n this.animate(flyTo(() => this.engine, from, to, viewport, options));\n this.engine.preload(to.center[0], to.center[1], to.zoom, to.pitch, to.bearing);\n }\n\n /** Longitudes and latitudes the view covers on the ground: `[west, south, east, north]` */\n getBounds(): [west: number, south: number, east: number, north: number] {\n const [west = -180, south = -85, east = 180, north = 85] = this.engine.bounds();\n\n return [west, south, east, north];\n }\n\n /** Lowest zoom the camera accepts (the widest view) */\n setMinZoom(zoom: number): void {\n this.settings.zoomRange[0] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n setMaxZoom(zoom: number): void {\n this.settings.zoomRange[1] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n /** Highest pitch, degrees, up to 85 */\n setMaxPitch(pitch: number): void {\n this.settings.maxPitch = pitch;\n this.engine.setMaxPitch(pitch);\n this.requestRender();\n }\n\n /** Sky over the plane and the fog of the ground (see `GeoMapOptions.atmosphere`); undefined to remove them */\n setAtmosphere(options: AtmosphereOptions | undefined): void {\n this.settings.atmosphere = atmosphereSettings(options);\n this.engine.setAtmosphere(this.settings.atmosphere);\n this.requestRender();\n }\n\n setProjection(projection: Projection): void {\n this.settings.globe = projection === 'globe';\n this.engine.setGlobe(this.settings.globe);\n this.requestRender();\n }\n\n /** How tiles load and show (see `LoadingMode`) */\n setLoading(mode: LoadingMode): void {\n this.settings.loading = mode;\n this.engine.setImmediateLoading(mode === 'immediate');\n this.requestRender();\n }\n\n /** Space behind the globe (stars, atmosphere halo) */\n setSky(enabled: boolean): void {\n this.settings.sky = enabled;\n this.engine.setSky(enabled);\n this.requestRender();\n }\n\n /** The viewshed set, set again in a new engine */\n private viewshed: ViewshedOptions | readonly ViewshedOptions[] | undefined;\n\n /** Tints what can be seen from a point and what is hidden from it, within a range, all around or within a cone\n * (`direction`): the relief, extrusions, 3D Tiles and models hide what lies behind them (only what the map has\n * loaded for its view). Several observers (16 at most): what any of them sees is seen, what is hidden from all those\n * that reach it is hidden, in the colors and opacity of the first. Undefined or none removes it */\n setViewshed(options: ViewshedOptions | readonly ViewshedOptions[] | undefined): void {\n this.viewshed = options;\n if (applyViewshed(this.engine, options)) this.requestRender();\n }\n\n /** Relief under the basemap: true for the body's terrain model (on the Earth the worldwide Terrain Tiles, NASA's\n * on the Moon and Mars), one of the Earth's models by name (`'ign'`), its options, or false; on another body, its\n * options with a `url` */\n setTerrain(terrain: boolean | TerrainModel | TerrainOptions): void {\n this.settings.terrain = terrainSettings(terrain, this.body, this.settings.body.radius, this.workers.terrainLoader);\n\n const t = this.settings.terrain;\n\n this.engine.setTerrain(t?.url, t?.exaggeration ?? 1, t?.maxZoom, t?.geoid, t?.loader);\n this.credits.changed();\n this.requestRender();\n }\n\n /** @internal The credits of the raster layers (the basemap first) and of the relief in use, each once */\n attributions(): string[] {\n return this.credits.of(this.layers, this.settings.terrain?.attribution);\n }\n\n /** @internal Calls `listener` when the credits change; returns what stops it */\n onAttributionChange(listener: () => void): () => void {\n return this.credits.onChange(listener);\n }\n\n /** Color behind the map, a CSS color (its alpha ignored) */\n setBackground(color: string): void {\n this.settings.background = rgb(color);\n this.engine.setBackground(...this.settings.background);\n this.requestRender();\n }\n\n /** Tile counters of the raster layers, for diagnostics */\n stats(): RasterLayerStats[] {\n return this.engine.stats();\n }\n\n /**\n * The feature under a screen point (CSS pixels), undefined if none: its layer id and index. Reads one pixel of an\n * offscreen picking pass, whatever the number of features, but waits for the GPU to finish the frame (a stall): for\n * clicks and one-off queries. On hover, listen to 'hoverfeature' instead, which picks without waiting.\n */\n pick(point: Point, radius = 0, layers?: readonly Layer[]): PickHit | undefined {\n const only = layers && Uint32Array.from(layers.map((l) => l.id));\n\n return this.engine.pick(point[0], point[1], radius, only);\n }\n\n /**\n * The feature under a screen point (CSS pixels), or the nearest one within `radius` pixels: its layer handle, its\n * index there and, for line, circle and fill layers, the feature itself; undefined if none. `layers` restricts the\n * search to some layers (the others hide nothing).\n */\n pickFeature(point: Point, options: { radius?: number; layers?: readonly Layer[] } = {}): FeatureHit | undefined {\n const hit = this.pick(point, options.radius ?? 0, options.layers);\n\n return hit && this.featureHit(hit);\n }\n\n /** A hit with its layer handle and feature; undefined if the layer is gone */\n private featureHit(hit: PickHit): FeatureHit | undefined {\n const layer = this.layers.find((l) => l.id === hit.layer);\n\n if (!layer) return undefined;\n\n const feature = hasFeatures(layer) ? layer.featureAt(hit.index) : undefined;\n\n return { layer, index: hit.index, feature };\n }\n\n /** Screen point (CSS pixels) of a position on the ground (the relief), or `height` metres above it, undefined\n * behind the camera */\n project(lonLat: LonLat, height = 0): Point | undefined {\n return this.engine.project(lonLat[0], lonLat[1], height);\n }\n\n /** Position under a screen point (CSS pixels), undefined above the horizon */\n unproject(point: Point): LonLat | undefined {\n return this.engine.ground(point[0], point[1]);\n }\n\n /**\n * Street-level panoramas (oriented images of a vehicle's cameras, the iTowns immersive format): their positions\n * and calibrations loaded, none shown until `show`, which projects one onto the scene around it\n */\n async addPanoramas(options: PanoramaOptions): Promise<Panoramas> {\n // Drawn by the engine with 3D Tiles: loaded first if needed\n if (!this.engines.tiles3d) {\n this.upgrade();\n await this.engines.upgrading;\n if (!this.engines.tiles3d)\n throw new Error('isard: panoramas need the engine with 3D Tiles, which failed to load');\n }\n\n const host = panoramaHost(this, (lon, lat) => this.engines.geoidHeight(lon, lat));\n const panoramas = await loadPanoramas(host, options);\n\n this.panoramaSets.add(panoramas);\n\n return panoramas;\n }\n\n /** The panorama sets, their panorama shown again in a new engine */\n private readonly panoramaSets = new Set<Panoramas>();\n\n /** Altitude of the relief at a position, in metres (exaggeration included): from the copy of its tiles the map\n * keeps, as fine as the tiles loaded there; undefined without relief or where none is loaded yet */\n elevationAt(lonLat: LonLat): number | undefined {\n return this.engine.elevationAt(lonLat[0], lonLat[1]);\n }\n\n /** Metres on the ground per CSS pixel at a screen point (default the center of the map), across the screen: for a\n * scale bar; undefined above the horizon */\n metersPerPixel(point?: Point): number | undefined {\n const [x, y] = point ?? [this.canvas.clientWidth / 2, this.canvas.clientHeight / 2];\n const a = this.unproject([x - 0.5, y]);\n const b = this.unproject([x + 0.5, y]);\n\n if (!a || !b) return undefined;\n\n // Haversine, on the mean radius of the body\n const rad = Math.PI / 180;\n const [dLat, dLon] = [(b[1] - a[1]) * rad, (b[0] - a[0]) * rad];\n const h = Math.sin(dLat / 2) ** 2 + Math.cos(a[1] * rad) * Math.cos(b[1] * rad) * Math.sin(dLon / 2) ** 2;\n\n return 2 * this.settings.body.radius * Math.asin(Math.min(1, Math.sqrt(h)));\n }\n\n /** Whether a double click zooms in (Shift: out), on by default: off while a drawing takes double clicks */\n setDoubleClickZoom(enabled: boolean): void {\n if (this.interaction) this.interaction.doubleClickZoom = enabled;\n }\n\n /** What is drawn under a screen point (CSS pixels), on the relief or standing on it (a roof, a wall, a mesh): its\n * position and its height above the relief, in metres; undefined where nothing was drawn. The last frame's scene is\n * drawn again and read back, waiting for the GPU (a stall): for clicks and drags */\n pickSurface(point: Point): { lonLat: LonLat; height: number } | undefined {\n const hit = this.engine.surface(point[0], point[1]);\n\n return hit && { lonLat: [hit[0], hit[1]], height: hit[2] };\n }\n\n /** The height above the relief, in metres, of the top of what stands at a position: a roof, a mesh, 0 on the bare\n * ground; undefined where nothing of the last frame is there. The scene is drawn from above into a single pixel and\n * read back: cheap, but it waits for the GPU */\n surfaceAt(lonLat: LonLat): number | undefined {\n return this.engine.surfaceAt(lonLat[0], lonLat[1]);\n }\n\n // ── Overlays and controls ──\n\n /** Adds a control in a corner of the map; controls stack from the corner inward */\n addControl(control: Control, position: ControlPosition = 'top-right'): this {\n this.overlays.addControl(control, position);\n\n return this;\n }\n\n removeControl(control: Control): this {\n this.overlays.removeControl(control);\n\n return this;\n }\n\n /** @internal Shows a marker or popup, placed after every frame from now on */\n attachOverlay(item: Positioned, element: HTMLElement): void {\n this.overlays.attach(item, element);\n }\n\n /** @internal */\n detachOverlay(item: Positioned, element: HTMLElement): void {\n this.overlays.detach(item, element);\n }\n\n /** @internal Places one overlay now (it moved), without drawing a frame */\n positionOverlay(item: Positioned): void {\n this.overlays.position(item);\n }\n\n // ── Layers ──\n\n /** Replaces the basemap and the IGN hillshade, under the other layers (hillshade by default: 0, none). The former\n * names of the Géoplateforme basemaps throw, naming the new ones */\n setBasemap(basemap: Basemap, hillshade = 0): void {\n const name = checkBasemap(basemap);\n\n this.basemaps.replace(name);\n // Off the Earth, the body's own color\n if (this.earth) this.settings.globeColor = SEA[name];\n this.engine.setGlobeColor(...this.settings.globeColor);\n this.basemaps.addHillshade(hillshade);\n this.credits.changed();\n }\n\n /** Raster tiles ({z}, {x}, {y} URL; Web Mercator, or reprojected from another `grid`: longitudes and latitudes,\n * Lambert-93, UTM…), over the layers already added */\n addRaster(options: RasterOptions & { before?: Layer }): RasterLayer {\n const { url, opacity = 1, saturation = 1, size, before } = options;\n const { loader, minZoom, maxZoom } = rasterSource(options, this.workers.remoteReprojection);\n const layer = new RasterLayer(this, { url, minZoom, maxZoom, opacity, saturation, size, loader });\n\n this.place(layer, before);\n if (options.attribution) this.credits.set(layer, options.attribution);\n\n return layer;\n }\n\n /**\n * A PMTiles archive (v3) read by range requests: a raster layer of its images, or vector tiles drawn with `style` (by\n * default a plain style of the archive's layers) with their labels. Its header decides which unless `kind` says;\n * `url` with or without `pmtiles://`, relative to the page, or a `blob:` URL. `addRaster({ url: 'pmtiles://…' })` and\n * a style source `pmtiles://…` in `vectorTiles` read archives too\n */\n addPmtiles(url: string, options: PmtilesOptions = {}): Promise<RasterLayer | VectorTiles> {\n return pmtilesLayer(this, url, options);\n }\n\n /** Line network colored by a value per node; `layer.setValues` recolors it in one texture upload */\n addNetwork(options: NetworkOptions): NetworkLayer {\n const { nodes, edges, lines, costs, edgeWidths, width = 2, max = 1800, contour = 0, opacity = 1 } = options;\n const { halo = 0, haloOpacity = 0.11, ramp, unreachedColor = 'rgba(140, 140, 140, 0.25)', fade = 0 } = options;\n const style = { width, max, contour, opacity, halo, haloOpacity, ramp, unreachedColor, fade };\n\n validateNetwork(nodes, edges);\n\n return this.addLayer(new NetworkLayer(this, { nodes, edges, lines }, costs, style, edgeWidths));\n }\n\n /**\n * A layer from its description, as an application's configuration gives it: `{ type, ...options }`, the options of\n * the `add…` method of that type (`'lines'` for `addLines`, `'tiles3d'` for `addTiles3d`…); `before` to go under\n * another layer. The layer's `ready` resolves once the map has drawn it\n */\n add<P = Record<string, unknown>>(spec: LayerSpec<P>): Layer {\n return addSpec<P>(this, spec);\n }\n\n /** @internal A layer made anew from its description, in the place of `old` in the drawing order (old removed) */\n rebuildLayer<P = Record<string, unknown>>(old: Layer, spec: LayerSpec<P>): Layer {\n const index = this.layers.indexOf(old);\n const above = index >= 0 ? this.layers[index + 1] : undefined;\n const layer = this.add(spec);\n\n if (!('before' in spec && spec.before) && index >= 0) this.moveLayer(layer, above);\n old.remove();\n\n return layer;\n }\n\n /** @internal Resolves once the map is idle (everything in view loaded and drawn) */\n whenIdle(): Promise<void> {\n if (this.gone) return Promise.resolve();\n\n return new Promise((resolve) => {\n const off = this.on('idle', () => {\n off();\n resolve();\n });\n\n this.requestRender();\n });\n }\n\n /** Lines from GeoJSON (line strings, and polygon outlines), styled per feature */\n addLines<P = Record<string, unknown>>(options: LineOptions<P>): LineLayer<P> {\n return this.place(new LineLayer<P>(this, options.data, lineStyle(options)), options.before);\n }\n\n /** Discs from GeoJSON points, styled per feature */\n addCircles<P = Record<string, unknown>>(options: CircleOptions<P>): CircleLayer<P> {\n return this.place(new CircleLayer<P>(this, options.data, circleStyle(options)), options.before);\n }\n\n /** Filled polygons from GeoJSON (holes included), styled per feature; over the relief they lie on the ground */\n addFills<P = Record<string, unknown>>(options: FillOptions<P>): FillLayer<P> {\n return this.place(new FillLayer<P>(this, options.data, fillStyle(options)), options.before);\n }\n\n /** The application's fragment shader over the ground (see `GroundOptions`); under `before` if given */\n addGround(options: GroundOptions & { before?: Layer }): GroundLayer {\n return this.place(new GroundLayer(this, options), options.before);\n }\n\n /** Polygons raised into blocks with depth (buildings), styled per feature; tiles of them come with `setTile` */\n addExtrusions<P = Record<string, unknown>>(options: ExtrusionOptions<P> = {}): ExtrusionLayer<P> {\n return this.place(new ExtrusionLayer<P>(this, options.data, extrusionStyle(options)), options.before);\n }\n\n /** Text labels from GeoJSON (points, the middle of lines, the center of polygons), placed without overlaps */\n addSymbols<P = Record<string, unknown>>(options: SymbolOptions<P>): SymbolLayer<P> {\n return this.place(new SymbolLayer<P>(this, options.data, symbolStyle(options)), options.before);\n }\n\n /** @internal The glyphs of the symbol layers, loaded on first use */\n get glyphs(): Glyphs {\n return this.atlases.glyphs;\n }\n\n /** @internal The icons of the symbol layers: the application's images and the vector basemaps' sprites */\n get icons(): Icons {\n return this.atlases.icons;\n }\n\n /**\n * An image for the symbol layers' icons (`icon: name`), as MapLibre's `addImage`: its pixels (an image, a canvas,\n * `ImageData`, or RGBA bytes with their size), `pixelRatio` 2 for an image drawn at twice its CSS size; `sdf` for a\n * signed distance field drawn in the `iconColor`; `stretchX`, `stretchY` and `content` for an icon stretched around its\n * text. An image of the same name is replaced\n */\n addImage(\n name: string,\n image: Pixels | (CanvasImageSource & { width: number; height: number }),\n options: ImageOptions = {},\n ): void {\n this.atlases.addImage(name, image, options);\n }\n\n hasImage(name: string): boolean {\n return this.atlases.hasImage(name);\n }\n\n removeImage(name: string): void {\n this.atlases.removeImage(name);\n }\n\n /**\n * Vector tiles with a MapLibre style (OpenFreeMap's Positron by default): `tiles.raster(…)` draws its fills and lines\n * (or a subset) as a raster layer, `tiles.labels(…)` its labels. `setBasemap('osm-positron')` does both for the\n * basemap.\n */\n vectorTiles(options: VectorTilesOptions = {}): VectorTiles {\n const tiles = new VectorTiles(this, {\n ...(this.workers.url ? { workerUrl: this.workers.url } : {}),\n ...options,\n });\n\n // Its workers stop with the map\n this.vectorSets.add(tiles);\n\n return tiles;\n }\n\n /** @internal Forgets a destroyed `VectorTiles` */\n dropVectorTiles(tiles: VectorTiles): void {\n this.vectorSets.delete(tiles);\n }\n\n /**\n * @internal The workers for a `VectorTiles`: the map's shared pool, or a pool of its own (`own`, to stop with it)\n * when it asks for another count or URL\n */\n basemapWorkers(count?: number, url?: string | URL): { pool: BasemapWorkers; own: boolean } {\n return this.workers.pool(count, url);\n }\n\n /** Adds a layer, under `before` if given */\n private place<L extends Layer>(layer: L, before: Layer | undefined): L {\n this.addLayer(layer);\n if (before) this.moveLayer(layer, before);\n\n return layer;\n }\n\n /** Textured meshes in 3D Tiles (photogrammetry, buildings), drawn with depth over the basemap */\n addTiles3d(options: Tiles3dOptions): Tiles3dLayer {\n const { url, maxScreenSpaceError = 16, opacity = 1, pointSize, color, geoid = false } = options;\n\n return this.addLayer(\n new Tiles3dLayer(this, url, geoid, {\n maxScreenSpaceError,\n opacity,\n ...(pointSize !== undefined ? { pointSize } : {}),\n ...(color !== undefined ? { color } : {}),\n }),\n );\n }\n\n /**\n * A point cloud (see `PointCloudOptions`): a COPC file read by range requests (IGN's LiDAR HD…), or 3D Tiles\n * points; with depth, on the engine with 3D Tiles; under `before` if given\n */\n addPointCloud(options: PointCloudOptions & { before?: Layer }): PointCloudLayer {\n return this.place(new PointCloudLayer(this, options), options.before);\n }\n\n /** A glTF model drawn at positions (see `ModelOptions`), with depth; on the engine with 3D Tiles, as they are */\n addModels(options: ModelOptions & { before?: Layer }): ModelLayer {\n return this.place(new ModelLayer(this, options), options.before);\n }\n\n /**\n * The page's own WebGL drawing at its place among the layers, in every frame (see `CustomLayerInterface`): raw\n * WebGL, three.js… with the matrices of the frame (`frame.matrixAt`); under `before` if given\n */\n addCustomLayer(layer: CustomLayerInterface, options: { before?: Layer } = {}): CustomLayer {\n const custom = new CustomLayer(\n this,\n layer,\n this.canvas,\n this,\n (lon, lat, altitude) => this.engines.customMatrix(lon, lat, altitude),\n () => this.getCamera(),\n );\n\n return this.place(custom, options.before);\n }\n\n // ── Frames ──\n\n /** Asks for a frame; several calls before the next frame draw it once */\n requestRender(): void {\n this.frames.request();\n }\n\n /** @internal Runs `step` every frame until it returns false; replaces the running animation */\n animate(step: Step | undefined): void {\n this.frames.animate(step);\n }\n\n /** @internal The pointer moved over the map (undefined: it left). Without 'hover' and 'hoverfeature' listeners,\n * nothing is drawn: a still map stays idle under a moving mouse */\n hover(point: Point | undefined): void {\n if (!point) {\n this.frames.hover(undefined);\n this.hoverPick.cancel();\n\n return;\n }\n if (!this.listeners.has('hover') && !this.listeners.has('hoverfeature')) return;\n this.frames.hover(point);\n this.requestRender();\n }\n\n private resize(): void {\n if (this.lost) return;\n\n const { clientWidth: width, clientHeight: height } = this.canvas;\n const ratio = window.devicePixelRatio || 1;\n\n this.canvas.width = Math.round(width * ratio);\n this.canvas.height = Math.round(height * ratio);\n this.engine.resize(width, height, ratio);\n this.overlays.size = [width, height];\n this.emit('resize', { width, height });\n // Draw at once: a resized canvas is cleared, waiting one frame would flash\n this.frames.drawNow();\n }\n\n destroy(): void {\n if (this.gone) return;\n this.gone = true;\n // A context restored later rebuilds nothing\n this.unwatchContext();\n\n const camera = this.getCamera();\n\n this.frames.stop();\n this.hoverPick.cancel();\n this.basemaps.destroy();\n [...this.vectorSets].forEach((tiles) => {\n tiles.destroy();\n });\n this.vectorSets.clear();\n this.workers.terminate();\n this.unwatchRatio();\n this.unwatchHeaders();\n this.resizeObserver.disconnect();\n this.interaction?.destroy();\n this.engines.destroy();\n // Custom layers free their WebGL objects, models their data, while the context is there\n this.stack.dispose();\n this.engine.free();\n // Work still under way (labels being shaped, tiles arriving, timers) may call the engine after this: it finds one\n // that does nothing, and nothing is drawn again\n this.#engine = destroyedEngine(camera);\n // Glyph ranges still arriving upload to it, not to the freed engine\n this.atlases.attach(this.#engine);\n this.lost = true;\n this.overlays.destroy();\n this.listeners.clear();\n }\n}\n"]}
|
package/dist/projections.d.ts
CHANGED
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
* map.addRaster({ url, grid: await wmtsGrid(capabilitiesUrl, 'PLANIGNV2.L93', '2154_10cm_6_20') });
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export {
|
|
11
|
+
export type { TileGrid, TileMatrix } from './basemap/grid.ts';
|
|
12
|
+
export { parseWmtsGrid, wmtsGrid } from './basemap/wmts.ts';
|
|
13
|
+
export { type Crs, type CrsLike, getCrs, lambertConformalConic, registerCrs, reproject, transverseMercator, } from './data/crs.ts';
|
package/dist/projections.js
CHANGED
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
* map.addRaster({ url, grid: await wmtsGrid(capabilitiesUrl, 'PLANIGNV2.L93', '2154_10cm_6_20') });
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
11
|
+
export { parseWmtsGrid, wmtsGrid } from "./basemap/wmts.js";
|
|
12
|
+
export { getCrs, lambertConformalConic, registerCrs, reproject, transverseMercator, } from "./data/crs.js";
|
|
13
13
|
//# sourceMappingURL=projections.js.map
|
package/dist/projections.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projections.js","sourceRoot":"","sources":["../src/projections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"projections.js","sourceRoot":"","sources":["../src/projections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAGL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,kBAAkB,GACnB,MAAM,eAAe,CAAC","sourcesContent":["/**\n * `isard/projections`: coordinate reference systems (Lambert-93, the CC zones, UTM, or any proj4 converter), GeoJSON\n * reprojected into longitudes and latitudes, and the tile grids of rasters served in another projection.\n *\n * ```ts\n * import { reproject, wmtsGrid } from 'isard/projections';\n * map.addFills({ data: reproject(parcels, 'EPSG:2154') });\n * map.addRaster({ url, grid: await wmtsGrid(capabilitiesUrl, 'PLANIGNV2.L93', '2154_10cm_6_20') });\n * ```\n */\n\nexport type { TileGrid, TileMatrix } from './basemap/grid.ts';\nexport { parseWmtsGrid, wmtsGrid } from './basemap/wmts.ts';\nexport {\n type Crs,\n type CrsLike,\n getCrs,\n lambertConformalConic,\n registerCrs,\n reproject,\n transverseMercator,\n} from './data/crs.ts';\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** `<Control>`: a control in a corner of the map */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { Control as ControlHandle, ControlPosition } from '../ui/controls.ts';
|
|
4
|
+
export interface ControlProps {
|
|
5
|
+
/** `new NavigationControl()`, `new AttributionControl()` or yours: keep it in a memo (another one replaces it) */
|
|
6
|
+
control: ControlHandle;
|
|
7
|
+
/** Default 'top-right' */
|
|
8
|
+
position?: ControlPosition;
|
|
9
|
+
}
|
|
10
|
+
/** A control in a corner of the map */
|
|
11
|
+
export declare const Control: ({ control, position }: ControlProps) => ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** `<Control>`: a control in a corner of the map */
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { useMap } from "./context.js";
|
|
4
|
+
/** A control in a corner of the map */
|
|
5
|
+
export const Control = ({ control, position = 'top-right' }) => {
|
|
6
|
+
const map = useMap();
|
|
7
|
+
// Added to its corner once the map is there; removed when unmounted, or replaced when the control or its corner change
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!map)
|
|
10
|
+
return;
|
|
11
|
+
map.addControl(control, position);
|
|
12
|
+
return () => {
|
|
13
|
+
map.removeControl(control);
|
|
14
|
+
};
|
|
15
|
+
}, [map, control, position]);
|
|
16
|
+
return null;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=Control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Control.js","sourceRoot":"","sources":["../../src/react/Control.tsx"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,OAAO,EAAkB,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAStC,uCAAuC;AACvC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,GAAG,WAAW,EAAgB,EAAa,EAAE;IACtF,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,uHAAuH;IACvH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG;YAAE,OAAO;QACjB,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAElC,OAAO,GAAG,EAAE;YACV,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE7B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["/** `<Control>`: a control in a corner of the map */\n\nimport { type ReactNode, useEffect } from 'react';\nimport type { Control as ControlHandle, ControlPosition } from '../ui/controls.ts';\nimport { useMap } from './context.ts';\n\nexport interface ControlProps {\n /** `new NavigationControl()`, `new AttributionControl()` or yours: keep it in a memo (another one replaces it) */\n control: ControlHandle;\n /** Default 'top-right' */\n position?: ControlPosition;\n}\n\n/** A control in a corner of the map */\nexport const Control = ({ control, position = 'top-right' }: ControlProps): ReactNode => {\n const map = useMap();\n\n // Added to its corner once the map is there; removed when unmounted, or replaced when the control or its corner change\n useEffect(() => {\n if (!map) return;\n map.addControl(control, position);\n\n return () => {\n map.removeControl(control);\n };\n }, [map, control, position]);\n\n return null;\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** `<CustomLayer>`: your WebGL code or a three.js scene among the layers of the components */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { CustomLayerInterface } from '../layers/layers.ts';
|
|
4
|
+
export interface CustomLayerProps {
|
|
5
|
+
/** Your WebGL code: `onAdd`, `render`, `onRemove` (see `map.addCustomLayer`); another object makes it anew */
|
|
6
|
+
layer: CustomLayerInterface;
|
|
7
|
+
/** Its place among the layers of the components (as `<Layer order>`) */
|
|
8
|
+
order?: number;
|
|
9
|
+
}
|
|
10
|
+
/** Your WebGL code or a three.js scene drawn in the map's frame and depth, among the layers of the components */
|
|
11
|
+
export declare const CustomLayer: ({ layer, order }: CustomLayerProps) => ReactNode;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** `<CustomLayer>`: your WebGL code or a three.js scene among the layers of the components */
|
|
2
|
+
import { useContext, useEffect, useRef } from 'react';
|
|
3
|
+
import { MapContext } from "./context.js";
|
|
4
|
+
/** Your WebGL code or a three.js scene drawn in the map's frame and depth, among the layers of the components */
|
|
5
|
+
export const CustomLayer = ({ layer, order = 0 }) => {
|
|
6
|
+
const binding = useContext(MapContext);
|
|
7
|
+
const initialOrder = useRef(order);
|
|
8
|
+
const handle = useRef(undefined);
|
|
9
|
+
// Added once the map is there, in the declared order; removed when unmounted, made anew when the layer object changes
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (!binding)
|
|
12
|
+
return;
|
|
13
|
+
const custom = binding.map.addCustomLayer(layer);
|
|
14
|
+
handle.current = custom;
|
|
15
|
+
binding.order.place(custom, initialOrder.current);
|
|
16
|
+
return () => {
|
|
17
|
+
handle.current = undefined;
|
|
18
|
+
binding.order.remove(custom);
|
|
19
|
+
if (binding.map.hasLayer(custom))
|
|
20
|
+
custom.remove();
|
|
21
|
+
};
|
|
22
|
+
}, [binding, layer]);
|
|
23
|
+
// A new `order`: moved to its new place among the layers of the components
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (binding && handle.current)
|
|
26
|
+
binding.order.place(handle.current, order, handle.current);
|
|
27
|
+
}, [binding, order]);
|
|
28
|
+
return null;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=CustomLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomLayer.js","sourceRoot":"","sources":["../../src/react/CustomLayer.tsx"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F,OAAO,EAAkB,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,iHAAiH;AACjH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAoB,EAAa,EAAE;IAC/E,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,CAAc,SAAS,CAAC,CAAC;IAE9C,sHAAsH;IACtH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAEjD,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QAElD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QACpD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAErB,2EAA2E;IAC3E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,IAAI,MAAM,CAAC,OAAO;YAAE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5F,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAErB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["/** `<CustomLayer>`: your WebGL code or a three.js scene among the layers of the components */\n\nimport { type ReactNode, useContext, useEffect, useRef } from 'react';\nimport type { CustomLayerInterface, Layer as LayerHandle } from '../layers/layers.ts';\nimport { MapContext } from './context.ts';\n\nexport interface CustomLayerProps {\n /** Your WebGL code: `onAdd`, `render`, `onRemove` (see `map.addCustomLayer`); another object makes it anew */\n layer: CustomLayerInterface;\n /** Its place among the layers of the components (as `<Layer order>`) */\n order?: number;\n}\n\n/** Your WebGL code or a three.js scene drawn in the map's frame and depth, among the layers of the components */\nexport const CustomLayer = ({ layer, order = 0 }: CustomLayerProps): ReactNode => {\n const binding = useContext(MapContext);\n const initialOrder = useRef(order);\n const handle = useRef<LayerHandle>(undefined);\n\n // Added once the map is there, in the declared order; removed when unmounted, made anew when the layer object changes\n useEffect(() => {\n if (!binding) return;\n\n const custom = binding.map.addCustomLayer(layer);\n\n handle.current = custom;\n binding.order.place(custom, initialOrder.current);\n\n return () => {\n handle.current = undefined;\n binding.order.remove(custom);\n if (binding.map.hasLayer(custom)) custom.remove();\n };\n }, [binding, layer]);\n\n // A new `order`: moved to its new place among the layers of the components\n useEffect(() => {\n if (binding && handle.current) binding.order.place(handle.current, order, handle.current);\n }, [binding, order]);\n\n return null;\n};\n"]}
|