isard 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/LICENSE +21 -0
  3. package/README.md +150 -2
  4. package/dist/basemap.worker.d.ts +66 -0
  5. package/dist/basemap.worker.js +4 -0
  6. package/dist/basemap.worker.js.map +13 -0
  7. package/dist/basemaps.d.ts +46 -0
  8. package/dist/basemaps.js +95 -0
  9. package/dist/basemaps.js.map +1 -0
  10. package/dist/color.d.ts +8 -0
  11. package/dist/color.js +98 -0
  12. package/dist/color.js.map +1 -0
  13. package/dist/controls.d.ts +43 -0
  14. package/dist/controls.js +115 -0
  15. package/dist/controls.js.map +1 -0
  16. package/dist/decoder.worker.js +6 -0
  17. package/dist/decoder.worker.js.map +12 -0
  18. package/dist/decoders.d.ts +27 -0
  19. package/dist/decoders.js +109 -0
  20. package/dist/decoders.js.map +1 -0
  21. package/dist/equirectangular.d.ts +35 -0
  22. package/dist/equirectangular.js +113 -0
  23. package/dist/equirectangular.js.map +1 -0
  24. package/dist/extrusions.d.ts +79 -0
  25. package/dist/extrusions.js +215 -0
  26. package/dist/extrusions.js.map +1 -0
  27. package/dist/features.d.ts +159 -0
  28. package/dist/features.js +387 -0
  29. package/dist/features.js.map +1 -0
  30. package/dist/geoplateforme.d.ts +35 -0
  31. package/dist/geoplateforme.js +56 -0
  32. package/dist/geoplateforme.js.map +1 -0
  33. package/dist/glyphs.d.ts +104 -0
  34. package/dist/glyphs.js +383 -0
  35. package/dist/glyphs.js.map +1 -0
  36. package/dist/index.d.ts +34 -0
  37. package/dist/index.js +25 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/interaction.d.ts +50 -0
  40. package/dist/interaction.js +243 -0
  41. package/dist/interaction.js.map +1 -0
  42. package/dist/isard_bg.wasm +0 -0
  43. package/dist/isard_core_bg.wasm +0 -0
  44. package/dist/layers.d.ts +100 -0
  45. package/dist/layers.js +281 -0
  46. package/dist/layers.js.map +1 -0
  47. package/dist/loader.d.ts +30 -0
  48. package/dist/loader.js +102 -0
  49. package/dist/loader.js.map +1 -0
  50. package/dist/map.d.ts +203 -0
  51. package/dist/map.js +1083 -0
  52. package/dist/map.js.map +1 -0
  53. package/dist/mvt.d.ts +19 -0
  54. package/dist/mvt.js +231 -0
  55. package/dist/mvt.js.map +1 -0
  56. package/dist/overlay.d.ts +118 -0
  57. package/dist/overlay.js +334 -0
  58. package/dist/overlay.js.map +1 -0
  59. package/dist/protocol.d.ts +30 -0
  60. package/dist/protocol.js +2 -0
  61. package/dist/protocol.js.map +1 -0
  62. package/dist/style.d.ts +7 -0
  63. package/dist/style.js +130 -0
  64. package/dist/style.js.map +1 -0
  65. package/dist/symbols.d.ts +61 -0
  66. package/dist/symbols.js +238 -0
  67. package/dist/symbols.js.map +1 -0
  68. package/dist/terrain.d.ts +14 -0
  69. package/dist/terrain.js +44 -0
  70. package/dist/terrain.js.map +1 -0
  71. package/dist/types.d.ts +304 -0
  72. package/dist/types.js +2 -0
  73. package/dist/types.js.map +1 -0
  74. package/dist/vectorstyle.d.ts +83 -0
  75. package/dist/vectorstyle.js +518 -0
  76. package/dist/vectorstyle.js.map +1 -0
  77. package/dist/vectortiles.d.ts +121 -0
  78. package/dist/vectortiles.js +507 -0
  79. package/dist/vectortiles.js.map +1 -0
  80. package/dist/wasm/isard.d.ts +611 -0
  81. package/dist/wasm/isard.js +2606 -0
  82. package/dist/wasm/isard_core.d.ts +468 -0
  83. package/dist/wasm/isard_core.js +2360 -0
  84. package/package.json +49 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,SAAS,EACT,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,GAAG,EACH,aAAa,EACb,yBAAyB,EACzB,WAAW,GACZ,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","sourcesContent":["/**\n * The map: canvas, camera, layers, events and the frame loop. Frames are drawn on demand only: an idle map costs\n * nothing. Hover events are coalesced to one per frame, so the values computed for a mouse position are drawn in the\n * same frame.\n */\nimport {\n BASEMAPS,\n BODY_TERRAINS,\n basemapName,\n HILLSHADE,\n IGN_ATTRIBUTION,\n IMAGE_SERVER,\n imageServerTerrain,\n SEA,\n TERRAIN_TILES,\n TERRAIN_TILES_ATTRIBUTION,\n TERRAIN_URL,\n} from './basemaps.ts';\nimport { parseCssColor } from './color.ts';\nimport { AttributionControl, type Control, type ControlPosition } from './controls.ts';\nimport { DEFAULT_DECODERS } from './decoders.ts';\nimport { equirectangularLoader } from './equirectangular.ts';\nimport { ExtrusionLayer, type ExtrusionOptions, extrusionStyle } from './extrusions.ts';\nimport {\n CircleLayer,\n type CircleOptions,\n circleStyle,\n type Feature,\n FillLayer,\n type FillOptions,\n fillStyle,\n LineLayer,\n type LineOptions,\n lineStyle,\n} from './features.ts';\nimport { Glyphs } from './glyphs.ts';\nimport { Interaction } from './interaction.ts';\nimport { GroundLayer, type GroundOptions, type Layer, NetworkLayer, RasterLayer, Tiles3dLayer } from './layers.ts';\nimport { TileLoader } from './loader.ts';\nimport type { Positioned } from './overlay.ts';\nimport { injectStyle } from './style.ts';\nimport { SymbolLayer, type SymbolOptions, symbolStyle } from './symbols.ts';\nimport { encodedTerrainLoader } from './terrain.ts';\nimport type {\n AnimationOptions,\n AtmosphereOptions,\n Basemap,\n BodyOptions,\n CelestialBody,\n FeatureHit,\n FlyToOptions,\n GeoMapOptions,\n LoadingMode,\n LonLat,\n MapEvents,\n NetworkOptions,\n Point,\n Projection,\n RasterOptions,\n TerrainEncoding,\n TerrainModel,\n TerrainOptions,\n Tiles3dOptions,\n} from './types.ts';\nimport {\n BasemapWorkers,\n defaultWorkerCount,\n defaultWorkerUrl,\n VECTOR_BASEMAPS,\n VectorTiles,\n type VectorTilesOptions,\n} from './vectortiles.ts';\nimport type { Camera, Engine, PickHit, PickResult, RasterLayerStats } from './wasm/isard.js';\n\n/** The engine of a destroyed map: every method a no-op returning undefined, but the camera (the last one) and the\n * bounds, which late callers read */\nfunction destroyed(camera: Camera): Engine {\n return new Proxy(\n {},\n {\n get: (_, name) => {\n if (name === 'camera') return () => camera;\n if (name === 'bounds') return () => Float64Array.of(-180, -85, 180, 85);\n return () => undefined;\n },\n },\n ) as Engine;\n}\n\n/** Reports an error without throwing it here: the console shows it, as an uncaught one */\nfunction report(error: unknown): void {\n if (typeof reportError === 'function') reportError(error);\n else\n queueMicrotask(() => {\n throw error;\n });\n}\n\ntype Listeners = { [K in keyof MapEvents]: Set<(event: MapEvents[K]) => void> };\n\ntype EngineClass = new (canvas: HTMLCanvasElement, redraw: () => void) => Engine;\n\n/** An engine loaded: its compiled module and its class */\ninterface Bindings {\n module: WebAssembly.Module;\n Engine: EngineClass;\n}\n\n/** The two builds of the engine, each compiled once per page: `core` without 3D Tiles (a third smaller), loaded by\n * every map; `full` with them, loaded for the first 3D Tiles layer, its module shared with the decoding workers. The\n * core engine has the same API but the 3D Tiles methods: its class is typed as the full one. */\nconst engines: { core?: Promise<Bindings>; full?: Promise<Bindings> } = {};\n\nfunction loadEngine(kind: 'core' | 'full', url: string | URL): Promise<Bindings> {\n const loaded = engines[kind];\n if (loaded) return loaded;\n const loading = (async () => {\n // The bindings by dynamic import: an application bundles the ones it loads only\n const [module, bindings] = await Promise.all([\n compile(url),\n kind === 'core' ? import('./wasm/isard_core.js') : import('./wasm/isard.js'),\n ]);\n await bindings.default({ module_or_path: module });\n return { module, Engine: bindings.Engine as unknown as EngineClass };\n })().catch((error: unknown) => {\n // A later call tries again (a network error, a wrong URL fixed)\n delete engines[kind];\n throw error;\n });\n engines[kind] = loading;\n return loading;\n}\n\nasync function compile(url: string | URL): Promise<WebAssembly.Module> {\n const response = await fetch(url);\n if (!response.ok) throw new Error(`isard: failed to load the engine from ${url}: ${response.status}`);\n try {\n return await WebAssembly.compileStreaming(response.clone());\n } catch {\n // Servers that do not send application/wasm\n return WebAssembly.compile(await response.arrayBuffer());\n }\n}\n\n/** Checks a network's arrays before the engine reads them: node index pairs, indices of existing nodes */\nfunction validateNetwork(nodes: Float64Array, edges: Uint32Array): void {\n if (nodes.length % 2 !== 0) throw new Error(`isard: network nodes must be lon, lat pairs (length ${nodes.length})`);\n if (edges.length % 2 !== 0) throw new Error(`isard: network edges must be node index pairs (length ${edges.length})`);\n const count = nodes.length / 2;\n for (let i = 0; i < edges.length; i += 1) {\n const node = edges[i] as number;\n if (node >= count) throw new Error(`isard: network edge ${i >> 1} refers to node ${node}, of ${count} nodes`);\n }\n}\n\n/** The named bodies; a body's `color` is that of its globe under the tiles (the Earth's follows its basemap), its\n * `relief` the range of its ground (the Earth's dry land, from the Dead Sea to Everest). Mars: the sphere of its\n * equatorial radius (its data take planetocentric latitudes), a faint butterscotch halo of dust */\nconst BODIES: Record<Exclude<CelestialBody, BodyOptions>, Required<BodyOptions>> = {\n earth: { radius: 6378137, flattening: 1 / 298.257223563, atmosphere: true, color: '#cacaca', relief: [-450, 8900] },\n moon: { radius: 1737400, flattening: 0, atmosphere: false, color: '#77756f', relief: [-9200, 10800] },\n mars: {\n radius: 3396190,\n flattening: 0,\n atmosphere: 'rgba(232, 168, 120, 0.6)',\n color: '#b5714a',\n relief: [-8300, 21300],\n },\n};\n\n/** The Earth's halo, RGB 0-1 and its strength: what `atmosphere: true` draws */\nconst EARTH_HALO = Float32Array.of(0.42, 0.66, 1, 1);\n\n/** A body from the option, its defaults filled in */\nfunction bodySettings(body: CelestialBody | undefined): Required<BodyOptions> {\n if (body === undefined || typeof body === 'string') return BODIES[body ?? 'earth'];\n const relief: [number, number] = [-0.01 * body.radius, 0.01 * body.radius];\n return { flattening: 0, atmosphere: false, color: '#808080', relief, ...body };\n}\n\n/** The halo of an atmosphere for the engine (RGB 0-1 and its strength, the color's alpha): undefined for none */\nfunction haloSettings(atmosphere: boolean | string): Float32Array | undefined {\n if (atmosphere === true) return EARTH_HALO;\n const color = atmosphere === false ? undefined : parseCssColor(atmosphere);\n return color && Float32Array.from(color);\n}\n\n/** The loaders of the relief by encoding, URL and floor: the same loader for the same tiles (the engine keeps its\n * tiles when only the exaggeration changes) */\nconst terrainLoaders = new Map<string, ReturnType<typeof encodedTerrainLoader>>();\n\nfunction terrainLoader(url: string, encoding: Exclude<TerrainEncoding, 'float32'>, floor?: number) {\n const key = `${encoding} ${floor ?? ''} ${url}`;\n let loader = terrainLoaders.get(key);\n if (!loader) {\n loader = encodedTerrainLoader(url, encoding, floor);\n terrainLoaders.set(key, loader);\n }\n return loader;\n}\n\n/** Relief settings from the option: undefined when off. On the Earth the Terrain Tiles by default (worldwide,\n * Terrarium PNGs decoded in the page) or the IGN terrain model (France, raised by the geoid); NASA's on the Moon and\n * Mars; an ArcGIS image service asked for in the body's Mercator */\nfunction terrainSettings(\n terrain: boolean | TerrainModel | TerrainOptions | undefined,\n body: CelestialBody | undefined,\n radius: number,\n): Settings['terrain'] {\n if (!terrain) return undefined;\n let options: TerrainOptions = {};\n if (typeof terrain === 'string') options = { model: terrain };\n else if (terrain !== true) options = terrain;\n const earth = (body ?? 'earth') === 'earth';\n const exaggeration = options.exaggeration ?? 1;\n if (options.url === undefined && earth) {\n if (options.model === 'ign') {\n const geoid = options.geoid ?? true;\n return { url: TERRAIN_URL, exaggeration, maxZoom: options.maxZoom ?? 15, geoid, attribution: IGN_ATTRIBUTION };\n }\n return {\n url: TERRAIN_TILES.url,\n exaggeration,\n maxZoom: options.maxZoom ?? TERRAIN_TILES.maxZoom,\n geoid: options.geoid ?? false,\n // The sea floor of the model at sea level: the oceans stay flat under the basemap's water\n loader: terrainLoader(TERRAIN_TILES.url, 'terrarium', 0),\n attribution: TERRAIN_TILES_ATTRIBUTION,\n };\n }\n const preset = body === 'moon' || body === 'mars' ? BODY_TERRAINS[body] : undefined;\n const url = options.url ?? preset?.url;\n if (url === undefined) throw new Error('isard: the relief of this body needs a url');\n const encoding = options.encoding ?? 'float32';\n return {\n url: IMAGE_SERVER.test(url) ? imageServerTerrain(url, earth, radius) : url,\n exaggeration,\n maxZoom: options.maxZoom ?? (options.url === undefined && preset ? preset.maxZoom : 15),\n geoid: options.geoid ?? false,\n ...(encoding === 'float32' ? {} : { loader: terrainLoader(url, encoding) }),\n };\n}\n\n/** Sky settings for the engine: colors (RGB 0-1) and blends, MapLibre's defaults */\nfunction atmosphereSettings(options: AtmosphereOptions | undefined): Float32Array | undefined {\n if (!options) return undefined;\n return Float32Array.from([\n ...rgb(options.skyColor ?? '#9cc7ec'),\n ...rgb(options.horizonColor ?? '#e8f1f8'),\n ...rgb(options.fogColor ?? '#f2f5f8'),\n options.skyHorizonBlend ?? 0.6,\n options.horizonFogBlend ?? 0.7,\n options.fogGroundBlend ?? 0.4,\n ]);\n}\n\n/** MapLibre's default easing: cubic Bézier (0.25, 0.1, 0.25, 1) */\nexport function defaultEasing(t: number): number {\n if (t <= 0 || t >= 1) return Math.max(0, Math.min(1, t));\n // Solve x(u) = t for the curve parameter, Newton then bisection\n const [x1, y1, x2, y2] = [0.25, 0.1, 0.25, 1];\n const bezier = (u: number, a: number, b: number) => 3 * a * u * (1 - u) ** 2 + 3 * b * u * u * (1 - u) + u ** 3;\n let u = t;\n for (let i = 0; i < 8; i += 1) {\n const x = bezier(u, x1, x2) - t;\n const dx = 3 * x1 * (1 - u) ** 2 + 6 * (x2 - x1) * u * (1 - u) + 3 * (1 - x2) * u * u;\n if (Math.abs(x) < 1e-6 || dx === 0) break;\n u = Math.max(0, Math.min(1, u - x / dx));\n }\n return bezier(u, y1, y2);\n}\n\nconst MERCATOR_LAT = 85.051128779806589;\nconst toMercator = ([lon, lat]: LonLat): [number, number] => {\n const phi = (Math.max(-MERCATOR_LAT, Math.min(MERCATOR_LAT, lat)) * Math.PI) / 180;\n return [(lon + 180) / 360, 0.5 - Math.log(Math.tan(Math.PI / 4 + phi / 2)) / (2 * Math.PI)];\n};\nconst fromMercator = ([x, y]: [number, number]): LonLat => [\n x * 360 - 180,\n (Math.atan(Math.sinh(Math.PI * (1 - 2 * y))) * 180) / Math.PI,\n];\n\n/** A CSS color to RGB 0-1 (its alpha dropped); black if unknown */\nfunction rgb(color: string): [r: number, g: number, b: number] {\n const [r, g, b] = parseCssColor(color) ?? [0, 0, 0, 1];\n return [r, g, b];\n}\n\n/** Settings replayed on a new engine after a WebGL context loss */\ninterface Settings {\n body: Required<BodyOptions>;\n zoomRange: [min: number, max: number];\n maxPitch: number;\n globe: boolean;\n sky: boolean;\n atmosphere: Float32Array | undefined;\n terrain:\n | {\n url: string;\n exaggeration: number;\n maxZoom: number;\n geoid: boolean;\n /** Decodes the tiles of `url` for the engine (an encoding other than raw floats) */\n loader?: (z: number, x: number, y: number, signal: AbortSignal) => Promise<Float32Array | null>;\n /** Credits of the model */\n attribution?: string;\n }\n | undefined;\n loading: LoadingMode;\n background: [r: number, g: number, b: number];\n globeColor: [r: number, g: number, b: number];\n}\n\nconst CORNERS: readonly ControlPosition[] = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];\n\n/** A map (see `GeoMap.create`); layers take it as their host */\nexport class GeoMap {\n readonly canvas: HTMLCanvasElement;\n #glyphs: Glyphs | undefined;\n /** Layers new layers go under */\n private readonly onTop = new Set<Layer>();\n /** The vector basemap, if any: its tiles' workers and its labels */\n private vector: { tiles: VectorTiles; labels: SymbolLayer<unknown> } | undefined;\n private readonly glyphsUrl: string | undefined;\n private readonly basemapWorkerUrl: string | URL | undefined;\n private readonly container: HTMLElement;\n /** Markers and popups, over the canvas */\n private readonly overlay: HTMLDivElement;\n private readonly corners: Record<ControlPosition, HTMLDivElement>;\n private readonly controls = new Map<Control, HTMLElement>();\n private readonly positioned = new Set<Positioned>();\n /** Canvas size in CSS pixels, kept on resize so placing overlays never reads the layout */\n private size: Point = [0, 0];\n #engine: Engine;\n /** Layers in drawing order (bottom first), to recreate them after a context loss */\n private readonly layers: Layer[] = [];\n private readonly settings: Settings;\n /** The WebGL context is lost: nothing is drawn until it is restored */\n private lost = false;\n private readonly listeners: Listeners = {\n movestart: new Set(),\n move: new Set(),\n moveend: new Set(),\n resize: new Set(),\n hover: new Set(),\n hoverfeature: new Set(),\n click: new Set(),\n render: new Set(),\n idle: new Set(),\n leave: new Set(),\n };\n private readonly resizeObserver: ResizeObserver;\n private readonly interaction: Interaction | undefined;\n private loader: TileLoader | undefined;\n /** The class of the engine: without 3D Tiles until a 3D Tiles layer is added, unless asked for from the start */\n private engineClass: EngineClass;\n /** The module of the engine with 3D Tiles once it runs this map (the decoding workers run it too) */\n private tiles3dModule: WebAssembly.Module | undefined;\n /** The engine with 3D Tiles is loading, for the 3D Tiles layers added on the core engine */\n private upgrading: Promise<void> | undefined;\n /** What loading the engine with 3D Tiles and its workers needs */\n private readonly tiles3dOptions: Pick<GeoMapOptions, 'wasmUrl' | 'workers' | 'workerUrl' | 'decoders'>;\n private gone = false;\n /** The map is of the Earth: a basemap by default */\n private readonly earth: boolean;\n /** The body, as the option named it */\n private readonly body: CelestialBody | undefined;\n private basemap: RasterLayer | undefined;\n private hillshade: RasterLayer | undefined;\n /** Called when the credits of the layers or relief change (the attribution controls) */\n private readonly attributionListeners = new Set<() => void>();\n /** Credits of the raster layers that have some (basemaps, hillshade, the Géoplateforme's rasters…) */\n private readonly rasterCredits = new Map<object, string>();\n private animation: ((now: number) => boolean) | undefined;\n private hoverPoint: Point | undefined;\n /** Frame polling the engine for the answer of the hover picking, 0 if none */\n private hoverPoll = 0;\n /** What 'hoverfeature' looks for: within `radius` CSS pixels, in `layers` only if given */\n hoverPicking: { radius?: number; layers?: readonly Layer[] } = {};\n private frameRequest = 0;\n private lastCamera = '';\n /** The camera moved since the last 'moveend' */\n private moving = false;\n /** The last frame found everything loaded ('idle' sent) */\n private settled = false;\n private inFrame = false;\n /** Vector tiles made by `vectorTiles()`, destroyed with the map */\n private readonly vectorSets = new Set<VectorTiles>();\n /** The workers drawing vector tiles, shared by every `VectorTiles` of the map; created on first use */\n private basemapPool: BasemapWorkers | undefined;\n /** Stops watching the device pixel ratio */\n private unwatchRatio: (() => void) | undefined;\n\n /** Loads the engine (once per page) and creates a map filling `container` */\n static async create(container: HTMLElement, options: GeoMapOptions = {}): Promise<GeoMap> {\n // With 3D Tiles from the start when asked, or when only that engine's URL is given (as before the core engine)\n const full = options.tiles3d === true || (options.wasmUrl !== undefined && options.coreWasmUrl === undefined);\n const bindings = full\n ? await loadEngine('full', options.wasmUrl ?? new URL('./isard_bg.wasm', import.meta.url))\n : await loadEngine('core', options.coreWasmUrl ?? new URL('./isard_core_bg.wasm', import.meta.url));\n return new GeoMap(container, options, bindings.Engine, full ? bindings.module : undefined);\n }\n\n private constructor(\n container: HTMLElement,\n options: GeoMapOptions,\n engineClass: EngineClass,\n tiles3dModule: WebAssembly.Module | undefined,\n ) {\n this.engineClass = engineClass;\n this.tiles3dModule = tiles3dModule;\n this.tiles3dOptions = { ...options };\n this.glyphsUrl = options.glyphs;\n this.basemapWorkerUrl = options.basemapWorkerUrl;\n this.container = container;\n this.canvas = document.createElement('canvas');\n Object.assign(this.canvas.style, { display: 'block', width: '100%', height: '100%', touchAction: 'none' });\n // Overlays and controls are positioned against the container\n injectStyle(container.ownerDocument);\n if (getComputedStyle(container).position === 'static') container.style.position = 'relative';\n container.classList.add('isard-map');\n this.overlay = document.createElement('div');\n this.overlay.className = 'isard-overlay';\n const corner = (position: ControlPosition) => {\n const element = document.createElement('div');\n element.className = `isard-ctrl-${position}`;\n return element;\n };\n this.corners = {\n 'top-left': corner('top-left'),\n 'top-right': corner('top-right'),\n 'bottom-left': corner('bottom-left'),\n 'bottom-right': corner('bottom-right'),\n };\n container.append(this.canvas, this.overlay, ...CORNERS.map((position) => this.corners[position]));\n this.earth = (options.body ?? 'earth') === 'earth';\n this.body = options.body;\n const body = bodySettings(options.body);\n this.settings = {\n body,\n zoomRange: [options.minZoom ?? 0, options.maxZoom ?? 22],\n maxPitch: options.maxPitch ?? 70,\n globe: (options.projection ?? 'globe') === 'globe',\n sky: options.sky ?? true,\n atmosphere: atmosphereSettings(options.atmosphere),\n terrain: terrainSettings(options.terrain, options.body, body.radius),\n loading: options.loading ?? 'immediate',\n background: rgb(options.background ?? (this.earth ? '#f2f2f0' : '#000000')),\n globeColor: this.earth ? SEA['osm-positron'] : rgb(body.color),\n };\n this.#engine = this.createEngine();\n // The browser may take the GPU away (driver reset, background tab on mobile): the map waits, then rebuilds\n this.canvas.addEventListener('webglcontextlost', (event) => {\n event.preventDefault();\n this.lost = true;\n cancelAnimationFrame(this.frameRequest);\n this.frameRequest = 0;\n });\n this.canvas.addEventListener('webglcontextrestored', () => this.restore());\n const start: Camera = this.earth\n ? { center: [2.4246, 48.8457], zoom: 13, pitch: 0, bearing: 0 }\n : { center: [0, 0], zoom: 2, pitch: 0, bearing: 0 };\n this.setCamera({ ...start, ...options });\n this.setBasemap(options.basemap ?? (this.earth ? 'osm-positron' : 'none'), options.hillshade ?? 0);\n this.resizeObserver = new ResizeObserver(() => this.resize());\n this.resizeObserver.observe(container);\n this.watchRatio();\n this.resize();\n const interactive = options.interactive ?? true;\n const keyboard = interactive && (options.keyboard ?? true);\n this.interaction = interactive ? new Interaction(this, { keyboard }) : undefined;\n // Reached with Tab when the keys move it; named for screen readers either way\n this.canvas.classList.add('isard-canvas');\n this.canvas.setAttribute('role', keyboard ? 'application' : 'region');\n this.canvas.setAttribute('aria-roledescription', 'map');\n this.canvas.setAttribute('aria-label', options.ariaLabel ?? 'Map');\n if (keyboard) this.canvas.tabIndex = 0;\n const attribution = options.attributionControl ?? true;\n if (attribution !== false) {\n this.addControl(new AttributionControl(attribution === true ? {} : attribution), 'bottom-right');\n }\n }\n\n /** The element the map was created in */\n getContainer(): HTMLElement {\n return this.container;\n }\n\n getCanvas(): HTMLCanvasElement {\n return this.canvas;\n }\n\n /** @internal The engine (replaced after a context loss) */\n get engine(): Engine {\n return this.#engine;\n }\n\n private createEngine(): Engine {\n const engine = new this.engineClass(this.canvas, () => this.requestRender());\n // The body first: the layers' shaders may take its size\n const { radius, flattening, atmosphere: air, relief } = this.settings.body;\n engine.setBody(radius, flattening, haloSettings(air), ...relief);\n const { zoomRange, maxPitch, globe, sky, atmosphere, terrain, loading, background, globeColor } = this.settings;\n engine.setZoomRange(...zoomRange);\n engine.setMaxPitch(maxPitch);\n engine.setGlobe(globe);\n engine.setSky(sky);\n engine.setAtmosphere(atmosphere);\n engine.setTerrain(terrain?.url, terrain?.exaggeration ?? 1, terrain?.maxZoom, terrain?.geoid, terrain?.loader);\n engine.setImmediateLoading(loading === 'immediate');\n engine.setBackground(...background);\n engine.setGlobeColor(...globeColor);\n this.loader ??= this.startLoader(engine);\n if (this.loader) engine.setTileLoader(this.loader);\n return engine;\n }\n\n /** The decoding workers of 3D Tiles, with the engine that has them (they run its module) and unless turned off */\n private startLoader(engine: Engine): TileLoader | undefined {\n const { workers: count, workerUrl, decoders } = this.tiles3dOptions;\n const workers = count ?? Math.min(4, Math.max(1, (navigator.hardwareConcurrency || 2) - 1));\n if (!this.tiles3dModule || workers === false || workers <= 0 || typeof Worker === 'undefined') return undefined;\n return new TileLoader(\n this.tiles3dModule,\n workerUrl ?? new URL('./decoder.worker.js', import.meta.url),\n workers,\n { ...DEFAULT_DECODERS, ...decoders },\n engine.textureFormats(),\n );\n }\n\n /** A 3D Tiles layer on the core engine: loads the engine with 3D Tiles, then rebuilds the map on it (camera,\n * settings and layers kept, as after a context loss); the layer is created then */\n private upgrade(): void {\n const url = this.tiles3dOptions.wasmUrl ?? new URL('./isard_bg.wasm', import.meta.url);\n this.upgrading ??= loadEngine('full', url).then(\n ({ module, Engine }) => {\n this.upgrading = undefined;\n if (this.gone) return;\n this.engineClass = Engine;\n this.tiles3dModule = module;\n // A lost context: the engine is rebuilt on it once restored\n if (!this.lost) this.restore();\n },\n (error: unknown) => {\n // The 3D Tiles layers stay empty; the next one added tries again\n this.upgrading = undefined;\n report(error);\n this.requestRender();\n },\n );\n }\n\n /** After a context loss: a new engine with the same camera, settings and layers (same handles, same order) */\n private restore(): void {\n this.cancelHoverPick();\n const camera = this.getCamera();\n this.#engine.free();\n this.#engine = this.createEngine();\n this.lost = false;\n this.setCamera(camera);\n this.#glyphs?.attach(this.#engine);\n for (const layer of this.layers) layer.attach(this.#engine);\n this.resize();\n }\n\n /** @internal Forgets a removed layer */\n detach(layer: object): void {\n this.unlist(layer);\n if (this.rasterCredits.delete(layer)) this.attributionChanged();\n }\n\n /** Takes a layer out of the drawing order (to put it back elsewhere, or for good) */\n private unlist(layer: object): void {\n const index = this.layers.indexOf(layer as Layer);\n if (index >= 0) this.layers.splice(index, 1);\n }\n\n private add<L extends Layer>(layer: L): L {\n // On the core engine, a 3D Tiles layer waits for the engine with 3D Tiles: it is created with the others on it\n if (layer instanceof Tiles3dLayer && !this.tiles3dModule) this.upgrade();\n else layer.attach(this.engine);\n this.layers.push(layer);\n // Under the layers kept on top (the basemap's labels)\n const top = this.layers.find((l) => this.onTop.has(l) && l !== layer);\n if (top) this.moveLayer(layer, top);\n this.requestRender();\n return layer;\n }\n\n /** @internal Keeps a layer above the layers added after it (they go under it), as the labels of a basemap */\n keepOnTop(layer: Layer): void {\n this.onTop.add(layer);\n }\n\n /** @internal Moves a layer under `before`, or on top of all */\n moveLayer(layer: object, before: object | undefined): void {\n const handle = layer as Layer;\n this.unlist(handle);\n const index = before ? this.layers.indexOf(before as Layer) : -1;\n const at = index < 0 ? this.layers.length : index;\n this.layers.splice(at, 0, handle);\n if (handle.id >= 0) this.engine.moveLayer(handle.id, this.engineIndex(at));\n this.requestRender();\n }\n\n /** @internal See `LayerHost.replaceLayer` */\n replaceLayer(layer: object, old: number): void {\n this.engine.removeLayer(old);\n const index = this.layers.indexOf(layer as Layer);\n if (index >= 0) this.engine.moveLayer((layer as Layer).id, this.engineIndex(index));\n }\n\n /** Index in the engine of the layer at `index`: the layers waiting for the engine with 3D Tiles are not in it yet */\n private engineIndex(index: number): number {\n let count = 0;\n for (let i = 0; i < index; i += 1) if ((this.layers[i]?.id ?? -1) >= 0) count += 1;\n return count;\n }\n\n /** Moves a layer under all the others */\n private toBottom(layer: Layer): void {\n this.engine.moveLayer(layer.id, 0);\n this.unlist(layer);\n this.layers.unshift(layer);\n }\n\n // ── Events ──\n\n /** Listens to an event; returns the function that stops listening */\n on<K extends keyof MapEvents>(type: K, listener: (event: MapEvents[K]) => void): () => void {\n const listeners: Set<(event: MapEvents[K]) => void> = this.listeners[type];\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n\n /** @internal Calls the listeners; one that throws is reported and does not stop the others nor the frame */\n emit<K extends keyof MapEvents>(type: K, event: MapEvents[K]): void {\n const listeners: Set<(event: MapEvents[K]) => void> = this.listeners[type];\n for (const listener of listeners) {\n try {\n listener(event);\n } catch (error) {\n report(error);\n }\n }\n }\n\n // ── Camera ──\n\n getCamera(): Camera {\n return this.engine.camera();\n }\n\n setCamera(camera: Partial<Camera>): void {\n const c = { ...this.getCamera(), ...camera };\n this.engine.setCamera(c.center[0], c.center[1], c.zoom, c.pitch, c.bearing);\n this.requestRender();\n }\n\n /** Animated move to a camera: over `duration` milliseconds (or the options), ease-out by default */\n easeTo(camera: Partial<Camera>, options: number | AnimationOptions = 600): void {\n const { duration = 600, easing = (t: number) => 1 - (1 - t) ** 3 } =\n typeof options === 'number' ? { duration: options } : options;\n const from = this.getCamera();\n const to = { ...from, ...camera };\n // Shortest way round\n const turn = ((to.bearing - from.bearing + 540) % 360) - 180;\n const start = performance.now();\n this.animate((now) => {\n if (now - start >= duration) this.engine.clearPreload();\n const t = duration > 0 ? Math.min(1, (now - start) / duration) : 1;\n const k = easing(t);\n const mix = (a: number, b: number) => a + (b - a) * k;\n this.engine.setCamera(\n mix(from.center[0], to.center[0]),\n mix(from.center[1], to.center[1]),\n mix(from.zoom, to.zoom),\n mix(from.pitch, to.pitch),\n from.bearing + turn * k,\n );\n return t < 1;\n });\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 { curve: rho = 1.42, speed = 1.2, easing = defaultEasing } = options;\n const [x0, y0] = toMercator(from.center);\n const [x1, y1] = toMercator(to.center);\n // Across the antimeridian, the short way\n const dx = x1 - x0 - Math.round(x1 - x0);\n const dy = y1 - y0;\n // In pixels at the start zoom (512 px world at zoom 0)\n const world = 512 * 2 ** from.zoom;\n const u1 = Math.hypot(dx, dy) * world;\n const w0 = Math.max(this.canvas.clientWidth, this.canvas.clientHeight, 1);\n const w1 = w0 / 2 ** (to.zoom - from.zoom);\n const rho2 = rho * rho;\n const r = (i: 0 | 1) => {\n const b = (w1 * w1 - w0 * w0 + (i ? -1 : 1) * rho2 * rho2 * u1 * u1) / (2 * (i ? w1 : w0) * rho2 * u1);\n return Math.log(Math.sqrt(b * b + 1) - b);\n };\n // No move on the ground (or nearly): a plain zoom\n const still = u1 < 1e-6 || !Number.isFinite(r(0)) || !Number.isFinite(r(1));\n const r0 = still ? 0 : r(0);\n const length = still ? Math.abs(Math.log(w1 / w0)) / rho : (r(1) - r0) / rho;\n const width = (s: number) =>\n still ? Math.exp((w1 < w0 ? -1 : 1) * rho * s) : Math.cosh(r0) / Math.cosh(r0 + rho * s);\n const along = (s: number) =>\n still ? 0 : (w0 * ((Math.cosh(r0) * Math.tanh(r0 + rho * s) - Math.sinh(r0)) / rho2)) / u1;\n const duration = options.duration ?? (1000 * length) / speed;\n const turn = ((to.bearing - from.bearing + 540) % 360) - 180;\n const start = performance.now();\n this.animate((now) => {\n if (now - start >= duration) this.engine.clearPreload();\n const t = duration > 0 ? Math.min(1, (now - start) / duration) : 1;\n const k = easing(t);\n const s = k * length;\n const u = t >= 1 ? 1 : along(s);\n const zoom = t >= 1 ? to.zoom : from.zoom + Math.log2(1 / width(s));\n const [lon, lat] = fromMercator([x0 + dx * u, y0 + dy * u]);\n this.engine.setCamera(lon, lat, zoom, from.pitch + (to.pitch - from.pitch) * k, from.bearing + turn * k);\n return t < 1;\n });\n this.engine.preload(to.center[0], to.center[1], to.zoom, to.pitch, to.bearing);\n }\n\n /** Longitudes and latitudes the view covers on the ground: `[west, south, east, north]` */\n getBounds(): [west: number, south: number, east: number, north: number] {\n const [west = -180, south = -85, east = 180, north = 85] = this.engine.bounds();\n return [west, south, east, north];\n }\n\n /** Lowest zoom the camera accepts (the widest view) */\n setMinZoom(zoom: number): void {\n this.settings.zoomRange[0] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n setMaxZoom(zoom: number): void {\n this.settings.zoomRange[1] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n /** Highest pitch, degrees, up to 85 */\n setMaxPitch(pitch: number): void {\n this.settings.maxPitch = pitch;\n this.engine.setMaxPitch(pitch);\n this.requestRender();\n }\n\n /** Sky over the plane and the fog of the ground (see `GeoMapOptions.atmosphere`); undefined to remove them */\n setAtmosphere(options: AtmosphereOptions | undefined): void {\n this.settings.atmosphere = atmosphereSettings(options);\n this.engine.setAtmosphere(this.settings.atmosphere);\n this.requestRender();\n }\n\n setProjection(projection: Projection): void {\n this.settings.globe = projection === 'globe';\n this.engine.setGlobe(this.settings.globe);\n this.requestRender();\n }\n\n /** How tiles load and show (see `LoadingMode`) */\n setLoading(mode: LoadingMode): void {\n this.settings.loading = mode;\n this.engine.setImmediateLoading(mode === 'immediate');\n this.requestRender();\n }\n\n /** Space behind the globe (stars, atmosphere halo) */\n setSky(enabled: boolean): void {\n this.settings.sky = enabled;\n this.engine.setSky(enabled);\n this.requestRender();\n }\n\n /** 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);\n const t = this.settings.terrain;\n this.engine.setTerrain(t?.url, t?.exaggeration ?? 1, t?.maxZoom, t?.geoid, t?.loader);\n this.attributionChanged();\n this.requestRender();\n }\n\n /** @internal The credits of the raster layers (the basemap first) and of the relief in use, each once */\n attributions(): string[] {\n const layers = this.layers.map((layer) => this.rasterCredits.get(layer));\n const credits = [...layers, this.settings.terrain?.attribution];\n return [...new Set(credits.filter((c): c is string => c !== undefined))];\n }\n\n /** @internal Calls `listener` when the credits change; returns what stops it */\n onAttributionChange(listener: () => void): () => void {\n this.attributionListeners.add(listener);\n return () => this.attributionListeners.delete(listener);\n }\n\n private attributionChanged(): void {\n for (const listener of this.attributionListeners) listener();\n }\n\n /** Color behind the map, a CSS color (its alpha ignored) */\n setBackground(color: string): void {\n this.settings.background = rgb(color);\n this.engine.setBackground(...this.settings.background);\n this.requestRender();\n }\n\n /** Tile counters of the raster layers, for diagnostics */\n stats(): RasterLayerStats[] {\n return this.engine.stats();\n }\n\n /**\n * Network edge under a screen point (CSS pixels), undefined if none. Reads one pixel of an offscreen picking pass:\n * cheap whatever the number of features, call it on hover.\n */\n pick(point: Point, radius = 0, layers?: readonly Layer[]): PickHit | undefined {\n const only = layers && Uint32Array.from(layers.map((l) => l.id));\n return this.engine.pick(point[0], point[1], radius, only);\n }\n\n /**\n * The feature under a screen point (CSS pixels), or the nearest one within `radius` pixels: its layer handle, its\n * index there and, for line, circle and fill layers, the feature itself; undefined if none. `layers` restricts the\n * search to some layers (the others hide nothing).\n */\n pickFeature(point: Point, options: { radius?: number; layers?: readonly Layer[] } = {}): FeatureHit | undefined {\n const hit = this.pick(point, options.radius ?? 0, options.layers);\n return hit && this.featureHit(hit);\n }\n\n /** A hit with its layer handle and feature; undefined if the layer is gone */\n private featureHit(hit: PickHit): FeatureHit | undefined {\n const layer = this.layers.find((l) => l.id === hit.layer);\n if (!layer) return undefined;\n const feature =\n 'featureAt' in layer && typeof layer.featureAt === 'function'\n ? (layer.featureAt(hit.index) as Feature | undefined)\n : undefined;\n return { layer, index: hit.index, feature };\n }\n\n /** Asks the engine what is under the pointer; its answer, read without waiting for the GPU, comes on a later frame */\n private requestHoverPick(point: Point): void {\n const { radius = 0, layers } = this.hoverPicking;\n const only = layers && Uint32Array.from(layers.map((l) => l.id));\n // A new request replaces the one in flight (in the engine too): one poll loop at most\n if (!this.engine.requestPick(point[0], point[1], radius, only) || this.hoverPoll) return;\n this.hoverPoll = requestAnimationFrame(this.pollHoverPick);\n }\n\n private readonly pollHoverPick = (): void => {\n this.hoverPoll = 0;\n if (this.lost) return;\n const result: PickResult | undefined = this.engine.pollPick();\n if (!result) {\n // The GPU is not done yet (usually a frame): asked again next frame, without drawing\n this.hoverPoll = requestAnimationFrame(this.pollHoverPick);\n return;\n }\n this.emit('hoverfeature', {\n point: [result.x, result.y],\n lonLat: result.lonLat,\n hit: result.hit && this.featureHit(result.hit),\n });\n };\n\n private cancelHoverPick(): void {\n cancelAnimationFrame(this.hoverPoll);\n this.hoverPoll = 0;\n }\n\n /** Screen point (CSS pixels) of a position, undefined behind the camera */\n project(lonLat: LonLat): Point | undefined {\n return this.engine.project(lonLat[0], lonLat[1]);\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 // ── Overlays and controls ──\n\n /** Adds a control in a corner of the map; controls stack from the corner inward */\n addControl(control: Control, position: ControlPosition = 'top-right'): this {\n if (this.controls.has(control)) return this;\n const element = control.onAdd(this);\n element.classList.add('isard-ctrl');\n // In the bottom corners the first control added stays lowest, as in MapLibre\n if (position.startsWith('bottom')) this.corners[position].prepend(element);\n else this.corners[position].append(element);\n this.controls.set(control, element);\n return this;\n }\n\n removeControl(control: Control): this {\n const element = this.controls.get(control);\n if (!element) return this;\n this.controls.delete(control);\n control.onRemove(this);\n element.remove();\n return this;\n }\n\n /** @internal Shows a marker or popup, placed after every frame from now on */\n attachOverlay(item: Positioned, element: HTMLElement): void {\n this.overlay.append(element);\n this.positioned.add(item);\n item.position(this.size);\n }\n\n /** @internal */\n detachOverlay(item: Positioned, element: HTMLElement): void {\n this.positioned.delete(item);\n element.remove();\n }\n\n /** @internal Places one overlay now (it moved), without drawing a frame */\n positionOverlay(item: Positioned): void {\n if (this.positioned.has(item)) item.position(this.size);\n }\n\n // ── Layers ──\n\n /** Replaces the basemap and the IGN hillshade, under the other layers (hillshade by default: 0, none). The former\n * names of the Géoplateforme basemaps (`LegacyBasemap`) are taken under their new ones */\n setBasemap(basemap: Basemap, hillshade = 0): void {\n const name = basemapName(basemap);\n this.basemap?.remove();\n this.hillshade?.remove();\n if (this.vector) {\n this.onTop.delete(this.vector.labels as Layer);\n this.vector.labels.remove();\n this.vector.tiles.destroy();\n this.vector = undefined;\n }\n const vector = VECTOR_BASEMAPS[name as keyof typeof VECTOR_BASEMAPS];\n if (vector) {\n const tiles = new VectorTiles(this, {\n style: vector,\n ...(this.basemapWorkerUrl ? { workerUrl: this.basemapWorkerUrl } : {}),\n });\n this.basemap = tiles.raster();\n this.vector = { tiles, labels: tiles.labels() as SymbolLayer<unknown> };\n } else {\n this.basemap = name === 'none' ? undefined : this.addRaster(BASEMAPS[name as keyof typeof BASEMAPS]);\n }\n // Off the Earth, the body's own color\n if (this.earth) this.settings.globeColor = SEA[name];\n this.engine.setGlobeColor(...this.settings.globeColor);\n this.hillshade = hillshade > 0 ? this.addRaster({ ...HILLSHADE, opacity: hillshade }) : undefined;\n if (this.hillshade) this.toBottom(this.hillshade);\n if (this.basemap) this.toBottom(this.basemap);\n this.attributionChanged();\n }\n\n /** Raster tiles ({z}, {x}, {y} URL; Web Mercator, or reprojected from an equirectangular `grid`), over the layers\n * already added */\n addRaster(options: RasterOptions & { before?: Layer }): RasterLayer {\n const { url, grid = 'mercator', minZoom = 0, maxZoom = 19, opacity = 1, saturation = 1, size, before } = options;\n let layer: RasterLayer;\n if (grid === 'equirectangular' && !options.loader) {\n // The source's level n has the pixel size of Mercator level n + 1 at the equator\n const loader = equirectangularLoader(url, maxZoom, size ?? 256);\n layer = new RasterLayer(this, { url, minZoom, maxZoom: maxZoom + 1, opacity, saturation, size, loader });\n } else {\n layer = new RasterLayer(this, { url, minZoom, maxZoom, opacity, saturation, size, loader: options.loader });\n }\n this.place(layer, before);\n if (options.attribution) {\n this.rasterCredits.set(layer, options.attribution);\n this.attributionChanged();\n }\n return layer;\n }\n\n /** Line network colored by a value per node; `layer.setValues` recolors it in one texture upload */\n addNetwork(options: NetworkOptions): NetworkLayer {\n const { nodes, edges, lines, costs, edgeWidths, width = 2, max = 1800, contour = 0, opacity = 1 } = options;\n const { halo = 0, haloOpacity = 0.11, ramp, unreachedColor = 'rgba(140, 140, 140, 0.25)', fade = 0 } = options;\n const style = { width, max, contour, opacity, halo, haloOpacity, ramp, unreachedColor, fade };\n validateNetwork(nodes, edges);\n return this.add(new NetworkLayer(this, { nodes, edges, lines }, costs, style, edgeWidths));\n }\n\n /** Lines from GeoJSON (line strings, and polygon outlines), styled per feature */\n addLines<P = Record<string, unknown>>(options: LineOptions<P>): LineLayer<P> {\n return this.place(new LineLayer<P>(this, options.data, lineStyle(options)), options.before);\n }\n\n /** Discs from GeoJSON points, styled per feature */\n addCircles<P = Record<string, unknown>>(options: CircleOptions<P>): CircleLayer<P> {\n return this.place(new CircleLayer<P>(this, options.data, circleStyle(options)), options.before);\n }\n\n /** Filled polygons from GeoJSON (holes included), styled per feature; over the relief they lie on the ground */\n addFills<P = Record<string, unknown>>(options: FillOptions<P>): FillLayer<P> {\n return this.place(new FillLayer<P>(this, options.data, fillStyle(options)), options.before);\n }\n\n /** The application's fragment shader over the ground (see `GroundOptions`); under `before` if given */\n addGround(options: GroundOptions & { before?: Layer }): GroundLayer {\n return this.place(new GroundLayer(this, options), options.before);\n }\n\n /** Polygons raised into blocks with depth (buildings), styled per feature; tiles of them come with `setTile` */\n addExtrusions<P = Record<string, unknown>>(options: ExtrusionOptions<P> = {}): ExtrusionLayer<P> {\n return this.place(new ExtrusionLayer<P>(this, options.data, extrusionStyle(options)), options.before);\n }\n\n /** Text labels from GeoJSON (points, the middle of lines, the center of polygons), placed without overlaps */\n addSymbols<P = Record<string, unknown>>(options: SymbolOptions<P>): SymbolLayer<P> {\n return this.place(new SymbolLayer<P>(this, options.data, symbolStyle(options)), options.before);\n }\n\n /** @internal The glyphs of the symbol layers, loaded on first use */\n get glyphs(): Glyphs {\n if (!this.#glyphs) {\n // The engine's context: the atlas stays within its texture size limit\n const gl = this.canvas.getContext('webgl2');\n const max = gl?.getParameter(gl.MAX_TEXTURE_SIZE);\n this.#glyphs = new Glyphs(this.glyphsUrl, typeof max === 'number' ? max : undefined);\n this.#glyphs.attach(this.engine);\n }\n return this.#glyphs;\n }\n\n /**\n * Vector tiles with a MapLibre style (OpenFreeMap's Positron by default): `tiles.raster(…)` draws its fills and lines\n * (or a subset) as a raster layer, `tiles.labels(…)` its labels. `setBasemap('osm-positron')` does both for the\n * basemap.\n */\n vectorTiles(options: VectorTilesOptions = {}): VectorTiles {\n const tiles = new VectorTiles(this, {\n ...(this.basemapWorkerUrl ? { workerUrl: this.basemapWorkerUrl } : {}),\n ...options,\n });\n // Its workers stop with the map\n this.vectorSets.add(tiles);\n return tiles;\n }\n\n /**\n * @internal The workers for a `VectorTiles`: the map's shared pool, or a pool of its own (`own`, to stop with it)\n * when it asks for another count or URL\n */\n basemapWorkers(count?: number, url?: string | URL): { pool: BasemapWorkers; own: boolean } {\n const sharedUrl = this.basemapWorkerUrl ?? defaultWorkerUrl();\n const shared = defaultWorkerCount();\n const workers = Math.max(1, count ?? shared);\n const workerUrl = url ?? sharedUrl;\n if (workers === shared && String(workerUrl) === String(sharedUrl)) {\n this.basemapPool ??= new BasemapWorkers(shared, sharedUrl);\n return { pool: this.basemapPool, own: false };\n }\n return { pool: new BasemapWorkers(workers, workerUrl), own: true };\n }\n\n /** Adds a layer, under `before` if given */\n private place<L extends Layer>(layer: L, before: Layer | undefined): L {\n this.add(layer);\n if (before) this.moveLayer(layer, before);\n return layer;\n }\n\n /** Textured meshes in 3D Tiles (photogrammetry, buildings), drawn with depth over the basemap */\n addTiles3d(options: Tiles3dOptions): Tiles3dLayer {\n const { url, maxScreenSpaceError = 16, opacity = 1 } = options;\n return this.add(new Tiles3dLayer(this, url, { maxScreenSpaceError, opacity }));\n }\n\n // ── Frames ──\n\n /** Asks for a frame; several calls before the next frame draw it once */\n requestRender(): void {\n // Changes made by listeners during a frame are drawn by that frame; nothing is drawn without a context\n if (this.inFrame || this.lost) return;\n this.frameRequest ||= requestAnimationFrame((now) => this.frame(now));\n }\n\n /** @internal Runs `step` every frame until it returns false; replaces the running animation */\n animate(step: ((now: number) => boolean) | undefined): void {\n // A flight cut short no longer needs its destination\n if (this.animation) this.engine.clearPreload();\n this.animation = step;\n this.requestRender();\n }\n\n /** @internal */\n hover(point: Point | undefined): void {\n this.hoverPoint = point;\n if (point) this.requestRender();\n else this.cancelHoverPick();\n }\n\n private frame(now: number): void {\n this.frameRequest = 0;\n try {\n this.inFrame = true;\n this.drawFrame(now);\n } finally {\n // Whatever throws in a frame, the next ones are still drawn\n this.inFrame = false;\n }\n }\n\n private drawFrame(now: number): void {\n if (this.animation && !this.animation(now)) this.animation = undefined;\n const camera = this.getCamera();\n const key = `${camera.center}|${camera.zoom}|${camera.pitch}|${camera.bearing}`;\n const moved = key !== this.lastCamera;\n if (moved) {\n // The first frame is no move\n if (!this.moving && this.lastCamera !== '') {\n this.moving = true;\n this.emit('movestart', camera);\n }\n this.lastCamera = key;\n this.emit('move', camera);\n } else if (this.moving && !this.animation && !this.interaction?.active) {\n this.moving = false;\n this.emit('moveend', camera);\n }\n // Values for the pointer position are computed before drawing, in the same frame\n let hovered: Point | undefined;\n if (this.hoverPoint) {\n const point = this.hoverPoint;\n hovered = point;\n this.hoverPoint = undefined;\n this.emit('hover', { point, lonLat: this.unproject(point) });\n }\n const t0 = performance.now();\n // The engine asks for the next frame while it draws (uploads past the frame budget, fades): not ignored\n this.inFrame = false;\n const loading = this.engine.render();\n this.inFrame = true;\n // The picking pass sees the frame just drawn; its answer comes on a later frame\n if (hovered && this.listeners.hoverfeature.size > 0) this.requestHoverPick(hovered);\n // Overlays follow the frame just drawn (camera, relief altitudes): all in one pass, transforms only\n for (const item of this.positioned) item.position(this.size);\n this.emit('render', { ms: performance.now() - t0 });\n this.inFrame = false;\n // A move goes on until a frame finds the camera still: that frame sends 'moveend'\n if (this.animation || (moved && this.moving)) this.requestRender();\n // Idle: nothing loading (the engine with 3D Tiles neither), no animation, no frame asked for (uploads waiting,\n // fades, listeners)\n if (loading || this.upgrading || this.animation || this.frameRequest !== 0) {\n this.settled = false;\n } else if (!this.settled) {\n this.settled = true;\n this.emit('idle', {});\n }\n }\n\n /** Resizes when the device pixel ratio changes (browser zoom, a window moved to another screen) */\n private watchRatio(): void {\n if (typeof matchMedia !== 'function') return;\n const query = matchMedia(`(resolution: ${window.devicePixelRatio || 1}dppx)`);\n const changed = () => {\n // A query for the new ratio\n this.unwatchRatio?.();\n this.watchRatio();\n this.resize();\n };\n query.addEventListener('change', changed, { once: true });\n this.unwatchRatio = () => query.removeEventListener('change', changed);\n }\n\n private resize(): void {\n if (this.lost) return;\n const { clientWidth: width, clientHeight: height } = this.canvas;\n const ratio = window.devicePixelRatio || 1;\n this.canvas.width = Math.round(width * ratio);\n this.canvas.height = Math.round(height * ratio);\n this.engine.resize(width, height, ratio);\n this.size = [width, height];\n this.emit('resize', { width, height });\n // Draw at once: a resized canvas is cleared, waiting one frame would flash\n cancelAnimationFrame(this.frameRequest);\n this.frame(performance.now());\n }\n\n destroy(): void {\n this.gone = true;\n const camera = this.getCamera();\n cancelAnimationFrame(this.frameRequest);\n this.cancelHoverPick();\n this.vector?.tiles.destroy();\n for (const tiles of this.vectorSets) tiles.destroy();\n this.vectorSets.clear();\n this.basemapPool?.terminate();\n this.basemapPool = undefined;\n this.unwatchRatio?.();\n this.unwatchRatio = undefined;\n this.resizeObserver.disconnect();\n this.interaction?.destroy();\n this.loader?.destroy();\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 = destroyed(camera);\n this.lost = true;\n for (const control of [...this.controls.keys()]) this.removeControl(control);\n this.positioned.clear();\n this.canvas.remove();\n this.overlay.remove();\n for (const position of CORNERS) this.corners[position].remove();\n this.container.classList.remove('isard-map');\n for (const listeners of Object.values(this.listeners)) listeners.clear();\n }\n}\n"]}
package/dist/mvt.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Mapbox Vector Tiles (MVT 2.1) decoding: layers of features with their properties and geometry, in tile units
3
+ * (`extent`, usually 4096 across). Points are lists of points, lines lists of lines, polygons lists of rings (the
4
+ * outer ones clockwise in tile coordinates, y down, holes the other way round, as the specification says).
5
+ */
6
+ export type Value = string | number | boolean;
7
+ export interface TileFeature {
8
+ /** 1 point, 2 line, 3 polygon */
9
+ type: 1 | 2 | 3;
10
+ properties: Record<string, Value>;
11
+ /** Point lists: x0, y0, x1, y1… in tile units */
12
+ geometry: number[][];
13
+ }
14
+ export interface TileLayer {
15
+ extent: number;
16
+ features: TileFeature[];
17
+ }
18
+ /** Decodes a tile; only the layers in `wanted` (all if undefined) */
19
+ export declare function decode(bytes: Uint8Array, wanted?: Set<string>): Map<string, TileLayer>;
package/dist/mvt.js ADDED
@@ -0,0 +1,231 @@
1
+ /**
2
+ * Mapbox Vector Tiles (MVT 2.1) decoding: layers of features with their properties and geometry, in tile units
3
+ * (`extent`, usually 4096 across). Points are lists of points, lines lists of lines, polygons lists of rings (the
4
+ * outer ones clockwise in tile coordinates, y down, holes the other way round, as the specification says).
5
+ */
6
+ /** Protobuf reader of a buffer range */
7
+ class Pbf {
8
+ buf;
9
+ end;
10
+ pos;
11
+ constructor(buf, start = 0, end = buf.length) {
12
+ this.buf = buf;
13
+ this.end = end;
14
+ this.pos = start;
15
+ }
16
+ /** An unsigned varint, approximated beyond 2^53; all its bytes are read (up to 10), so the next field is right */
17
+ varint() {
18
+ let value = 0;
19
+ for (let shift = 0; shift < 70; shift += 7) {
20
+ const b = this.buf[this.pos++] ?? 0;
21
+ value += (b & 0x7f) * 2 ** shift;
22
+ if (b < 0x80)
23
+ break;
24
+ }
25
+ return value;
26
+ }
27
+ /** A signed 64-bit varint (two's complement: a negative value takes 10 bytes) */
28
+ int64() {
29
+ let lo = 0;
30
+ let hi = 0;
31
+ for (let i = 0; i < 10; i += 1) {
32
+ const b = this.buf[this.pos++] ?? 0;
33
+ const bits = b & 0x7f;
34
+ // Bits 0-27 in the low word, bits 28-31 split, the rest in the high word
35
+ if (i < 4)
36
+ lo |= bits << (7 * i);
37
+ else if (i === 4) {
38
+ lo |= (bits & 0x0f) << 28;
39
+ hi |= bits >> 4;
40
+ }
41
+ else
42
+ hi |= bits << (7 * i - 32);
43
+ if (b < 0x80)
44
+ break;
45
+ }
46
+ // The high word signed: values from 2^63 up are negative
47
+ return (hi | 0) * 2 ** 32 + (lo >>> 0);
48
+ }
49
+ sint() {
50
+ const v = this.varint();
51
+ return v % 2 === 1 ? -(v + 1) / 2 : v / 2;
52
+ }
53
+ /** A length-delimited field as a sub-reader */
54
+ sub() {
55
+ const n = this.varint();
56
+ // A length past the end (a truncated tile) stops at the end
57
+ const end = Math.min(this.pos + n, this.end);
58
+ const r = new Pbf(this.buf, this.pos, end);
59
+ this.pos = end;
60
+ return r;
61
+ }
62
+ string() {
63
+ const n = this.varint();
64
+ const end = Math.min(this.pos + n, this.end);
65
+ const s = decoder.decode(this.buf.subarray(this.pos, end));
66
+ this.pos = end;
67
+ return s;
68
+ }
69
+ float() {
70
+ const v = this.pos + 4 <= this.end ? this.view().getFloat32(this.pos, true) : 0;
71
+ this.pos += 4;
72
+ return v;
73
+ }
74
+ double() {
75
+ const v = this.pos + 8 <= this.end ? this.view().getFloat64(this.pos, true) : 0;
76
+ this.pos += 8;
77
+ return v;
78
+ }
79
+ view() {
80
+ return new DataView(this.buf.buffer, this.buf.byteOffset, this.buf.byteLength);
81
+ }
82
+ skip(wire) {
83
+ if (wire === 0)
84
+ this.varint();
85
+ else if (wire === 1)
86
+ this.pos += 8;
87
+ else if (wire === 2)
88
+ this.pos += this.varint();
89
+ else if (wire === 5)
90
+ this.pos += 4;
91
+ }
92
+ get more() {
93
+ return this.pos < this.end;
94
+ }
95
+ }
96
+ const decoder = new TextDecoder();
97
+ function value(p) {
98
+ let v = '';
99
+ while (p.more) {
100
+ const tag = p.varint();
101
+ switch (tag >> 3) {
102
+ case 1:
103
+ v = p.string();
104
+ break;
105
+ case 2:
106
+ v = p.float();
107
+ break;
108
+ case 3:
109
+ v = p.double();
110
+ break;
111
+ case 4:
112
+ v = p.int64();
113
+ break;
114
+ case 5:
115
+ v = p.varint();
116
+ break;
117
+ case 6:
118
+ v = p.sint();
119
+ break;
120
+ case 7:
121
+ v = p.varint() !== 0;
122
+ break;
123
+ default:
124
+ p.skip(tag & 7);
125
+ }
126
+ }
127
+ return v;
128
+ }
129
+ /** Point lists of a geometry's commands (MoveTo, LineTo, ClosePath) */
130
+ function geometry(p) {
131
+ const out = [];
132
+ let current;
133
+ let [x, y] = [0, 0];
134
+ while (p.more) {
135
+ const command = p.varint();
136
+ const id = command & 7;
137
+ const count = command >> 3;
138
+ if (id === 7) {
139
+ // ClosePath: back to the first point
140
+ if (current && current.length >= 2)
141
+ current.push(current[0] ?? 0, current[1] ?? 0);
142
+ continue;
143
+ }
144
+ // A count past the end (a truncated geometry) stops there
145
+ for (let i = 0; i < count && p.more; i += 1) {
146
+ x += p.sint();
147
+ y += p.sint();
148
+ if (id === 1) {
149
+ current = [];
150
+ out.push(current);
151
+ }
152
+ current?.push(x, y);
153
+ }
154
+ }
155
+ return out;
156
+ }
157
+ /** Decodes a tile; only the layers in `wanted` (all if undefined) */
158
+ export function decode(bytes, wanted) {
159
+ const layers = new Map();
160
+ const tile = new Pbf(bytes);
161
+ while (tile.more) {
162
+ const tag = tile.varint();
163
+ if (tag >> 3 !== 3) {
164
+ tile.skip(tag & 7);
165
+ continue;
166
+ }
167
+ const l = tile.sub();
168
+ let name = '';
169
+ let extent = 4096;
170
+ const keys = [];
171
+ const values = [];
172
+ const raw = [];
173
+ while (l.more) {
174
+ const t = l.varint();
175
+ switch (t >> 3) {
176
+ case 1:
177
+ name = l.string();
178
+ break;
179
+ case 2:
180
+ raw.push(l.sub());
181
+ break;
182
+ case 3:
183
+ keys.push(l.string());
184
+ break;
185
+ case 4:
186
+ values.push(value(l.sub()));
187
+ break;
188
+ case 5:
189
+ extent = l.varint();
190
+ break;
191
+ default:
192
+ l.skip(t & 7);
193
+ }
194
+ }
195
+ if (wanted && !wanted.has(name))
196
+ continue;
197
+ const features = [];
198
+ for (const f of raw) {
199
+ let type = 1;
200
+ const properties = {};
201
+ let geom = [];
202
+ while (f.more) {
203
+ const t = f.varint();
204
+ switch (t >> 3) {
205
+ case 2: {
206
+ const tags = f.sub();
207
+ while (tags.more) {
208
+ const k = keys[tags.varint()];
209
+ const v = values[tags.varint()];
210
+ if (k !== undefined && v !== undefined)
211
+ properties[k] = v;
212
+ }
213
+ break;
214
+ }
215
+ case 3:
216
+ type = Math.min(3, Math.max(1, f.varint()));
217
+ break;
218
+ case 4:
219
+ geom = geometry(f.sub());
220
+ break;
221
+ default:
222
+ f.skip(t & 7);
223
+ }
224
+ }
225
+ features.push({ type, properties, geometry: geom });
226
+ }
227
+ layers.set(name, { extent, features });
228
+ }
229
+ return layers;
230
+ }
231
+ //# sourceMappingURL=mvt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mvt.js","sourceRoot":"","sources":["../src/mvt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,wCAAwC;AACxC,MAAM,GAAG;IAGY;IAER;IAJX,GAAG,CAAS;IACZ,YACmB,GAAe,EAChC,KAAK,GAAG,CAAC,EACA,MAAM,GAAG,CAAC,MAAM;QAFR,QAAG,GAAH,GAAG,CAAY;QAEvB,QAAG,GAAH,GAA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K,CAAC,CAAC,CAAC,CAAC;wBACP,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;wBACrB,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;4BACjB,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;4BAC9B,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;4BAChC,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS;gCAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;wBAC5D,CAAC;wBACD,MAAM;oBACR,CAAC;oBACD,KAAK,CAAC;wBACJ,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAc,CAAC;wBACzD,MAAM;oBACR,KAAK,CAAC;wBACJ,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;wBACzB,MAAM;oBACR;wBACE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBAClB,CAAC;YACH,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Mapbox Vector Tiles (MVT 2.1) decoding: layers of features with their properties and geometry, in tile units\n * (`extent`, usually 4096 across). Points are lists of points, lines lists of lines, polygons lists of rings (the\n * outer ones clockwise in tile coordinates, y down, holes the other way round, as the specification says).\n */\n\nexport type Value = string | number | boolean;\n\nexport interface TileFeature {\n /** 1 point, 2 line, 3 polygon */\n type: 1 | 2 | 3;\n properties: Record<string, Value>;\n /** Point lists: x0, y0, x1, y1… in tile units */\n geometry: number[][];\n}\n\nexport interface TileLayer {\n extent: number;\n features: TileFeature[];\n}\n\n/** Protobuf reader of a buffer range */\nclass Pbf {\n pos: number;\n constructor(\n private readonly buf: Uint8Array,\n start = 0,\n readonly end = buf.length,\n ) {\n this.pos = start;\n }\n /** An unsigned varint, approximated beyond 2^53; all its bytes are read (up to 10), so the next field is right */\n varint(): number {\n let value = 0;\n for (let shift = 0; shift < 70; shift += 7) {\n const b = this.buf[this.pos++] ?? 0;\n value += (b & 0x7f) * 2 ** shift;\n if (b < 0x80) break;\n }\n return value;\n }\n /** A signed 64-bit varint (two's complement: a negative value takes 10 bytes) */\n int64(): number {\n let lo = 0;\n let hi = 0;\n for (let i = 0; i < 10; i += 1) {\n const b = this.buf[this.pos++] ?? 0;\n const bits = b & 0x7f;\n // Bits 0-27 in the low word, bits 28-31 split, the rest in the high word\n if (i < 4) lo |= bits << (7 * i);\n else if (i === 4) {\n lo |= (bits & 0x0f) << 28;\n hi |= bits >> 4;\n } else hi |= bits << (7 * i - 32);\n if (b < 0x80) break;\n }\n // The high word signed: values from 2^63 up are negative\n return (hi | 0) * 2 ** 32 + (lo >>> 0);\n }\n sint(): number {\n const v = this.varint();\n return v % 2 === 1 ? -(v + 1) / 2 : v / 2;\n }\n /** A length-delimited field as a sub-reader */\n sub(): Pbf {\n const n = this.varint();\n // A length past the end (a truncated tile) stops at the end\n const end = Math.min(this.pos + n, this.end);\n const r = new Pbf(this.buf, this.pos, end);\n this.pos = end;\n return r;\n }\n string(): string {\n const n = this.varint();\n const end = Math.min(this.pos + n, this.end);\n const s = decoder.decode(this.buf.subarray(this.pos, end));\n this.pos = end;\n return s;\n }\n float(): number {\n const v = this.pos + 4 <= this.end ? this.view().getFloat32(this.pos, true) : 0;\n this.pos += 4;\n return v;\n }\n double(): number {\n const v = this.pos + 8 <= this.end ? this.view().getFloat64(this.pos, true) : 0;\n this.pos += 8;\n return v;\n }\n private view(): DataView {\n return new DataView(this.buf.buffer, this.buf.byteOffset, this.buf.byteLength);\n }\n skip(wire: number): void {\n if (wire === 0) this.varint();\n else if (wire === 1) this.pos += 8;\n else if (wire === 2) this.pos += this.varint();\n else if (wire === 5) this.pos += 4;\n }\n get more(): boolean {\n return this.pos < this.end;\n }\n}\n\nconst decoder = new TextDecoder();\n\nfunction value(p: Pbf): Value {\n let v: Value = '';\n while (p.more) {\n const tag = p.varint();\n switch (tag >> 3) {\n case 1:\n v = p.string();\n break;\n case 2:\n v = p.float();\n break;\n case 3:\n v = p.double();\n break;\n case 4:\n v = p.int64();\n break;\n case 5:\n v = p.varint();\n break;\n case 6:\n v = p.sint();\n break;\n case 7:\n v = p.varint() !== 0;\n break;\n default:\n p.skip(tag & 7);\n }\n }\n return v;\n}\n\n/** Point lists of a geometry's commands (MoveTo, LineTo, ClosePath) */\nfunction geometry(p: Pbf): number[][] {\n const out: number[][] = [];\n let current: number[] | undefined;\n let [x, y] = [0, 0];\n while (p.more) {\n const command = p.varint();\n const id = command & 7;\n const count = command >> 3;\n if (id === 7) {\n // ClosePath: back to the first point\n if (current && current.length >= 2) current.push(current[0] ?? 0, current[1] ?? 0);\n continue;\n }\n // A count past the end (a truncated geometry) stops there\n for (let i = 0; i < count && p.more; i += 1) {\n x += p.sint();\n y += p.sint();\n if (id === 1) {\n current = [];\n out.push(current);\n }\n current?.push(x, y);\n }\n }\n return out;\n}\n\n/** Decodes a tile; only the layers in `wanted` (all if undefined) */\nexport function decode(bytes: Uint8Array, wanted?: Set<string>): Map<string, TileLayer> {\n const layers = new Map<string, TileLayer>();\n const tile = new Pbf(bytes);\n while (tile.more) {\n const tag = tile.varint();\n if (tag >> 3 !== 3) {\n tile.skip(tag & 7);\n continue;\n }\n const l = tile.sub();\n let name = '';\n let extent = 4096;\n const keys: string[] = [];\n const values: Value[] = [];\n const raw: Pbf[] = [];\n while (l.more) {\n const t = l.varint();\n switch (t >> 3) {\n case 1:\n name = l.string();\n break;\n case 2:\n raw.push(l.sub());\n break;\n case 3:\n keys.push(l.string());\n break;\n case 4:\n values.push(value(l.sub()));\n break;\n case 5:\n extent = l.varint();\n break;\n default:\n l.skip(t & 7);\n }\n }\n if (wanted && !wanted.has(name)) continue;\n const features: TileFeature[] = [];\n for (const f of raw) {\n let type: 1 | 2 | 3 = 1;\n const properties: Record<string, Value> = {};\n let geom: number[][] = [];\n while (f.more) {\n const t = f.varint();\n switch (t >> 3) {\n case 2: {\n const tags = f.sub();\n while (tags.more) {\n const k = keys[tags.varint()];\n const v = values[tags.varint()];\n if (k !== undefined && v !== undefined) properties[k] = v;\n }\n break;\n }\n case 3:\n type = Math.min(3, Math.max(1, f.varint())) as 1 | 2 | 3;\n break;\n case 4:\n geom = geometry(f.sub());\n break;\n default:\n f.skip(t & 7);\n }\n }\n features.push({ type, properties, geometry: geom });\n }\n layers.set(name, { extent, features });\n }\n return layers;\n}\n"]}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * DOM overlays tied to a position: markers and popups. The map places them all in one pass after each frame it draws
3
+ * (camera moves, finer relief arriving), with a CSS transform from `map.project`: the browser only composites them,
4
+ * nothing is laid out again.
5
+ */
6
+ import type { GeoMap } from './map.ts';
7
+ import type { LonLat, Point } from './types.ts';
8
+ /** Which part of the element sits on the position */
9
+ export type Anchor = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
10
+ export interface MarkerOptions {
11
+ /** The element to show (default: a round pin) */
12
+ element?: HTMLElement;
13
+ /** Which part of the element sits on the position (default 'center' with an element of your own, 'bottom' for the
14
+ * default pin) */
15
+ anchor?: Anchor;
16
+ /** Shift from the anchor, CSS pixels (default [0, 0]) */
17
+ offset?: Point;
18
+ /** The marker can be dragged over the map, on the relief (default false) */
19
+ draggable?: boolean;
20
+ /** Classes added to the element, space separated */
21
+ className?: string;
22
+ }
23
+ export interface MarkerEvent {
24
+ target: Marker;
25
+ lonLat: LonLat;
26
+ }
27
+ export interface MarkerEvents {
28
+ dragstart: MarkerEvent;
29
+ drag: MarkerEvent;
30
+ dragend: MarkerEvent;
31
+ }
32
+ /** An element at a position on the map, optionally draggable */
33
+ export declare class Marker {
34
+ private readonly element;
35
+ private readonly anchor;
36
+ private readonly events;
37
+ private offset;
38
+ private draggable;
39
+ private lonLat;
40
+ private map;
41
+ private popup;
42
+ /** While pressed: the press point and the gap between the pointer and the marker's position */
43
+ private grab;
44
+ private dragging;
45
+ /** The click that ends a drag is not a click on the marker */
46
+ private swallowClick;
47
+ constructor(options?: MarkerOptions);
48
+ getElement(): HTMLElement;
49
+ getLonLat(): LonLat;
50
+ setLonLat(lonLat: LonLat): this;
51
+ setOffset(offset: Point): this;
52
+ setDraggable(draggable: boolean): this;
53
+ isDraggable(): boolean;
54
+ /** A popup that a click on the marker opens and closes, at the marker's position; give it an offset clearing the
55
+ * marker (with the default pin, [0, -34]) */
56
+ setPopup(popup: Popup | undefined): this;
57
+ getPopup(): Popup | undefined;
58
+ /** Opens the marker's popup, or closes it if open */
59
+ togglePopup(): this;
60
+ /** Listens to the drag of the marker; returns the function that stops listening */
61
+ on<K extends keyof MarkerEvents>(type: K, listener: (event: MarkerEvents[K]) => void): () => void;
62
+ addTo(map: GeoMap): this;
63
+ remove(): this;
64
+ private local;
65
+ private down;
66
+ private move;
67
+ private up;
68
+ private click;
69
+ }
70
+ export interface PopupOptions {
71
+ /** A × button in the corner (default true) */
72
+ closeButton?: boolean;
73
+ /** A click on the map elsewhere closes the popup (default true) */
74
+ closeOnClick?: boolean;
75
+ /** CSS max-width of the popup (default '240px') */
76
+ maxWidth?: string;
77
+ /** Classes added to the popup, space separated */
78
+ className?: string;
79
+ /** Which part of the popup sits on the position, its tip there (default 'bottom': the popup is above the point) */
80
+ anchor?: Anchor;
81
+ /** Shift from the anchor, CSS pixels (default [0, 0]) */
82
+ offset?: Point;
83
+ }
84
+ export interface PopupEvents {
85
+ open: {
86
+ target: Popup;
87
+ };
88
+ close: {
89
+ target: Popup;
90
+ };
91
+ }
92
+ /** A box of content at a position, its tip pointing at it */
93
+ export declare class Popup {
94
+ private readonly container;
95
+ private readonly content;
96
+ private readonly closeButton;
97
+ private readonly anchor;
98
+ private readonly closeOnClick;
99
+ private readonly events;
100
+ private offset;
101
+ private lonLat;
102
+ private map;
103
+ private stopListening;
104
+ constructor(options?: PopupOptions);
105
+ getElement(): HTMLElement;
106
+ getLonLat(): LonLat;
107
+ setLonLat(lonLat: LonLat): this;
108
+ setOffset(offset: Point): this;
109
+ /** Content from an HTML string: only for trusted HTML (use `setText` for user or remote data) */
110
+ setHTML(html: string): this;
111
+ setText(text: string): this;
112
+ setDOMContent(node: Node): this;
113
+ isOpen(): boolean;
114
+ /** Listens to the popup opening or closing; returns the function that stops listening */
115
+ on<K extends keyof PopupEvents>(type: K, listener: (event: PopupEvents[K]) => void): () => void;
116
+ addTo(map: GeoMap): this;
117
+ remove(): this;
118
+ }