isard 2.4.2 → 2.5.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/dist/map.js.map CHANGED
@@ -1 +1 @@
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,EAAuB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,WAAW,EAA2B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAuB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EACL,eAAe,EAGf,SAAS,EACT,OAAO,EACP,UAAU,EACV,YAAY,EACZ,OAAO,GACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAA6B,MAAM,oBAAoB,CAAC;AAC5E,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,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAoB,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAsB,MAAM,oBAAoB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAqB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAwC,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,eAAe,EAA0B,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OA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AAE,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,qFAAqF;QACrF,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 { type PmtilesOptions, pmtilesLayer } from './basemap/pmtileslayer.ts';\nimport { VectorTiles, type VectorTilesOptions } from './basemap/vectortiles.ts';\nimport { type BasemapWorkers, defaultWorkerUrl } from './basemap/workerpool.ts';\nimport {\n destroyedEngine,\n type EngineClass,\n type EngineKind,\n engineUrl,\n gridUrl,\n loadEngine,\n rendererKind,\n tessUrl,\n} from './engine-loader.ts';\nimport { IGN_PRESETS } from './geoplateforme.ts';\nimport type { Grid } from './grids.ts';\nimport { CustomLayer, type CustomLayerInterface } from './layers/custom.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 { FlowLayer, type FlowOptions } from './layers/flow.ts';\nimport type { Glyphs } from './layers/glyphs.ts';\nimport { GroundLayer, type GroundOptions } from './layers/ground.ts';\nimport type { Icons, ImageOptions, Pixels } from './layers/icons.ts';\nimport type { Layer } from './layers/layers.ts';\nimport { ModelLayer, type ModelOptions } from './layers/models.ts';\nimport { NetworkLayer } from './layers/network.ts';\nimport { loadPanoramas, type PanoramaOptions, type Panoramas } from './layers/panoramas.ts';\nimport { addPhoto, type PhotoOptions } from './layers/photos.ts';\nimport { PointCloudLayer, type PointCloudOptions } from './layers/pointclouds.ts';\nimport { RasterLayer } from './layers/raster.ts';\nimport { SymbolLayer, type SymbolOptions, symbolStyle } from './layers/symbols.ts';\nimport { Tiles3dLayer } from './layers/tiles3d.ts';\nimport { addTrees, type TreeOptions } from './layers/trees.ts';\nimport { VectorLayer } from './layers/vectors.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 { applyClipVolume, ClipVolumeHandles } from './map/clip-volume.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, pickOnce } 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 { QUALITY, type QualitySettings, QualityWatch, startLevel } from './map/quality.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 ClipVolume,\n FeatureHit,\n FirstPersonView,\n FlyToOptions,\n GeoMapOptions,\n LoadingMode,\n LonLat,\n MapEvents,\n MapGpuTimings,\n MapMemory,\n NetworkOptions,\n PickOptions,\n Point,\n Projection,\n Quality,\n RasterOptions,\n SunOptions,\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 { RAD } from './util/geo.ts';\nimport { clamp } from './util/math.ts';\nimport { onHeaderRules } from './util/requests.ts';\nimport { sunPosition } from './util/sun.ts';\nimport type { Camera, Engine, PickHit, RasterLayerStats } from './wasm/isard_webgpu.js';\n\nexport type { LayerSpec } from './map/layer-spec.ts';\n\n/** Where a map of the Earth opens without a camera given: Saint-Mandé, the IGN's home, its streets in view; of another\n * body, all of it */\nconst EARTH_START: Camera = { center: [2.4246, 48.8457], zoom: 13, pitch: 0, bearing: 0 };\nconst BODY_START: Camera = { center: [0, 0], zoom: 2, pitch: 0, bearing: 0 };\n\n/** The eye's pitch at street level (degrees from straight down): off the vertical, where its heading means nothing */\nconst FIRST_PERSON_PITCH: [min: number, max: number] = [1, 179];\n\n/** The eye's field of view at street level (degrees): from a telephoto to a wide angle, the projection still sane */\nconst FIRST_PERSON_FOV: [min: number, max: number] = [10, 140];\n\n/** The least GPU memory budget a lost device leaves the map (bytes, `lighten`) */\nconst MIN_MEMORY = 64 * 2 ** 20;\n\n/** A network's defaults: the values past which it is unreached (half an hour of travel, in seconds), its halo's\n * opacity at the middle of a line (a glow, not a second line) */\nconst NETWORK_MAX = 1800;\nconst NETWORK_HALO_OPACITY = 0.11;\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 */\n/** The parts of a frame by their code in the engine's GPU timings (`Engine.gpuTimings`) */\nconst GPU_PARTS = ['backdrop', 'ground', 'layer', 'shadows', 'panorama', 'viewshed'] as const;\n\n/** Turns the GPU timing of an engine on or off: whether it times, false for an engine built without it (only a build to\n * profile has `setGpuTiming`) */\nconst engineGpuTiming = (engine: Engine, on: boolean): boolean => {\n const set: unknown = Reflect.get(engine, 'setGpuTiming');\n\n return typeof set === 'function' && Reflect.apply(set, engine, [on]) === true;\n};\n\nexport class GeoMap {\n readonly canvas: HTMLCanvasElement;\n #engine: Engine;\n /** The frames' parts timed on the GPU (`setGpuTiming`), again on a new engine */\n private gpuTiming = false;\n /** The work the map waits on before it is idle (`track`) */\n #working = 0;\n /** The engine, made asynchronously, and the workers decoding its 3D Tiles */\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 /** @internal Where the basemap workers load the tessellation module from (`isard_tess_bg.wasm`) */\n readonly tessUrl: string;\n /** @internal Where the workers load the grid module from (`isard_grid_bg.wasm`) */\n readonly gridUrl: string;\n /** The GPU is lost (the WebGL context, the WebGPU device): nothing is drawn until a new engine is there */\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 // Before anything is created\n if (options.basemap !== undefined) checkBasemap(options.basemap);\n\n // The engine on wgpu (#146): WebGPU, else wgpu's WebGL2 fallback\n const kind = await rendererKind(options.renderer);\n const bindings = await loadEngine(kind, engineUrl(kind, options));\n const map = new GeoMap(container, options, bindings.Engine, kind);\n\n // Its device asked for: the map started on a placeholder meanwhile, its layers created on the engine once it is\n // there (as after a context loss)\n map.adopt(await map.engines.create(map.canvas, () => map.requestRender(), map.settings));\n\n // A profiling script's page (`window.__isardProfile` set before isard loads): its maps, to time\n if (Reflect.get(globalThis, '__isardProfile')) {\n const maps: unknown = Reflect.get(globalThis, '__isardMaps');\n\n Reflect.set(globalThis, '__isardMaps', [...(Array.isArray(maps) ? maps : []), map]);\n }\n\n return map;\n }\n\n private constructor(container: HTMLElement, options: GeoMapOptions, engineClass: EngineClass, renderer: EngineKind) {\n this.engines = new MapEngines(engineClass, renderer, options);\n\n const workerUrl = options.basemapWorkerUrl ?? defaultWorkerUrl(options.assetsUrl);\n\n this.tessUrl = tessUrl(options);\n this.gridUrl = gridUrl(options);\n\n this.workers = new MapWorkers(\n workerUrl,\n options.workers,\n () => this.gone,\n this,\n () => this.quality.workers,\n );\n this.basemaps = new BasemapLayers(this, this.stack, workerUrl, options.basemapTileSize);\n this.container = container;\n this.canvas = createCanvas();\n // The engine takes the canvas for itself: it says how large a texture its device takes\n this.atlases = new SymbolAtlases(\n () => this.#engine.maxTextureSize(),\n options.glyphs,\n () => this.#engine,\n );\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 working: () => this.#working > 0,\n drawn: (hovered) => {\n this.qualityWatch?.frame(performance.now(), this.movingNow);\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 // The engine is made asynchronously (`GeoMap.create` adopts it): a placeholder meanwhile\n this.#engine = destroyedEngine(EARTH_START);\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. A\n // WebGPU device lost is watched with each engine (`adopt`)\n this.unwatchContext = watchContext(\n this.canvas,\n () => this.gpuLost(),\n () => this.restore(),\n );\n\n const start = this.earth ? EARTH_START : BODY_START;\n\n this.setCamera({ ...start, ...options });\n this.setBasemap(options.basemap ?? (this.earth ? 'osm-positron' : 'none'), options.hillshade ?? 0);\n if (options.sun) this.setSun(options.sun);\n this.resizeObserver = new ResizeObserver(() => this.resize());\n this.resizeObserver.observe(container);\n this.#quality = startLevel(options.quality);\n if (options.quality === 'auto') {\n this.qualityWatch = new QualityWatch('high', (level) => this.applyQuality(level));\n // The frames measured are those of a move\n this.on('movestart', () => {\n this.movingNow = true;\n });\n this.on('moveend', () => {\n this.movingNow = false;\n });\n }\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 /** WebGPU devices lost so far: each one makes the next engine lighter (`lighten`) */\n #losses = 0;\n\n /** What the map draws through: `'webgpu'`, or `'webgl2'` (the fallback of a browser without WebGPU, or of a device\n * WebGPU kept losing) */\n get renderer(): 'webgpu' | 'webgl2' {\n return this.engines.renderer;\n }\n\n /** The GPU is lost: nothing drawn, the engine dropped (`dropLostEngine`) */\n private gpuLost(): void {\n this.lost = true;\n this.frames.cancel();\n this.dropLostEngine();\n }\n\n /**\n * Follows the loss of `engine`'s WebGPU device (a phone taking its memory back, a driver reset, the GPU process\n * gone): while it is the map's, the map drops it and makes a new one at once, WebGPU having no event for the GPU\n * given back, lighter so as not to lose it again (`lighten`). The device of an engine the map freed itself\n * (replaced, the map destroyed) is lost too: not the map's any more, left be\n */\n private watchDevice(engine: Engine): void {\n void engine\n .gpuDevice()\n ?.lost.then(async (info) => {\n if (this.gone || this.#engine !== engine) return;\n this.gpuLost();\n\n const recovery = await this.lighten();\n\n console.warn(\n `isard: the GPU device was lost (${info.reason}: ${info.message}), the map made again (${recovery})`,\n );\n this.emit('gpulost', { reason: info.reason, message: info.message, losses: this.#losses, recovery });\n this.restore();\n })\n // The fallback's module not loaded: told, as a failed restore is\n .catch(report);\n }\n\n /**\n * After a device lost, the next engine lighter, the same scene then holding less: at the first loss the low quality\n * (one pixel a CSS pixel, no sun's shadows, one worker, fewer tiles far away) and half the GPU memory budget; at the\n * next one, the WebGL2 fallback (a phone whose WebGPU keeps losing its device: Safari's GPU process taking its\n * memory back) and half the budget again. What it did: `'lighter'` or `'webgl2'`\n */\n private async lighten(): Promise<'lighter' | 'webgl2'> {\n this.#losses += 1;\n this.settings.memory = Math.max(MIN_MEMORY, this.settings.memory / 2);\n if (this.#losses === 1 || this.engines.renderer === 'webgl2') {\n this.qualityWatch = undefined;\n this.applyQuality('low');\n\n return 'lighter';\n }\n await this.engines.fallBack();\n\n return 'webgl2';\n }\n\n /**\n * The context is lost: its engine freed at once, the map's calls going to one that does nothing until `restore`\n * builds the next. The old engine's GPU objects went with the context: deleted now, it is silent (on the context\n * restored, each one warns); its 3D Tiles downloads stop. Its layers' updates meanwhile (a tile uploaded, labels)\n * would fail on the lost context, whose limits read 0\n */\n private dropLostEngine(): void {\n this.hoverPick.cancel();\n\n const camera = this.getCamera();\n\n this.#engine.free();\n this.#engine = destroyedEngine(camera);\n // Glyph ranges and icons arriving meanwhile upload to it, not to the freed engine\n this.atlases.attach(this.#engine);\n }\n\n /** After the GPU lost: a new engine with the same camera, settings and layers (same handles, same order); the engine\n * made asynchronously, adopted once there */\n private restore(): void {\n if (this.gone) return;\n\n const make = () => this.engines.create(this.canvas, () => this.requestRender(), this.settings);\n\n make()\n .catch(async (error: unknown) => {\n // WebGPU giving no new device after a loss (an adapter refused): the WebGL2 fallback\n if (this.engines.renderer === 'webgl2') throw error;\n console.warn(`isard: no new WebGPU device (${String(error)}), the map made again through WebGL2`);\n await this.engines.fallBack();\n this.emit('gpulost', { reason: 'unknown', message: String(error), losses: this.#losses, recovery: 'webgl2' });\n\n return make();\n })\n .then((engine) => this.adopt(engine))\n .catch(report);\n }\n\n /** A new engine in place of the map's (a placeholder, or a lost one): the same camera, settings and layers (same\n * handles, same order) */\n private adopt(engine: Engine): void {\n if (this.gone) {\n engine.free();\n\n return;\n }\n this.hoverPick.cancel();\n\n const camera = this.getCamera();\n\n this.#engine.free();\n this.#engine = engine;\n this.lost = false;\n this.watchDevice(engine);\n // Still timed (profiling)\n if (this.gpuTiming) engineGpuTiming(engine, true);\n this.setCamera(camera);\n this.atlases.attach(this.#engine);\n this.stack.reattach(this.#engine);\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 sun's shadows, the panoramas shown\n if (this.viewshed) this.setViewshed(this.viewshed);\n applyClipVolume(this.engine, this.clipVolume, this.settings.body.radius);\n if (this.sun) this.setSun(this.sun);\n this.panoramaSets.forEach((set) => {\n if (set.current) void set.show(set.current.index).catch(report);\n });\n this.resize();\n this.requestRender();\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 = clamp(eye.pitch, ...FIRST_PERSON_PITCH);\n eye.fov = clamp(eye.fov, ...FIRST_PERSON_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; `other`: layers shown on the other side only (two meshes of a place, each on its side). Set again as\n * the line moves (a slider, a drag); undefined stops\n */\n setSwipe(options: SwipeOptions | undefined): void {\n const used = options && (options.layers.length > 0 || (options.other?.length ?? 0) > 0);\n\n this.swipe = used ? { ...options, layers: [...options.layers], other: [...(options.other ?? [])] } : undefined;\n this.applySwipe();\n this.requestRender();\n }\n\n private applySwipe(): void {\n const s = this.swipe;\n const idsOf = (layers: readonly Layer[] | undefined) =>\n Uint32Array.from(\n (layers ?? []).filter((l) => l.id >= 0),\n (l) => l.id,\n );\n const ids = idsOf(s?.layers);\n const others = idsOf(s?.other);\n const shown = ids.length > 0 || others.length > 0;\n\n this.engine.setSwipe(s && shown ? s.position : Number.NaN, s?.side === 'right', ids, others);\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 try {\n layer.attach(this.engine);\n } catch (error) {\n // A context lost before the browser says so (its event comes later): nothing could be made on it, the layer is\n // made with the others on the next engine (`restore`). Any other failure is the caller's\n if (!this.contextLost()) throw error;\n }\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 /** Whether the canvas's WebGL context is lost, its event come or not */\n private contextLost(): boolean {\n // On a WebGPU canvas, no WebGL context: null, nothing taken\n return this.lost || this.canvas.getContext('webgl2')?.isContextLost() === true;\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 #quality: Quality = 'high';\n /** 'auto': the frames watched, the map stepped down while they stay slow */\n private qualityWatch: QualityWatch | undefined;\n private movingNow = false;\n\n /** The map's quality: `'high'`, `'medium'` or `'low'` (as `GeoMapOptions.quality` says; `'auto'` the level it\n * stepped down to) */\n getQuality(): Quality {\n return this.#quality;\n }\n\n /** @internal What its quality draws */\n get quality(): QualitySettings {\n return QUALITY[this.#quality];\n }\n\n /** Sets the map's quality (`GeoMapOptions.quality`); `'auto'` starts again from `'high'` */\n setQuality(quality: Quality | 'auto'): void {\n this.qualityWatch = quality === 'auto' ? new QualityWatch('high', (level) => this.applyQuality(level)) : undefined;\n this.applyQuality(quality === 'auto' ? 'high' : quality);\n }\n\n private applyQuality(quality: Quality): void {\n if (quality === this.#quality) return;\n this.#quality = quality;\n // The canvas at its pixel ratio, the sun's shadows, the layers' detail\n this.resize();\n if (this.sun) this.setSun(this.sun);\n this.layers.forEach((layer) => {\n layer.qualityChanged();\n });\n this.emit('quality', { quality });\n this.requestRender();\n }\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 /** The sun set, set again in a new engine */\n private sun: SunOptions | undefined;\n\n /**\n * The sun casting shadows: the buildings, trees, models, 3D Tiles and the relief shade the ground and one another,\n * the walls turned away from it are in their own shade; the labels stay over them. The sun stands where it is at\n * `date` over the map's center (now by default), or at `azimuth` and `altitude`. As it sets the night falls (`night`\n * to set it by hand): the scene tinted in its blue, the windows of the buildings and the streets of `vectors()` lit,\n * the labels light on dark.\n * The shadows cover the ground around the view's center, fading out away from it, and cost two more depth passes\n * of the solid scene each frame. Undefined removes them\n */\n setSun(options: SunOptions | undefined): void {\n this.sun = options;\n if (!options) {\n this.engine.setSun(Number.NaN, Number.NaN, 0, 0);\n this.requestRender();\n\n return;\n }\n\n const { azimuth, altitude } =\n options.azimuth !== undefined && options.altitude !== undefined\n ? { azimuth: options.azimuth, altitude: options.altitude }\n : sunPosition(options.date ?? new Date(), this.getCamera().center);\n // The twilight: from 6° above the horizon to 6° under it, smoothly\n const dusk = Math.min(1, Math.max(0, (6 - altitude) / 12));\n const night = Math.min(1, Math.max(0, options.night ?? dusk * dusk * (3 - 2 * dusk)));\n // The shadows fade with the sun's light; none at a low quality (its light and the night stay)\n const opacity = this.quality.shadows ? Math.min(1, Math.max(0, options.opacity ?? 0.35)) * (1 - night) : 0;\n\n this.engine.setSun(azimuth, altitude, opacity, night);\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 setViewshed(options: ViewshedOptions | readonly ViewshedOptions[] | undefined): void {\n this.viewshed = options;\n if (applyViewshed(this.engine, options)) this.requestRender();\n }\n\n private clipVolume: ClipVolume | undefined;\n /** The clipping volume's handles over the map, while it has them */\n private clipHandles: ClipVolumeHandles | undefined;\n\n /** Cuts the 3D layers (models, 3D Tiles, extrusions, point clouds) by a volume, a box, a cylinder or a prism on a\n * polygon: what lies inside it, or outside it (`cut`), the faces the cut opens filled; with `handles`, sized and\n * moved with the pointer (`'clipvolume'` tells each change). Undefined removes it */\n setClipVolume(volume: ClipVolume | undefined): void {\n this.clipVolume = volume;\n applyClipVolume(this.engine, volume, this.settings.body.radius);\n if (volume?.handles) {\n this.clipHandles ??= this.addClipHandles(volume);\n this.clipHandles.set(volume);\n this.overlays.position(this.clipHandles);\n } else if (this.clipHandles) {\n this.overlays.detach(this.clipHandles, this.clipHandles.element);\n this.clipHandles = undefined;\n }\n this.requestRender();\n }\n\n /** The clipping volume set (`setClipVolume`), as its handles left it */\n getClipVolume(): ClipVolume | undefined {\n return this.clipVolume;\n }\n\n private addClipHandles(volume: ClipVolume): ClipVolumeHandles {\n const handles = new ClipVolumeHandles(\n {\n project: (lonLat, height) => this.project(lonLat, height),\n unproject: (point) => this.unproject(point),\n elevationAt: (lonLat) => this.elevationAt(lonLat),\n getCanvas: () => this.canvas,\n moved: (moved) => {\n this.setClipVolume(moved);\n this.emit('clipvolume', moved);\n },\n },\n volume,\n this.settings.body.radius,\n );\n\n this.overlays.attach(handles, handles.element);\n\n return handles;\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 Whether a relief is under the basemap: the fills of vector tiles drawn as geometry need their prisms */\n get hasRelief(): boolean {\n return this.settings.terrain !== undefined;\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 /** The GPU memory its layers hold (bytes): the tiles of the 3D Tiles and point clouds, kept within the budget\n * (`GeoMapOptions.memory`), the rasters' pools */\n memory(): MapMemory {\n // Two numbers a layer, its id and its bytes, the relief's (id 0) last\n const pairs = this.engine.memory();\n const byId = new Map(Array.from({ length: pairs.length / 2 }, (_, i) => [pairs[2 * i], pairs[2 * i + 1] ?? 0]));\n const layers = this.layers.flatMap((layer) => {\n const bytes = layer.id >= 0 ? byId.get(layer.id) : undefined;\n\n return bytes === undefined ? [] : [{ layer, bytes }];\n });\n\n return {\n budget: this.settings.memory,\n held: [...byId.values()].reduce((sum, bytes) => sum + bytes, 0),\n layers,\n };\n }\n\n /** Tile counters of the raster layers, for diagnostics */\n stats(): RasterLayerStats[] {\n return this.engine.stats();\n }\n\n /** Times the parts of each frame on the GPU, for profiling (`gpuTimings`): timer queries, read a few frames later.\n * An engine built to profile only (`PROFILE=1 bun run build`); false without one, or if the browser cannot\n * (`EXT_disjoint_timer_query_webgl2`) */\n setGpuTiming(on: boolean): boolean {\n this.gpuTiming = engineGpuTiming(this.engine, on);\n\n return this.gpuTiming;\n }\n\n /** The GPU time of the last frame measured (`setGpuTiming`), in all and by part: the backdrop, the ground (the raster\n * layers over the relief), each layer, the shadows, the panorama, the viewshed (ms) */\n gpuTimings(): MapGpuTimings | undefined {\n // The frame's number, then each part's code, layer id (-1 for none) and milliseconds\n const read: unknown = Reflect.get(this.engine, 'gpuTimings');\n const flat: unknown = typeof read === 'function' ? Reflect.apply(read, this.engine, []) : undefined;\n\n if (!(flat instanceof Float64Array) || flat.length === 0) return undefined;\n\n const parts = Array.from({ length: (flat.length - 1) / 3 }, (_, k) => {\n const [code = 0, id = -1, ms = 0] = flat.subarray(1 + k * 3, 4 + k * 3);\n const layer = id >= 0 ? this.layers.find((l) => l.id === id) : undefined;\n\n return { part: GPU_PARTS[code] ?? 'layer', ms, ...(layer && { layer }) };\n });\n\n return { frame: flat[0] ?? 0, ms: parts.reduce((sum, p) => sum + p.ms, 0), parts };\n }\n\n /**\n * The feature under a screen point (CSS pixels), undefined if none: its layer id and index. Reads the pixels around\n * the point of an offscreen picking pass, whatever the number of features, once the GPU is done (a frame or two\n * later: the GPU is not waited for). On hover, listen to 'hoverfeature' instead.\n */\n async pick(point: Point, { radius = 0, layers }: PickOptions = {}): Promise<PickHit | undefined> {\n const only = layers && Uint32Array.from(layers.map((l) => l.id));\n\n return (await pickOnce(() => this.engine, point, radius, only))?.hit;\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 async pickFeature(point: Point, options: PickOptions = {}): Promise<FeatureHit | undefined> {\n const hit = await this.pick(point, options);\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 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 panoramas.whenRemoved.push(() => {\n this.panoramaSets.delete(panoramas);\n });\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 [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 /** Whether a drag that turns and tilts the map (right button, Ctrl or Shift) goes around what is under the pointer\n * where it starts, a roof or a mesh as the relief (on by default), or around the screen center */\n setRotateAroundPointer(enabled: boolean): void {\n if (this.interaction) this.interaction.rotateAroundPointer = 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. Read from the last copy of\n * the scene's depth (a frame or two old, a pixel every 4 CSS pixels): at once, without waiting for the GPU */\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, or until measured: the scene is drawn looking down at\n * it after a frame and read back a frame or two later, the answer kept and measured again every 250 ms at most (ask\n * again on the next `render` event) */\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): RasterLayer {\n const { url, opacity = 1, saturation = 1, size, before, ground = true } = options;\n const { loader, minZoom, maxZoom } = rasterSource(options, this.workers.remoteReprojection);\n const layer = new RasterLayer(this, { url, minZoom, maxZoom, opacity, saturation, size, loader, ground });\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(options: PmtilesOptions): Promise<RasterLayer | VectorTiles> {\n return pmtilesLayer(this, 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 = NETWORK_MAX, contour = 0, opacity = 1 } = options;\n const {\n halo = 0,\n haloOpacity = NETWORK_HALO_OPACITY,\n ramp,\n unreachedColor = 'rgba(140, 140, 140, 0.25)',\n fade = 0,\n } = options;\n const style = { width, max, contour, opacity, halo, haloOpacity, ramp, unreachedColor, fade };\n\n validateNetwork(nodes, edges);\n\n return this.place(new NetworkLayer(this, { nodes, edges, lines }, costs, style, edgeWidths), options.before);\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 // The first layer above that goes not with it: its companions are removed with it\n const above = index >= 0 ? this.layers.slice(index + 1).find((l) => !old.companions.includes(l)) : undefined;\n const layer = this.add(spec);\n\n if (!('before' in spec && spec.before) && index >= 0) layer.moveBefore(above);\n old.remove();\n\n return layer;\n }\n\n /**\n * @internal Work the map waits on before it is idle (the vector tiles cut in the workers, uploaded over frames): the\n * engine knows only the tiles it holds, not those coming (an engine made anew holds none until the workers cut them\n * again from their cache, no request on the network meanwhile); a frame once it is done, to tell\n */\n track<T>(work: Promise<T>): Promise<T> {\n this.#working += 1;\n\n const done = () => {\n this.#working -= 1;\n this.requestRender();\n };\n\n work.then(done, done);\n\n return work;\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.frames.requestIdle();\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(\n new LineLayer<P>(this, options.data, lineStyle(options), options.altitudeReference),\n options.before,\n );\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): 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(\n new ExtrusionLayer<P>(this, options.data, extrusionStyle(options), options.drape),\n options.before,\n );\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.vectors(…)` as geometry, `tiles.labels(…)` its labels.\n * `setBasemap('osm-positron')` draws the basemap with a raster layer and the labels.\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 The geometry of a `VectorTiles` (`vectors`), under `before` if given */\n addVectorLayer(before?: Layer): VectorLayer {\n return this.place(new VectorLayer(this), before);\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 {\n url,\n maxScreenSpaceError = 16,\n opacity = 1,\n pointSize,\n color,\n geoid = false,\n facades = false,\n drape,\n } = options;\n\n return this.place(\n new Tiles3dLayer(\n this,\n url,\n geoid,\n {\n maxScreenSpaceError,\n opacity,\n ...(pointSize !== undefined ? { pointSize } : {}),\n ...(color !== undefined ? { color } : {}),\n },\n facades,\n drape,\n ),\n options.before,\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; under `before` if given\n */\n addPointCloud(options: PointCloudOptions): PointCloudLayer {\n return this.place(new PointCloudLayer(this, options), options.before);\n }\n\n /**\n * The grids of a GRIB2 or classic NetCDF file (its URL, or its bytes): a weather or ocean model's fields on grids of\n * longitudes and latitudes, read in a worker by the grid module (loaded with the first file). GRIB2 on a regular\n * latitude/longitude grid, packed simply, in groups or in groups of spatial differences (NOAA's GFS); NetCDF-3 with\n * the CF conventions. `windFields` pairs a wind's components into the fields of `addFlow`\n */\n readGrids(source: string | URL | ArrayBuffer | Uint8Array, options: { signal?: AbortSignal } = {}): Promise<Grid[]> {\n return this.workers.readGrids(source, this.gridUrl, options.signal);\n }\n\n /** Particles carried by a field of velocities (a wind, a current), their trails animated and colored by speed on\n * the globe and the relief (see `FlowOptions`) */\n addFlow(options: FlowOptions): FlowLayer {\n return this.place(new FlowLayer(this, options), options.before);\n }\n\n /** A glTF model drawn at positions (see `ModelOptions`), with depth */\n addModels(options: ModelOptions): ModelLayer {\n return this.place(new ModelLayer(this, options), options.before);\n }\n\n /** Trees at the points of a source that has them (a city's street trees), broadleaved or conifers by their data,\n * scaled to their height (see `TreeOptions`); the conifers on a layer that goes with the one returned */\n addTrees<P = Record<string, unknown>>(options: TreeOptions<P>): ModelLayer {\n return addTrees((o) => this.addModels(o), options);\n }\n\n /** A photo standing where it was taken, facing its way (see `PhotoOptions`): flat on a frame across its field of\n * view, a 360° one on a band round its camera; resolves once its image is read */\n addPhoto(options: PhotoOptions): Promise<ModelLayer> {\n return addPhoto((o) => this.addModels(o), options);\n }\n\n /**\n * The page's own WebGPU drawing at its place among the layers, in every frame (see `CustomLayerInterface`): raw\n * WebGPU, three.js's WebGPU renderer… with the map's device and the matrices of the frame (`frame.matrixAt`); under\n * `before` if given. Not drawn on the WebGL2 fallback\n */\n addCustomLayer(layer: CustomLayerInterface, options: { before?: Layer } = {}): CustomLayer {\n const custom = new CustomLayer(\n this,\n layer,\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 = Math.min(window.devicePixelRatio || 1, this.quality.pixelRatio);\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.remove();\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 GPU objects, models their data, while the device 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"]}
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,EAAuB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,WAAW,EAA2B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAuB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EACL,eAAe,EAGf,SAAS,EACT,OAAO,EACP,UAAU,EACV,YAAY,EACZ,OAAO,GACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAA6B,MAAM,oBAAoB,CAAC;AAC5E,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,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAoB,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAsB,MAAM,oBAAoB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAqB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAwC,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AACjE,OAAO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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 { type PmtilesOptions, pmtilesLayer } from './basemap/pmtileslayer.ts';\nimport { VectorTiles, type VectorTilesOptions } from './basemap/vectortiles.ts';\nimport { type BasemapWorkers, defaultWorkerUrl } from './basemap/workerpool.ts';\nimport {\n destroyedEngine,\n type EngineClass,\n type EngineKind,\n engineUrl,\n gridUrl,\n loadEngine,\n rendererKind,\n tessUrl,\n} from './engine-loader.ts';\nimport { IGN_PRESETS } from './geoplateforme.ts';\nimport type { Grid } from './grids.ts';\nimport { CustomLayer, type CustomLayerInterface } from './layers/custom.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 { FlowLayer, type FlowOptions } from './layers/flow.ts';\nimport type { Glyphs } from './layers/glyphs.ts';\nimport { GroundLayer, type GroundOptions } from './layers/ground.ts';\nimport type { Icons, ImageOptions, Pixels } from './layers/icons.ts';\nimport type { Layer } from './layers/layers.ts';\nimport { ModelLayer, type ModelOptions } from './layers/models.ts';\nimport { NetworkLayer } from './layers/network.ts';\nimport { loadPanoramas, type PanoramaOptions, type Panoramas } from './layers/panoramas.ts';\nimport { addPhoto, type PhotoOptions } from './layers/photos.ts';\nimport { PointCloudLayer, type PointCloudOptions } from './layers/pointclouds.ts';\nimport { RasterLayer } from './layers/raster.ts';\nimport { SymbolLayer, type SymbolOptions, symbolStyle } from './layers/symbols.ts';\nimport { Tiles3dLayer } from './layers/tiles3d.ts';\nimport { addTrees, type TreeOptions } from './layers/trees.ts';\nimport { VectorLayer } from './layers/vectors.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 { applyClipVolume, ClipVolumeHandles } from './map/clip-volume.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, pickOnce } 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 { QUALITY, type QualitySettings, QualityWatch, startLevel } from './map/quality.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 ClipVolume,\n FeatureHit,\n FirstPersonView,\n FitBoundsOptions,\n FitBox,\n FlyToOptions,\n GeoMapOptions,\n LoadingMode,\n LonLat,\n MapEvents,\n MapGpuTimings,\n MapMemory,\n NetworkOptions,\n PickOptions,\n Point,\n Projection,\n Quality,\n RasterOptions,\n SunOptions,\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 { RAD } from './util/geo.ts';\nimport { clamp } from './util/math.ts';\nimport { onHeaderRules } from './util/requests.ts';\nimport { sunPosition } from './util/sun.ts';\nimport type { Camera, Engine, PickHit, RasterLayerStats } from './wasm/isard_webgpu.js';\n\nexport type { LayerSpec } from './map/layer-spec.ts';\n\n/** Where a map of the Earth opens without a camera given: Saint-Mandé, the IGN's home, its streets in view; of another\n * body, all of it */\nconst EARTH_START: Camera = { center: [2.4246, 48.8457], zoom: 13, pitch: 0, bearing: 0 };\nconst BODY_START: Camera = { center: [0, 0], zoom: 2, pitch: 0, bearing: 0 };\n\n/** The eye's pitch at street level (degrees from straight down): off the vertical, where its heading means nothing */\nconst FIRST_PERSON_PITCH: [min: number, max: number] = [1, 179];\n\n/** The eye's field of view at street level (degrees): from a telephoto to a wide angle, the projection still sane */\nconst FIRST_PERSON_FOV: [min: number, max: number] = [10, 140];\n\n/** The least GPU memory budget a lost device leaves the map (bytes, `lighten`) */\nconst MIN_MEMORY = 64 * 2 ** 20;\n\n/** A network's defaults: the values past which it is unreached (half an hour of travel, in seconds), its halo's\n * opacity at the middle of a line (a glow, not a second line) */\nconst NETWORK_MAX = 1800;\nconst NETWORK_HALO_OPACITY = 0.11;\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 */\n/** The parts of a frame by their code in the engine's GPU timings (`Engine.gpuTimings`) */\nconst GPU_PARTS = ['backdrop', 'ground', 'layer', 'shadows', 'panorama', 'viewshed'] as const;\n\n/** Turns the GPU timing of an engine on or off: whether it times, false for an engine built without it (only a build to\n * profile has `setGpuTiming`) */\nconst engineGpuTiming = (engine: Engine, on: boolean): boolean => {\n const set: unknown = Reflect.get(engine, 'setGpuTiming');\n\n return typeof set === 'function' && Reflect.apply(set, engine, [on]) === true;\n};\n\nexport class GeoMap {\n readonly canvas: HTMLCanvasElement;\n #engine: Engine;\n /** The frames' parts timed on the GPU (`setGpuTiming`), again on a new engine */\n private gpuTiming = false;\n /** The work the map waits on before it is idle (`track`) */\n #working = 0;\n /** The engine, made asynchronously, and the workers decoding its 3D Tiles */\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 /** @internal Where the basemap workers load the tessellation module from (`isard_tess_bg.wasm`) */\n readonly tessUrl: string;\n /** @internal Where the workers load the grid module from (`isard_grid_bg.wasm`) */\n readonly gridUrl: string;\n /** The GPU is lost (the WebGL context, the WebGPU device): nothing is drawn until a new engine is there */\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 // Before anything is created\n if (options.basemap !== undefined) checkBasemap(options.basemap);\n\n // The engine on wgpu (#146): WebGPU, else wgpu's WebGL2 fallback\n const kind = await rendererKind(options.renderer);\n const bindings = await loadEngine(kind, engineUrl(kind, options));\n const map = new GeoMap(container, options, bindings.Engine, kind);\n\n // Its device asked for: the map started on a placeholder meanwhile, its layers created on the engine once it is\n // there (as after a context loss)\n map.adopt(await map.engines.create(map.canvas, () => map.requestRender(), map.settings));\n\n // A profiling script's page (`window.__isardProfile` set before isard loads): its maps, to time\n if (Reflect.get(globalThis, '__isardProfile')) {\n const maps: unknown = Reflect.get(globalThis, '__isardMaps');\n\n Reflect.set(globalThis, '__isardMaps', [...(Array.isArray(maps) ? maps : []), map]);\n }\n\n return map;\n }\n\n private constructor(container: HTMLElement, options: GeoMapOptions, engineClass: EngineClass, renderer: EngineKind) {\n this.engines = new MapEngines(engineClass, renderer, options);\n\n const workerUrl = options.basemapWorkerUrl ?? defaultWorkerUrl(options.assetsUrl);\n\n this.tessUrl = tessUrl(options);\n this.gridUrl = gridUrl(options);\n\n this.workers = new MapWorkers(\n workerUrl,\n options.workers,\n () => this.gone,\n this,\n () => this.quality.workers,\n );\n this.basemaps = new BasemapLayers(this, this.stack, workerUrl, options.basemapTileSize);\n this.container = container;\n this.canvas = createCanvas();\n // The engine takes the canvas for itself: it says how large a texture its device takes\n this.atlases = new SymbolAtlases(\n () => this.#engine.maxTextureSize(),\n options.glyphs,\n () => this.#engine,\n );\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 working: () => this.#working > 0,\n drawn: (hovered) => {\n this.qualityWatch?.frame(performance.now(), this.movingNow);\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 // The engine is made asynchronously (`GeoMap.create` adopts it): a placeholder meanwhile\n this.#engine = destroyedEngine(EARTH_START);\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. A\n // WebGPU device lost is watched with each engine (`adopt`)\n this.unwatchContext = watchContext(\n this.canvas,\n () => this.gpuLost(),\n () => this.restore(),\n );\n\n const start = this.earth ? EARTH_START : BODY_START;\n\n this.setCamera({ ...start, ...options });\n this.setBasemap(options.basemap ?? (this.earth ? 'osm-positron' : 'none'), options.hillshade ?? 0);\n if (options.sun) this.setSun(options.sun);\n this.resizeObserver = new ResizeObserver(() => this.resize());\n this.resizeObserver.observe(container);\n this.#quality = startLevel(options.quality);\n if (options.quality === 'auto') {\n this.qualityWatch = new QualityWatch('high', (level) => this.applyQuality(level));\n // The frames measured are those of a move\n this.on('movestart', () => {\n this.movingNow = true;\n });\n this.on('moveend', () => {\n this.movingNow = false;\n });\n }\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 /** WebGPU devices lost so far: each one makes the next engine lighter (`lighten`) */\n #losses = 0;\n\n /** What the map draws through: `'webgpu'`, or `'webgl2'` (the fallback of a browser without WebGPU, or of a device\n * WebGPU kept losing) */\n get renderer(): 'webgpu' | 'webgl2' {\n return this.engines.renderer;\n }\n\n /** The GPU is lost: nothing drawn, the engine dropped (`dropLostEngine`) */\n private gpuLost(): void {\n this.lost = true;\n this.frames.cancel();\n this.dropLostEngine();\n }\n\n /**\n * Follows the loss of `engine`'s WebGPU device (a phone taking its memory back, a driver reset, the GPU process\n * gone): while it is the map's, the map drops it and makes a new one at once, WebGPU having no event for the GPU\n * given back, lighter so as not to lose it again (`lighten`). The device of an engine the map freed itself\n * (replaced, the map destroyed) is lost too: not the map's any more, left be\n */\n private watchDevice(engine: Engine): void {\n void engine\n .gpuDevice()\n ?.lost.then(async (info) => {\n if (this.gone || this.#engine !== engine) return;\n this.gpuLost();\n\n const recovery = await this.lighten();\n\n console.warn(\n `isard: the GPU device was lost (${info.reason}: ${info.message}), the map made again (${recovery})`,\n );\n this.emit('gpulost', { reason: info.reason, message: info.message, losses: this.#losses, recovery });\n this.restore();\n })\n // The fallback's module not loaded: told, as a failed restore is\n .catch(report);\n }\n\n /**\n * After a device lost, the next engine lighter, the same scene then holding less: at the first loss the low quality\n * (one pixel a CSS pixel, no sun's shadows, one worker, fewer tiles far away) and half the GPU memory budget; at the\n * next one, the WebGL2 fallback (a phone whose WebGPU keeps losing its device: Safari's GPU process taking its\n * memory back) and half the budget again. What it did: `'lighter'` or `'webgl2'`\n */\n private async lighten(): Promise<'lighter' | 'webgl2'> {\n this.#losses += 1;\n this.settings.memory = Math.max(MIN_MEMORY, this.settings.memory / 2);\n if (this.#losses === 1 || this.engines.renderer === 'webgl2') {\n this.qualityWatch = undefined;\n this.applyQuality('low');\n\n return 'lighter';\n }\n await this.engines.fallBack();\n\n return 'webgl2';\n }\n\n /**\n * The context is lost: its engine freed at once, the map's calls going to one that does nothing until `restore`\n * builds the next. The old engine's GPU objects went with the context: deleted now, it is silent (on the context\n * restored, each one warns); its 3D Tiles downloads stop. Its layers' updates meanwhile (a tile uploaded, labels)\n * would fail on the lost context, whose limits read 0\n */\n private dropLostEngine(): void {\n this.hoverPick.cancel();\n\n const camera = this.getCamera();\n\n this.#engine.free();\n this.#engine = destroyedEngine(camera);\n // Glyph ranges and icons arriving meanwhile upload to it, not to the freed engine\n this.atlases.attach(this.#engine);\n }\n\n /** After the GPU lost: a new engine with the same camera, settings and layers (same handles, same order); the engine\n * made asynchronously, adopted once there */\n private restore(): void {\n if (this.gone) return;\n\n const make = () => this.engines.create(this.canvas, () => this.requestRender(), this.settings);\n\n make()\n .catch(async (error: unknown) => {\n // WebGPU giving no new device after a loss (an adapter refused): the WebGL2 fallback\n if (this.engines.renderer === 'webgl2') throw error;\n console.warn(`isard: no new WebGPU device (${String(error)}), the map made again through WebGL2`);\n await this.engines.fallBack();\n this.emit('gpulost', { reason: 'unknown', message: String(error), losses: this.#losses, recovery: 'webgl2' });\n\n return make();\n })\n .then((engine) => this.adopt(engine))\n .catch(report);\n }\n\n /** A new engine in place of the map's (a placeholder, or a lost one): the same camera, settings and layers (same\n * handles, same order) */\n private adopt(engine: Engine): void {\n if (this.gone) {\n engine.free();\n\n return;\n }\n this.hoverPick.cancel();\n\n const camera = this.getCamera();\n\n this.#engine.free();\n this.#engine = engine;\n this.lost = false;\n this.watchDevice(engine);\n // Still timed (profiling)\n if (this.gpuTiming) engineGpuTiming(engine, true);\n this.setCamera(camera);\n this.atlases.attach(this.#engine);\n this.stack.reattach(this.#engine);\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 sun's shadows, the panoramas shown\n if (this.viewshed) this.setViewshed(this.viewshed);\n applyClipVolume(this.engine, this.clipVolume, this.settings.body.radius);\n if (this.sun) this.setSun(this.sun);\n this.panoramaSets.forEach((set) => {\n if (set.current) void set.show(set.current.index).catch(report);\n });\n this.resize();\n this.requestRender();\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 = clamp(eye.pitch, ...FIRST_PERSON_PITCH);\n eye.fov = clamp(eye.fov, ...FIRST_PERSON_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; `other`: layers shown on the other side only (two meshes of a place, each on its side). Set again as\n * the line moves (a slider, a drag); undefined stops\n */\n setSwipe(options: SwipeOptions | undefined): void {\n const used = options && (options.layers.length > 0 || (options.other?.length ?? 0) > 0);\n\n this.swipe = used ? { ...options, layers: [...options.layers], other: [...(options.other ?? [])] } : undefined;\n this.applySwipe();\n this.requestRender();\n }\n\n private applySwipe(): void {\n const s = this.swipe;\n const idsOf = (layers: readonly Layer[] | undefined) =>\n Uint32Array.from(\n (layers ?? []).filter((l) => l.id >= 0),\n (l) => l.id,\n );\n const ids = idsOf(s?.layers);\n const others = idsOf(s?.other);\n const shown = ids.length > 0 || others.length > 0;\n\n this.engine.setSwipe(s && shown ? s.position : Number.NaN, s?.side === 'right', ids, others);\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 try {\n layer.attach(this.engine);\n } catch (error) {\n // A context lost before the browser says so (its event comes later): nothing could be made on it, the layer is\n // made with the others on the next engine (`restore`). Any other failure is the caller's\n if (!this.contextLost()) throw error;\n }\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 /** Whether the canvas's WebGL context is lost, its event come or not */\n private contextLost(): boolean {\n // On a WebGPU canvas, no WebGL context: null, nothing taken\n return this.lost || this.canvas.getContext('webgl2')?.isContextLost() === true;\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 #quality: Quality = 'high';\n /** 'auto': the frames watched, the map stepped down while they stay slow */\n private qualityWatch: QualityWatch | undefined;\n private movingNow = false;\n\n /** The map's quality: `'high'`, `'medium'` or `'low'` (as `GeoMapOptions.quality` says; `'auto'` the level it\n * stepped down to) */\n getQuality(): Quality {\n return this.#quality;\n }\n\n /** @internal What its quality draws */\n get quality(): QualitySettings {\n return QUALITY[this.#quality];\n }\n\n /** Sets the map's quality (`GeoMapOptions.quality`); `'auto'` starts again from `'high'` */\n setQuality(quality: Quality | 'auto'): void {\n this.qualityWatch = quality === 'auto' ? new QualityWatch('high', (level) => this.applyQuality(level)) : undefined;\n this.applyQuality(quality === 'auto' ? 'high' : quality);\n }\n\n private applyQuality(quality: Quality): void {\n if (quality === this.#quality) return;\n this.#quality = quality;\n // The canvas at its pixel ratio, the sun's shadows, the layers' detail\n this.resize();\n if (this.sun) this.setSun(this.sun);\n this.layers.forEach((layer) => {\n layer.qualityChanged();\n });\n this.emit('quality', { quality });\n this.requestRender();\n }\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 /**\n * Moves the camera to frame a box: a ground box (`[west, south, east, north]`), or a box in space (a building, a\n * pipe underground: `{ bounds, bottom, top }`, altitudes in metres), all its corners within the canvas less the\n * padding, at the pitch and bearing given (default the current ones); an ease, a flight with `fly`, a jump with\n * `duration: 0`\n */\n fitBounds(box: FitBox | FitBox['bounds'], options: FitBoundsOptions = {}): void {\n const { bounds, bottom = 0, top = bottom } = Array.isArray(box) ? { bounds: box } : box;\n const current = this.getCamera();\n const room = options.padding ?? 40;\n const padding =\n typeof room === 'number'\n ? [room, room, room, room]\n : [room.top ?? 0, room.right ?? 0, room.bottom ?? 0, room.left ?? 0];\n const camera = this.engine.fitCamera(\n Float64Array.from(bounds),\n bottom,\n top,\n Float64Array.from(padding),\n options.pitch ?? current.pitch,\n options.bearing ?? current.bearing,\n );\n\n if (!camera) throw new Error('isard: fitBounds needs a box, west not past east nor south past north');\n\n const to = { ...camera, zoom: Math.min(camera.zoom, options.maxZoom ?? Number.POSITIVE_INFINITY) };\n\n if (options.duration === 0) this.setCamera(to);\n else if (options.fly) this.flyTo(to, options);\n else this.easeTo(to, { duration: 600, ...options });\n }\n\n /** Height of the RAF20 geoid above the ellipsoid at a position (metres; 0 away from mainland France): what turns an\n * altitude (NGF-IGN69: the BD TOPO's, the RGE ALTI's) into a height above the ellipsoid (`fitBounds`, `refine`) */\n geoidHeight([lon, lat]: LonLat): number {\n return this.engines.geoidHeight(lon, lat);\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 /** The sun set, set again in a new engine */\n private sun: SunOptions | undefined;\n\n /**\n * The sun casting shadows: the buildings, trees, models, 3D Tiles and the relief shade the ground and one another,\n * the walls turned away from it are in their own shade; the labels stay over them. The sun stands where it is at\n * `date` over the map's center (now by default), or at `azimuth` and `altitude`. As it sets the night falls (`night`\n * to set it by hand): the scene tinted in its blue, the windows of the buildings and the streets of `vectors()` lit,\n * the labels light on dark.\n * The shadows cover the ground around the view's center, fading out away from it, and cost two more depth passes\n * of the solid scene each frame. Undefined removes them\n */\n setSun(options: SunOptions | undefined): void {\n this.sun = options;\n if (!options) {\n this.engine.setSun(Number.NaN, Number.NaN, 0, 0);\n this.requestRender();\n\n return;\n }\n\n const { azimuth, altitude } =\n options.azimuth !== undefined && options.altitude !== undefined\n ? { azimuth: options.azimuth, altitude: options.altitude }\n : sunPosition(options.date ?? new Date(), this.getCamera().center);\n // The twilight: from 6° above the horizon to 6° under it, smoothly\n const dusk = Math.min(1, Math.max(0, (6 - altitude) / 12));\n const night = Math.min(1, Math.max(0, options.night ?? dusk * dusk * (3 - 2 * dusk)));\n // The shadows fade with the sun's light; none at a low quality (its light and the night stay)\n const opacity = this.quality.shadows ? Math.min(1, Math.max(0, options.opacity ?? 0.35)) * (1 - night) : 0;\n\n this.engine.setSun(azimuth, altitude, opacity, night);\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 setViewshed(options: ViewshedOptions | readonly ViewshedOptions[] | undefined): void {\n this.viewshed = options;\n if (applyViewshed(this.engine, options)) this.requestRender();\n }\n\n private clipVolume: ClipVolume | undefined;\n /** The clipping volume's handles over the map, while it has them */\n private clipHandles: ClipVolumeHandles | undefined;\n\n /** Cuts the 3D layers (models, 3D Tiles, extrusions, point clouds) by a volume, a box, a cylinder or a prism on a\n * polygon: what lies inside it, or outside it (`cut`), the faces the cut opens filled; with `handles`, sized and\n * moved with the pointer (`'clipvolume'` tells each change). Undefined removes it */\n setClipVolume(volume: ClipVolume | undefined): void {\n this.clipVolume = volume;\n applyClipVolume(this.engine, volume, this.settings.body.radius);\n if (volume?.handles) {\n this.clipHandles ??= this.addClipHandles(volume);\n this.clipHandles.set(volume);\n this.overlays.position(this.clipHandles);\n } else if (this.clipHandles) {\n this.overlays.detach(this.clipHandles, this.clipHandles.element);\n this.clipHandles = undefined;\n }\n this.requestRender();\n }\n\n /** The clipping volume set (`setClipVolume`), as its handles left it */\n getClipVolume(): ClipVolume | undefined {\n return this.clipVolume;\n }\n\n private addClipHandles(volume: ClipVolume): ClipVolumeHandles {\n const handles = new ClipVolumeHandles(\n {\n project: (lonLat, height) => this.project(lonLat, height),\n unproject: (point) => this.unproject(point),\n elevationAt: (lonLat) => this.elevationAt(lonLat),\n getCanvas: () => this.canvas,\n moved: (moved) => {\n this.setClipVolume(moved);\n this.emit('clipvolume', moved);\n },\n },\n volume,\n this.settings.body.radius,\n );\n\n this.overlays.attach(handles, handles.element);\n\n return handles;\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 Whether a relief is under the basemap: the fills of vector tiles drawn as geometry need their prisms */\n get hasRelief(): boolean {\n return this.settings.terrain !== undefined;\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 /** The GPU memory its layers hold (bytes): the tiles of the 3D Tiles and point clouds, kept within the budget\n * (`GeoMapOptions.memory`), the rasters' pools */\n memory(): MapMemory {\n // Two numbers a layer, its id and its bytes, the relief's (id 0) last\n const pairs = this.engine.memory();\n const byId = new Map(Array.from({ length: pairs.length / 2 }, (_, i) => [pairs[2 * i], pairs[2 * i + 1] ?? 0]));\n const layers = this.layers.flatMap((layer) => {\n const bytes = layer.id >= 0 ? byId.get(layer.id) : undefined;\n\n return bytes === undefined ? [] : [{ layer, bytes }];\n });\n\n return {\n budget: this.settings.memory,\n held: [...byId.values()].reduce((sum, bytes) => sum + bytes, 0),\n layers,\n };\n }\n\n /** Tile counters of the raster layers, for diagnostics */\n stats(): RasterLayerStats[] {\n return this.engine.stats();\n }\n\n /** Times the parts of each frame on the GPU, for profiling (`gpuTimings`): timer queries, read a few frames later.\n * An engine built to profile only (`PROFILE=1 bun run build`); false without one, or if the browser cannot\n * (`EXT_disjoint_timer_query_webgl2`) */\n setGpuTiming(on: boolean): boolean {\n this.gpuTiming = engineGpuTiming(this.engine, on);\n\n return this.gpuTiming;\n }\n\n /** The GPU time of the last frame measured (`setGpuTiming`), in all and by part: the backdrop, the ground (the raster\n * layers over the relief), each layer, the shadows, the panorama, the viewshed (ms) */\n gpuTimings(): MapGpuTimings | undefined {\n // The frame's number, then each part's code, layer id (-1 for none) and milliseconds\n const read: unknown = Reflect.get(this.engine, 'gpuTimings');\n const flat: unknown = typeof read === 'function' ? Reflect.apply(read, this.engine, []) : undefined;\n\n if (!(flat instanceof Float64Array) || flat.length === 0) return undefined;\n\n const parts = Array.from({ length: (flat.length - 1) / 3 }, (_, k) => {\n const [code = 0, id = -1, ms = 0] = flat.subarray(1 + k * 3, 4 + k * 3);\n const layer = id >= 0 ? this.layers.find((l) => l.id === id) : undefined;\n\n return { part: GPU_PARTS[code] ?? 'layer', ms, ...(layer && { layer }) };\n });\n\n return { frame: flat[0] ?? 0, ms: parts.reduce((sum, p) => sum + p.ms, 0), parts };\n }\n\n /**\n * The feature under a screen point (CSS pixels), undefined if none: its layer id and index. Reads the pixels around\n * the point of an offscreen picking pass, whatever the number of features, once the GPU is done (a frame or two\n * later: the GPU is not waited for). On hover, listen to 'hoverfeature' instead.\n */\n async pick(point: Point, { radius = 0, layers }: PickOptions = {}): Promise<PickHit | undefined> {\n const only = layers && Uint32Array.from(layers.map((l) => l.id));\n\n return (await pickOnce(() => this.engine, point, radius, only))?.hit;\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 async pickFeature(point: Point, options: PickOptions = {}): Promise<FeatureHit | undefined> {\n const hit = await this.pick(point, options);\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 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 panoramas.whenRemoved.push(() => {\n this.panoramaSets.delete(panoramas);\n });\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 [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 /** Whether a drag that turns and tilts the map (right button, Ctrl or Shift) goes around what is under the pointer\n * where it starts, a roof or a mesh as the relief (on by default), or around the screen center */\n setRotateAroundPointer(enabled: boolean): void {\n if (this.interaction) this.interaction.rotateAroundPointer = 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. Read from the last copy of\n * the scene's depth (a frame or two old, a pixel every 4 CSS pixels): at once, without waiting for the GPU */\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, or until measured: the scene is drawn looking down at\n * it after a frame and read back a frame or two later, the answer kept and measured again every 250 ms at most (ask\n * again on the next `render` event) */\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): RasterLayer {\n const { url, opacity = 1, saturation = 1, size, before, ground = true } = options;\n const { loader, minZoom, maxZoom } = rasterSource(options, this.workers.remoteReprojection);\n const layer = new RasterLayer(this, { url, minZoom, maxZoom, opacity, saturation, size, loader, ground });\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(options: PmtilesOptions): Promise<RasterLayer | VectorTiles> {\n return pmtilesLayer(this, 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 = NETWORK_MAX, contour = 0, opacity = 1 } = options;\n const {\n halo = 0,\n haloOpacity = NETWORK_HALO_OPACITY,\n ramp,\n unreachedColor = 'rgba(140, 140, 140, 0.25)',\n fade = 0,\n } = options;\n const style = { width, max, contour, opacity, halo, haloOpacity, ramp, unreachedColor, fade };\n\n validateNetwork(nodes, edges);\n\n return this.place(new NetworkLayer(this, { nodes, edges, lines }, costs, style, edgeWidths), options.before);\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 // The first layer above that goes not with it: its companions are removed with it\n const above = index >= 0 ? this.layers.slice(index + 1).find((l) => !old.companions.includes(l)) : undefined;\n const layer = this.add(spec);\n\n if (!('before' in spec && spec.before) && index >= 0) layer.moveBefore(above);\n old.remove();\n\n return layer;\n }\n\n /**\n * @internal Work the map waits on before it is idle (the vector tiles cut in the workers, uploaded over frames): the\n * engine knows only the tiles it holds, not those coming (an engine made anew holds none until the workers cut them\n * again from their cache, no request on the network meanwhile); a frame once it is done, to tell\n */\n track<T>(work: Promise<T>): Promise<T> {\n this.#working += 1;\n\n const done = () => {\n this.#working -= 1;\n this.requestRender();\n };\n\n work.then(done, done);\n\n return work;\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.frames.requestIdle();\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(\n new LineLayer<P>(this, options.data, lineStyle(options), options.altitudeReference),\n options.before,\n );\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): 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(\n new ExtrusionLayer<P>(this, options.data, extrusionStyle(options), options.drape),\n options.before,\n );\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.vectors(…)` as geometry, `tiles.labels(…)` its labels.\n * `setBasemap('osm-positron')` draws the basemap with a raster layer and the labels.\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 The geometry of a `VectorTiles` (`vectors`), under `before` if given */\n addVectorLayer(before?: Layer): VectorLayer {\n return this.place(new VectorLayer(this), before);\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 {\n url,\n maxScreenSpaceError = 16,\n opacity = 1,\n pointSize,\n color,\n geoid = false,\n facades = false,\n drape,\n } = options;\n\n return this.place(\n new Tiles3dLayer(\n this,\n url,\n geoid,\n {\n maxScreenSpaceError,\n opacity,\n ...(pointSize !== undefined ? { pointSize } : {}),\n ...(color !== undefined ? { color } : {}),\n },\n facades,\n drape,\n ),\n options.before,\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; under `before` if given\n */\n addPointCloud(options: PointCloudOptions): PointCloudLayer {\n return this.place(new PointCloudLayer(this, options), options.before);\n }\n\n /**\n * The grids of a GRIB2 or classic NetCDF file (its URL, or its bytes): a weather or ocean model's fields on grids of\n * longitudes and latitudes, read in a worker by the grid module (loaded with the first file). GRIB2 on a regular\n * latitude/longitude grid, packed simply, in groups or in groups of spatial differences (NOAA's GFS); NetCDF-3 with\n * the CF conventions. `windFields` pairs a wind's components into the fields of `addFlow`\n */\n readGrids(source: string | URL | ArrayBuffer | Uint8Array, options: { signal?: AbortSignal } = {}): Promise<Grid[]> {\n return this.workers.readGrids(source, this.gridUrl, options.signal);\n }\n\n /** Particles carried by a field of velocities (a wind, a current), their trails animated and colored by speed on\n * the globe and the relief (see `FlowOptions`) */\n addFlow(options: FlowOptions): FlowLayer {\n return this.place(new FlowLayer(this, options), options.before);\n }\n\n /** A glTF model drawn at positions (see `ModelOptions`), with depth */\n addModels(options: ModelOptions): ModelLayer {\n return this.place(new ModelLayer(this, options), options.before);\n }\n\n /** Trees at the points of a source that has them (a city's street trees), broadleaved or conifers by their data,\n * scaled to their height (see `TreeOptions`); the conifers on a layer that goes with the one returned */\n addTrees<P = Record<string, unknown>>(options: TreeOptions<P>): ModelLayer {\n return addTrees((o) => this.addModels(o), options);\n }\n\n /** A photo standing where it was taken, facing its way (see `PhotoOptions`): flat on a frame across its field of\n * view, a 360° one on a band round its camera; resolves once its image is read */\n addPhoto(options: PhotoOptions): Promise<ModelLayer> {\n return addPhoto((o) => this.addModels(o), options);\n }\n\n /**\n * The page's own WebGPU drawing at its place among the layers, in every frame (see `CustomLayerInterface`): raw\n * WebGPU, three.js's WebGPU renderer… with the map's device and the matrices of the frame (`frame.matrixAt`); under\n * `before` if given. Not drawn on the WebGL2 fallback\n */\n addCustomLayer(layer: CustomLayerInterface, options: { before?: Layer } = {}): CustomLayer {\n const custom = new CustomLayer(\n this,\n layer,\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 = Math.min(window.devicePixelRatio || 1, this.quality.pixelRatio);\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.remove();\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 GPU objects, models their data, while the device 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"]}
@@ -14,6 +14,7 @@ export interface MapEventProps {
14
14
  onClick?: (event: MapEvents['click']) => void;
15
15
  onRender?: (event: MapEvents['render']) => void;
16
16
  onQuality?: (event: MapEvents['quality']) => void;
17
+ onGpuLost?: (event: MapEvents['gpulost']) => void;
17
18
  onIdle?: () => void;
18
19
  onLeave?: () => void;
19
20
  onClipVolume?: (event: MapEvents['clipvolume']) => void;
@@ -14,6 +14,7 @@ const EVENT_PROPS = {
14
14
  onClick: 'click',
15
15
  onRender: 'render',
16
16
  onQuality: 'quality',
17
+ onGpuLost: 'gpulost',
17
18
  onIdle: 'idle',
18
19
  onLeave: 'leave',
19
20
  onClipVolume: 'clipvolume',
@@ -1 +1 @@
1
- {"version":3,"file":"IsardMap.js","sourceRoot":"","sources":["../../src/react/IsardMap.tsx"],"names":[],"mappings":";AAAA,iHAAiH;AAEjH,OAAO,EAEL,UAAU,EAEV,SAAS,EACT,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAgB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAkBjE,MAAM,WAAW,GAAG;IAClB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K,CAAC,KAAK,YAC5E,OAAO,CAAC,CAAC,CAAC,KAAC,UAAU,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,YAAG,KAAK,CAAC,QAAQ,GAAuB,CAAC,CAAC,CAAC,IAAI,GACzF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/** `<IsardMap>`: the map, created when it mounts, destroyed when it unmounts, its options and events as props */\n\nimport {\n type CSSProperties,\n forwardRef,\n type ReactNode,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { LayerOrder } from '../bind/layers.ts';\nimport { GeoMap } from '../map.ts';\nimport type { GeoMapOptions, LonLat, MapEvents, ViewshedOptions } from '../types.ts';\nimport type { Camera } from '../wasm/isard_webgpu.js';\nimport { type Binding, defined, MapContext } from './context.ts';\n\n/** The props of the map's events: `onClick` for 'click', `onMoveEnd` for 'moveend'… */\nexport interface MapEventProps {\n onMoveStart?: (camera: Camera) => void;\n onMove?: (camera: Camera) => void;\n onMoveEnd?: (camera: Camera) => void;\n onResize?: (event: MapEvents['resize']) => void;\n onHover?: (event: MapEvents['hover']) => void;\n onHoverFeature?: (event: MapEvents['hoverfeature']) => void;\n onClick?: (event: MapEvents['click']) => void;\n onRender?: (event: MapEvents['render']) => void;\n onQuality?: (event: MapEvents['quality']) => void;\n onIdle?: () => void;\n onLeave?: () => void;\n onClipVolume?: (event: MapEvents['clipvolume']) => void;\n}\n\nconst EVENT_PROPS = {\n onMoveStart: 'movestart',\n onMove: 'move',\n onMoveEnd: 'moveend',\n onResize: 'resize',\n onHover: 'hover',\n onHoverFeature: 'hoverfeature',\n onClick: 'click',\n onRender: 'render',\n onQuality: 'quality',\n onIdle: 'idle',\n onLeave: 'leave',\n onClipVolume: 'clipvolume',\n} as const satisfies Record<keyof MapEventProps, keyof MapEvents>;\n\nexport interface IsardMapProps extends Omit<GeoMapOptions, keyof Camera>, MapEventProps {\n /** The camera at creation, then left to the user's gestures */\n center?: LonLat;\n zoom?: number;\n pitch?: number;\n bearing?: number;\n /** A camera the map follows: set again whenever it changes (with `onMove` to keep it in a state) */\n camera?: Partial<Camera>;\n /** What `onHoverFeature` picks: within `radius` CSS pixels, among `layers` (default every layer) */\n hoverPicking?: GeoMap['hoverPicking'];\n /** The map, once created */\n onLoad?: (map: GeoMap) => void;\n /** The map's creation failed (no WebGL2, the engine not found) */\n onError?: (error: unknown) => void;\n id?: string;\n className?: string;\n style?: CSSProperties;\n /** Layers, markers, popups, panels, effects; drawn once the map is created */\n children?: ReactNode;\n}\n\n/** The props that are not options of the map */\nconst NOT_OPTIONS = [...Object.keys(EVENT_PROPS), 'onLoad', 'onError', 'hoverPicking', 'id', 'className', 'style'];\n\nconst isEventProp = (key: string): key is keyof typeof EVENT_PROPS => key in EVENT_PROPS;\n\n/** Options the map takes again after its creation, and how */\nconst LIVE_OPTIONS: { [K in keyof GeoMapOptions]?: (map: GeoMap, props: IsardMapProps) => void } = {\n quality: (map, p) => map.setQuality(p.quality ?? 'high'),\n basemap: (map, p) => {\n if (p.basemap) map.setBasemap(p.basemap, p.hillshade);\n },\n hillshade: (map, p) => {\n if (p.basemap) map.setBasemap(p.basemap, p.hillshade);\n },\n terrain: (map, p) => map.setTerrain(p.terrain ?? false),\n minZoom: (map, p) => map.setMinZoom(p.minZoom ?? 0),\n maxZoom: (map, p) => map.setMaxZoom(p.maxZoom ?? 22),\n maxPitch: (map, p) => map.setMaxPitch(p.maxPitch ?? 70),\n atmosphere: (map, p) => map.setAtmosphere(p.atmosphere),\n projection: (map, p) => map.setProjection(p.projection ?? 'globe'),\n loading: (map, p) => map.setLoading(p.loading ?? 'immediate'),\n sky: (map, p) => map.setSky(p.sky ?? true),\n sun: (map, p) => map.setSun(p.sun),\n background: (map, p) => {\n if (p.background) map.setBackground(p.background);\n },\n};\n\nconst isLiveOption = (key: string): key is keyof typeof LIVE_OPTIONS => key in LIVE_OPTIONS;\n\nconst optionsOf = (props: Partial<IsardMapProps>): GeoMapOptions =>\n Object.fromEntries(Object.entries(props).filter(([key]) => !NOT_OPTIONS.includes(key))) as GeoMapOptions;\n\nconst sameCamera = (a: Camera, b: Partial<Camera>): boolean =>\n (b.center === undefined || (a.center[0] === b.center[0] && a.center[1] === b.center[1])) &&\n (b.zoom === undefined || a.zoom === b.zoom) &&\n (b.pitch === undefined || a.pitch === b.pitch) &&\n (b.bearing === undefined || a.bearing === b.bearing);\n\n/** What the components of a new map share */\nconst bindingOf = (map: GeoMap): Binding => {\n const viewsheds = new Map<object, ViewshedOptions>();\n\n return {\n map,\n order: new LayerOrder(),\n viewsheds,\n applyViewsheds: () => map.setViewshed(viewsheds.size > 0 ? [...viewsheds.values()] : undefined),\n };\n};\n\n/**\n * A map filling its element (give it a height). Created once mounted, destroyed when unmounted; the options read at\n * creation only (`body`, `preset`, `interactive`, the URLs) need a new `key` to take another value\n */\nexport const IsardMap = forwardRef<GeoMap | undefined, IsardMapProps>(function IsardMap(props, ref) {\n const element = useRef<HTMLDivElement>(null);\n const latest = useRef(props);\n const applied = useRef<IsardMapProps>(props);\n const [binding, setBinding] = useState<Binding>();\n const map = binding?.map;\n const { camera, hoverPicking } = props;\n\n latest.current = props;\n useImperativeHandle(ref, () => map, [map]);\n\n // Created once: StrictMode's second mount and an unmount before the engine is loaded drop the map they started\n useEffect(() => {\n const container = element.current;\n\n if (!container) return;\n\n const created: { map?: GeoMap; cancelled: boolean } = { cancelled: false };\n const { camera, center, zoom, pitch, bearing, children: _, ...options } = latest.current;\n\n GeoMap.create(container, { ...optionsOf(options), ...defined({ center, zoom, pitch, bearing }), ...camera }).then(\n (map) => {\n if (created.cancelled) {\n map.destroy();\n\n return;\n }\n\n created.map = map;\n setBinding(bindingOf(map));\n latest.current.onLoad?.(map);\n },\n (error: unknown) => {\n if (created.cancelled) return;\n if (latest.current.onError) latest.current.onError(error);\n else console.error(error);\n },\n );\n\n return () => {\n created.cancelled = true;\n created.map?.destroy();\n setBinding(undefined);\n };\n }, []);\n\n // The events, each listened to once: the props may give another function at each render\n useEffect(() => {\n if (!map) return;\n\n const offs = Object.keys(EVENT_PROPS)\n .filter(isEventProp)\n .map((prop) =>\n map.on(EVENT_PROPS[prop], (event) => (latest.current[prop] as ((e: unknown) => void) | undefined)?.(event)),\n );\n\n return () => {\n offs.forEach((off) => {\n off();\n });\n };\n }, [map]);\n\n // The options taken again, compared with what the map was given last\n useEffect(() => {\n if (!map) return;\n\n const last = applied.current;\n const done = new Set<(map: GeoMap, props: IsardMapProps) => void>();\n\n applied.current = props;\n Object.keys(LIVE_OPTIONS)\n .filter(isLiveOption)\n .forEach((key) => {\n const apply = LIVE_OPTIONS[key];\n const changed = !Object.is(last[key], props[key]);\n\n if (!apply || done.has(apply) || !changed) return;\n done.add(apply);\n apply(map, props);\n });\n });\n\n // What `onHoverFeature` picks, given to the map whenever the prop changes\n useEffect(() => {\n if (map && hoverPicking) map.hoverPicking = hoverPicking;\n }, [map, hoverPicking]);\n\n // A controlled camera: set when the prop changes, unless the map is already there (a gesture reported by `onMove`)\n useEffect(() => {\n if (map && camera && !sameCamera(map.getCamera(), camera)) map.setCamera(camera);\n }, [map, camera]);\n\n return (\n <div ref={element} id={props.id} className={props.className} style={props.style}>\n {binding ? <MapContext.Provider value={binding}>{props.children}</MapContext.Provider> : null}\n </div>\n );\n});\n"]}
1
+ {"version":3,"file":"IsardMap.js","sourceRoot":"","sources":["../../src/react/IsardMap.tsx"],"names":[],"mappings":";AAAA,iHAAiH;AAEjH,OAAO,EAEL,UAAU,EAEV,SAAS,EACT,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAgB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAmBjE,MAAM,WAAW,GAAG;IAClB,WAAW,EAAE,WAAW;IACxB,MAAM,EAAE,MAAM;IACd,SAAS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AAC,CAAC,CAAC,KAAC,UAAU,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,YAAG,KAAK,CAAC,QAAQ,GAAuB,CAAC,CAAC,CAAC,IAAI,GACzF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/** `<IsardMap>`: the map, created when it mounts, destroyed when it unmounts, its options and events as props */\n\nimport {\n type CSSProperties,\n forwardRef,\n type ReactNode,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport { LayerOrder } from '../bind/layers.ts';\nimport { GeoMap } from '../map.ts';\nimport type { GeoMapOptions, LonLat, MapEvents, ViewshedOptions } from '../types.ts';\nimport type { Camera } from '../wasm/isard_webgpu.js';\nimport { type Binding, defined, MapContext } from './context.ts';\n\n/** The props of the map's events: `onClick` for 'click', `onMoveEnd` for 'moveend'… */\nexport interface MapEventProps {\n onMoveStart?: (camera: Camera) => void;\n onMove?: (camera: Camera) => void;\n onMoveEnd?: (camera: Camera) => void;\n onResize?: (event: MapEvents['resize']) => void;\n onHover?: (event: MapEvents['hover']) => void;\n onHoverFeature?: (event: MapEvents['hoverfeature']) => void;\n onClick?: (event: MapEvents['click']) => void;\n onRender?: (event: MapEvents['render']) => void;\n onQuality?: (event: MapEvents['quality']) => void;\n onGpuLost?: (event: MapEvents['gpulost']) => void;\n onIdle?: () => void;\n onLeave?: () => void;\n onClipVolume?: (event: MapEvents['clipvolume']) => void;\n}\n\nconst EVENT_PROPS = {\n onMoveStart: 'movestart',\n onMove: 'move',\n onMoveEnd: 'moveend',\n onResize: 'resize',\n onHover: 'hover',\n onHoverFeature: 'hoverfeature',\n onClick: 'click',\n onRender: 'render',\n onQuality: 'quality',\n onGpuLost: 'gpulost',\n onIdle: 'idle',\n onLeave: 'leave',\n onClipVolume: 'clipvolume',\n} as const satisfies Record<keyof MapEventProps, keyof MapEvents>;\n\nexport interface IsardMapProps extends Omit<GeoMapOptions, keyof Camera>, MapEventProps {\n /** The camera at creation, then left to the user's gestures */\n center?: LonLat;\n zoom?: number;\n pitch?: number;\n bearing?: number;\n /** A camera the map follows: set again whenever it changes (with `onMove` to keep it in a state) */\n camera?: Partial<Camera>;\n /** What `onHoverFeature` picks: within `radius` CSS pixels, among `layers` (default every layer) */\n hoverPicking?: GeoMap['hoverPicking'];\n /** The map, once created */\n onLoad?: (map: GeoMap) => void;\n /** The map's creation failed (no WebGL2, the engine not found) */\n onError?: (error: unknown) => void;\n id?: string;\n className?: string;\n style?: CSSProperties;\n /** Layers, markers, popups, panels, effects; drawn once the map is created */\n children?: ReactNode;\n}\n\n/** The props that are not options of the map */\nconst NOT_OPTIONS = [...Object.keys(EVENT_PROPS), 'onLoad', 'onError', 'hoverPicking', 'id', 'className', 'style'];\n\nconst isEventProp = (key: string): key is keyof typeof EVENT_PROPS => key in EVENT_PROPS;\n\n/** Options the map takes again after its creation, and how */\nconst LIVE_OPTIONS: { [K in keyof GeoMapOptions]?: (map: GeoMap, props: IsardMapProps) => void } = {\n quality: (map, p) => map.setQuality(p.quality ?? 'high'),\n basemap: (map, p) => {\n if (p.basemap) map.setBasemap(p.basemap, p.hillshade);\n },\n hillshade: (map, p) => {\n if (p.basemap) map.setBasemap(p.basemap, p.hillshade);\n },\n terrain: (map, p) => map.setTerrain(p.terrain ?? false),\n minZoom: (map, p) => map.setMinZoom(p.minZoom ?? 0),\n maxZoom: (map, p) => map.setMaxZoom(p.maxZoom ?? 22),\n maxPitch: (map, p) => map.setMaxPitch(p.maxPitch ?? 70),\n atmosphere: (map, p) => map.setAtmosphere(p.atmosphere),\n projection: (map, p) => map.setProjection(p.projection ?? 'globe'),\n loading: (map, p) => map.setLoading(p.loading ?? 'immediate'),\n sky: (map, p) => map.setSky(p.sky ?? true),\n sun: (map, p) => map.setSun(p.sun),\n background: (map, p) => {\n if (p.background) map.setBackground(p.background);\n },\n};\n\nconst isLiveOption = (key: string): key is keyof typeof LIVE_OPTIONS => key in LIVE_OPTIONS;\n\nconst optionsOf = (props: Partial<IsardMapProps>): GeoMapOptions =>\n Object.fromEntries(Object.entries(props).filter(([key]) => !NOT_OPTIONS.includes(key))) as GeoMapOptions;\n\nconst sameCamera = (a: Camera, b: Partial<Camera>): boolean =>\n (b.center === undefined || (a.center[0] === b.center[0] && a.center[1] === b.center[1])) &&\n (b.zoom === undefined || a.zoom === b.zoom) &&\n (b.pitch === undefined || a.pitch === b.pitch) &&\n (b.bearing === undefined || a.bearing === b.bearing);\n\n/** What the components of a new map share */\nconst bindingOf = (map: GeoMap): Binding => {\n const viewsheds = new Map<object, ViewshedOptions>();\n\n return {\n map,\n order: new LayerOrder(),\n viewsheds,\n applyViewsheds: () => map.setViewshed(viewsheds.size > 0 ? [...viewsheds.values()] : undefined),\n };\n};\n\n/**\n * A map filling its element (give it a height). Created once mounted, destroyed when unmounted; the options read at\n * creation only (`body`, `preset`, `interactive`, the URLs) need a new `key` to take another value\n */\nexport const IsardMap = forwardRef<GeoMap | undefined, IsardMapProps>(function IsardMap(props, ref) {\n const element = useRef<HTMLDivElement>(null);\n const latest = useRef(props);\n const applied = useRef<IsardMapProps>(props);\n const [binding, setBinding] = useState<Binding>();\n const map = binding?.map;\n const { camera, hoverPicking } = props;\n\n latest.current = props;\n useImperativeHandle(ref, () => map, [map]);\n\n // Created once: StrictMode's second mount and an unmount before the engine is loaded drop the map they started\n useEffect(() => {\n const container = element.current;\n\n if (!container) return;\n\n const created: { map?: GeoMap; cancelled: boolean } = { cancelled: false };\n const { camera, center, zoom, pitch, bearing, children: _, ...options } = latest.current;\n\n GeoMap.create(container, { ...optionsOf(options), ...defined({ center, zoom, pitch, bearing }), ...camera }).then(\n (map) => {\n if (created.cancelled) {\n map.destroy();\n\n return;\n }\n\n created.map = map;\n setBinding(bindingOf(map));\n latest.current.onLoad?.(map);\n },\n (error: unknown) => {\n if (created.cancelled) return;\n if (latest.current.onError) latest.current.onError(error);\n else console.error(error);\n },\n );\n\n return () => {\n created.cancelled = true;\n created.map?.destroy();\n setBinding(undefined);\n };\n }, []);\n\n // The events, each listened to once: the props may give another function at each render\n useEffect(() => {\n if (!map) return;\n\n const offs = Object.keys(EVENT_PROPS)\n .filter(isEventProp)\n .map((prop) =>\n map.on(EVENT_PROPS[prop], (event) => (latest.current[prop] as ((e: unknown) => void) | undefined)?.(event)),\n );\n\n return () => {\n offs.forEach((off) => {\n off();\n });\n };\n }, [map]);\n\n // The options taken again, compared with what the map was given last\n useEffect(() => {\n if (!map) return;\n\n const last = applied.current;\n const done = new Set<(map: GeoMap, props: IsardMapProps) => void>();\n\n applied.current = props;\n Object.keys(LIVE_OPTIONS)\n .filter(isLiveOption)\n .forEach((key) => {\n const apply = LIVE_OPTIONS[key];\n const changed = !Object.is(last[key], props[key]);\n\n if (!apply || done.has(apply) || !changed) return;\n done.add(apply);\n apply(map, props);\n });\n });\n\n // What `onHoverFeature` picks, given to the map whenever the prop changes\n useEffect(() => {\n if (map && hoverPicking) map.hoverPicking = hoverPicking;\n }, [map, hoverPicking]);\n\n // A controlled camera: set when the prop changes, unless the map is already there (a gesture reported by `onMove`)\n useEffect(() => {\n if (map && camera && !sameCamera(map.getCamera(), camera)) map.setCamera(camera);\n }, [map, camera]);\n\n return (\n <div ref={element} id={props.id} className={props.className} style={props.style}>\n {binding ? <MapContext.Provider value={binding}>{props.children}</MapContext.Provider> : null}\n </div>\n );\n});\n"]}