isard 2.0.0 → 2.1.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 (58) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +1 -1
  3. package/dist/basemap/vectortiles/vectors.d.ts +3 -1
  4. package/dist/basemap/vectortiles/vectors.js +2 -0
  5. package/dist/basemap/vectortiles/vectors.js.map +1 -1
  6. package/dist/basemap/vectortiles.d.ts +1 -3
  7. package/dist/basemap/vectortiles.js +1 -3
  8. package/dist/basemap/vectortiles.js.map +1 -1
  9. package/dist/bind/layers.js +2 -2
  10. package/dist/bind/layers.js.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/isard_webgl2_bg.wasm +0 -0
  14. package/dist/isard_webgpu_bg.wasm +0 -0
  15. package/dist/layers/extrusions.d.ts +6 -1
  16. package/dist/layers/extrusions.js +15 -4
  17. package/dist/layers/extrusions.js.map +1 -1
  18. package/dist/layers/ground.d.ts +1 -1
  19. package/dist/layers/ground.js +1 -1
  20. package/dist/layers/ground.js.map +1 -1
  21. package/dist/layers/layers.js +1 -1
  22. package/dist/layers/layers.js.map +1 -1
  23. package/dist/layers/models.d.ts +7 -1
  24. package/dist/layers/models.js +19 -1
  25. package/dist/layers/models.js.map +1 -1
  26. package/dist/layers/pointclouds.d.ts +2 -2
  27. package/dist/layers/pointclouds.js +3 -3
  28. package/dist/layers/pointclouds.js.map +1 -1
  29. package/dist/layers/raster.js +5 -0
  30. package/dist/layers/raster.js.map +1 -1
  31. package/dist/layers/tiles3d.d.ts +4 -6
  32. package/dist/layers/tiles3d.js +9 -14
  33. package/dist/layers/tiles3d.js.map +1 -1
  34. package/dist/layers/vectors.d.ts +6 -0
  35. package/dist/layers/vectors.js +18 -1
  36. package/dist/layers/vectors.js.map +1 -1
  37. package/dist/map/engine-settings.d.ts +4 -1
  38. package/dist/map/engine-settings.js +13 -2
  39. package/dist/map/engine-settings.js.map +1 -1
  40. package/dist/map/layer-stack.d.ts +5 -6
  41. package/dist/map/layer-stack.js +5 -6
  42. package/dist/map/layer-stack.js.map +1 -1
  43. package/dist/map.d.ts +22 -9
  44. package/dist/map.js +52 -16
  45. package/dist/map.js.map +1 -1
  46. package/dist/react/VectorGeometry.d.ts +4 -1
  47. package/dist/react/VectorGeometry.js +5 -1
  48. package/dist/react/VectorGeometry.js.map +1 -1
  49. package/dist/settings.d.ts +2 -0
  50. package/dist/settings.js +1 -1
  51. package/dist/settings.js.map +1 -1
  52. package/dist/types.d.ts +23 -4
  53. package/dist/types.js.map +1 -1
  54. package/dist/wasm/isard_webgl2.d.ts +21 -7
  55. package/dist/wasm/isard_webgl2.js +42 -21
  56. package/dist/wasm/isard_webgpu.d.ts +21 -7
  57. package/dist/wasm/isard_webgpu.js +42 -21
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAU/B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA8BhD;;mGAEmG;AACnG,MAAM,MAAM,GAAuE;IACjF,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,GAAG,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE;IACnH,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;IACrG,IAAI,EAAE;QACJ,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AAC,CAAC,EAAE,CAAC;KACpF,CAAC;AACJ,CAAC,CAAC;AAEF,oFAAoF;AACpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAsC,EAA4B,EAAE;IACrG,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/B,OAAO,YAAY,CAAC,IAAI,CAAC;QACvB,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,SAAS,CAAC;QACrC,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,IAAI,SAAS,CAAC;QACzC,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,SAAS,CAAC;QACrC,OAAO,CAAC,eAAe,IAAI,GAAG;QAC9B,OAAO,CAAC,eAAe,IAAI,GAAG;QAC9B,OAAO,CAAC,cAAc,IAAI,GAAG;KAC9B,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,mEAAmE;AACnE,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,KAAa,EAAqC,EAAE;IACtE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEvD,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC","sourcesContent":["/**\n * The settings of a map's engine from its options: the body, its halo, its relief, the sky. Kept by the map and\n * replayed on a new engine (after a context loss, or on the engine with 3D Tiles).\n */\nimport {\n BODY_TERRAINS,\n IGN_ATTRIBUTION,\n IMAGE_SERVER,\n imageServerTerrain,\n TERRAIN_TILES,\n TERRAIN_TILES_ATTRIBUTION,\n TERRAIN_URL,\n} from './basemap/basemaps.ts';\nimport type { PngEncoding } from './basemap/terrain.ts';\nimport type {\n AtmosphereOptions,\n BodyOptions,\n CelestialBody,\n LoadingMode,\n TerrainModel,\n TerrainOptions,\n} from './types.ts';\nimport { parseCssColor } from './util/color.ts';\n\n/** Decodes the relief tiles of a URL for the engine: 256 × 256 altitudes, null where there is no tile */\nexport type TerrainLoader = (z: number, x: number, y: number, signal: AbortSignal) => Promise<Float32Array | null>;\n\n/** Settings replayed on a new engine after a WebGL context loss */\nexport interface 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?: TerrainLoader;\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\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 */\nexport const bodySettings = (body: CelestialBody | undefined): Required<BodyOptions> => {\n if (body === undefined || typeof body === 'string') return BODIES[body ?? 'earth'];\n\n const relief: [number, number] = [-0.01 * body.radius, 0.01 * body.radius];\n\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 */\nexport const haloSettings = (atmosphere: boolean | string): Float32Array | undefined => {\n if (atmosphere === true) return EARTH_HALO;\n\n const color = atmosphere === false ? undefined : parseCssColor(atmosphere);\n\n return color && Float32Array.from(color);\n};\n\n/** Relief settings from the option: undefined when off. On the Earth the Terrain Tiles by default (worldwide,\n * Terrarium PNGs decoded by `terrainLoader`) or the IGN terrain model (France, raised by the geoid); NASA's on the Moon\n * and Mars; an ArcGIS image service asked for in the body's Mercator. `terrainLoader`: the loader of PNG tiles in an\n * encoding, the same for the same tiles (the engine keeps its tiles when only the exaggeration changes) */\n/** The relief options of the option on */\nconst terrainOptions = (terrain: true | TerrainModel | TerrainOptions): TerrainOptions => {\n if (typeof terrain === 'string') return { model: terrain };\n\n return terrain === true ? {} : terrain;\n};\n\nexport const terrainSettings = (\n terrain: boolean | TerrainModel | TerrainOptions | undefined,\n body: CelestialBody | undefined,\n radius: number,\n terrainLoader: (url: string, encoding: PngEncoding, floor?: number) => TerrainLoader,\n): Settings['terrain'] => {\n if (!terrain) return undefined;\n\n const options = terrainOptions(terrain);\n const earth = (body ?? 'earth') === 'earth';\n const exaggeration = options.exaggeration ?? 1;\n\n if (options.url === undefined && earth) {\n if (options.model === 'ign') {\n const geoid = options.geoid ?? true;\n\n return { url: TERRAIN_URL, exaggeration, maxZoom: options.maxZoom ?? 15, geoid, attribution: IGN_ATTRIBUTION };\n }\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\n const preset = body === 'moon' || body === 'mars' ? BODY_TERRAINS[body] : undefined;\n const url = options.url ?? preset?.url;\n\n if (url === undefined) throw new Error('isard: the relief of this body needs a url');\n\n const encoding = options.encoding ?? 'float32';\n\n // PNG encodings are fetched tile by tile: a {bbox} or an image service would be fetched as it is\n if (\n encoding !== 'float32' &&\n (IMAGE_SERVER.test(url) || !/\\{z\\}/.test(url) || !/\\{x\\}/.test(url) || !/\\{y\\}/.test(url))\n ) {\n throw new Error(`isard: the '${encoding}' terrain encoding takes a tile URL with {z}, {x} and {y} (${url})`);\n }\n\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 // NASA's credits for its models\n ...(options.url === undefined && preset ? { attribution: preset.attribution } : {}),\n };\n};\n\n/** Sky settings for the engine: colors (RGB 0-1) and blends, MapLibre's defaults */\nexport const atmosphereSettings = (options: AtmosphereOptions | undefined): Float32Array | undefined => {\n if (!options) return undefined;\n\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/** A CSS color to RGB 0-1 (its alpha dropped); black if unknown */\nexport const rgb = (color: string): [r: number, g: number, b: number] => {\n const [r, g, b] = parseCssColor(color) ?? [0, 0, 0, 1];\n\n return [r, g, b];\n};\n"]}
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAU/B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAgChD;;mGAEmG;AACnG,MAAM,MAAM,GAAuE;IACjF,KAAK,E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":["/**\n * The settings of a map's engine from its options: the body, its halo, its relief, the sky. Kept by the map and\n * replayed on a new engine (after a context loss).\n */\nimport {\n BODY_TERRAINS,\n IGN_ATTRIBUTION,\n IMAGE_SERVER,\n imageServerTerrain,\n TERRAIN_TILES,\n TERRAIN_TILES_ATTRIBUTION,\n TERRAIN_URL,\n} from './basemap/basemaps.ts';\nimport type { PngEncoding } from './basemap/terrain.ts';\nimport type {\n AtmosphereOptions,\n BodyOptions,\n CelestialBody,\n LoadingMode,\n TerrainModel,\n TerrainOptions,\n} from './types.ts';\nimport { parseCssColor } from './util/color.ts';\n\n/** Decodes the relief tiles of a URL for the engine: 256 × 256 altitudes, null where there is no tile */\nexport type TerrainLoader = (z: number, x: number, y: number, signal: AbortSignal) => Promise<Float32Array | null>;\n\n/** Settings replayed on a new engine after a WebGL context loss */\nexport interface 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?: TerrainLoader;\n /** Credits of the model */\n attribution?: string;\n }\n | undefined;\n loading: LoadingMode;\n /** The GPU memory budget (bytes) */\n memory: number;\n background: [r: number, g: number, b: number];\n globeColor: [r: number, g: number, b: number];\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 */\nexport const bodySettings = (body: CelestialBody | undefined): Required<BodyOptions> => {\n if (body === undefined || typeof body === 'string') return BODIES[body ?? 'earth'];\n\n const relief: [number, number] = [-0.01 * body.radius, 0.01 * body.radius];\n\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 */\nexport const haloSettings = (atmosphere: boolean | string): Float32Array | undefined => {\n if (atmosphere === true) return EARTH_HALO;\n\n const color = atmosphere === false ? undefined : parseCssColor(atmosphere);\n\n return color && Float32Array.from(color);\n};\n\n/** Relief settings from the option: undefined when off. On the Earth the Terrain Tiles by default (worldwide,\n * Terrarium PNGs decoded by `terrainLoader`) or the IGN terrain model (France, raised by the geoid); NASA's on the Moon\n * and Mars; an ArcGIS image service asked for in the body's Mercator. `terrainLoader`: the loader of PNG tiles in an\n * encoding, the same for the same tiles (the engine keeps its tiles when only the exaggeration changes) */\n/** The relief options of the option on */\nconst terrainOptions = (terrain: true | TerrainModel | TerrainOptions): TerrainOptions => {\n if (typeof terrain === 'string') return { model: terrain };\n\n return terrain === true ? {} : terrain;\n};\n\nexport const terrainSettings = (\n terrain: boolean | TerrainModel | TerrainOptions | undefined,\n body: CelestialBody | undefined,\n radius: number,\n terrainLoader: (url: string, encoding: PngEncoding, floor?: number) => TerrainLoader,\n): Settings['terrain'] => {\n if (!terrain) return undefined;\n\n const options = terrainOptions(terrain);\n const earth = (body ?? 'earth') === 'earth';\n const exaggeration = options.exaggeration ?? 1;\n\n if (options.url === undefined && earth) {\n if (options.model === 'ign') {\n const geoid = options.geoid ?? true;\n\n return { url: TERRAIN_URL, exaggeration, maxZoom: options.maxZoom ?? 15, geoid, attribution: IGN_ATTRIBUTION };\n }\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\n const preset = body === 'moon' || body === 'mars' ? BODY_TERRAINS[body] : undefined;\n const url = options.url ?? preset?.url;\n\n if (url === undefined) throw new Error('isard: the relief of this body needs a url');\n\n const encoding = options.encoding ?? 'float32';\n\n // PNG encodings are fetched tile by tile: a {bbox} or an image service would be fetched as it is\n if (\n encoding !== 'float32' &&\n (IMAGE_SERVER.test(url) || !/\\{z\\}/.test(url) || !/\\{x\\}/.test(url) || !/\\{y\\}/.test(url))\n ) {\n throw new Error(`isard: the '${encoding}' terrain encoding takes a tile URL with {z}, {x} and {y} (${url})`);\n }\n\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 // NASA's credits for its models\n ...(options.url === undefined && preset ? { attribution: preset.attribution } : {}),\n };\n};\n\n/** Sky settings for the engine: colors (RGB 0-1) and blends, MapLibre's defaults */\nexport const atmosphereSettings = (options: AtmosphereOptions | undefined): Float32Array | undefined => {\n if (!options) return undefined;\n\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/** A CSS color to RGB 0-1 (its alpha dropped); black if unknown */\nexport const rgb = (color: string): [r: number, g: number, b: number] => {\n const [r, g, b] = parseCssColor(color) ?? [0, 0, 0, 1];\n\n return [r, g, b];\n};\n"]}
package/dist/types.d.ts CHANGED
@@ -86,6 +86,11 @@ export interface GeoMapOptions extends Partial<Camera> {
86
86
  * pixel, no sun's shadows, the 3D Tiles coarser still; `'auto'` high, a level lower each time the frames stay slow
87
87
  * while the map moves (`'quality'` event) */
88
88
  quality?: Quality | 'auto';
89
+ /** The GPU memory, megabytes, the layers' tiles (3D Tiles, point clouds) and the rasters' tiles may hold all
90
+ * together: past it the tiles drawn least recently are unloaded, whichever their layer (`GeoMap.memory`). `'auto'`
91
+ * (the default): 256 on a touch screen (a phone, a tablet: iOS closes a page past about a gigabyte, the page's
92
+ * workers and vector tiles included), 1024 elsewhere. Set at creation */
93
+ memory?: number | 'auto';
89
94
  /** Multisampled antialiasing of the canvas (default true): the edges of the buildings, 3D Tiles and models smooth.
90
95
  * False draws each pixel once (lines and halos antialias themselves): wide translucent layers, a network's halo over
91
96
  * a region, cost up to four times less on an integrated GPU (MapLibre's default). Set at creation */
@@ -283,6 +288,19 @@ export interface FlyToOptions extends AnimationOptions {
283
288
  * (in the page with `workers: false`).
284
289
  */
285
290
  export type RasterGrid = 'mercator' | 'equirectangular' | TileGrid;
291
+ /** The GPU memory of a map's layers (`GeoMap.memory`), bytes */
292
+ export interface MapMemory {
293
+ /** What they may hold (`GeoMapOptions.memory`) */
294
+ budget: number;
295
+ /** What they hold: the tiles of the 3D Tiles and point clouds, the pools of the rasters' tiles (the relief's
296
+ * included), each one's full from its creation */
297
+ held: number;
298
+ /** Each layer's, bottom first */
299
+ layers: {
300
+ layer: Layer;
301
+ bytes: number;
302
+ }[];
303
+ }
286
304
  /** What `RasterLayer.setStyle` changes */
287
305
  export interface RasterStyle {
288
306
  opacity: number;
@@ -378,11 +396,12 @@ export interface Tiles3dOptions extends Partial<Tiles3dStyle>, Placement {
378
396
  /** The walls of its untextured meshes show windows: glass by day, some lit at night (`setFacades`; default false) */
379
397
  facades?: boolean;
380
398
  /** A raster layer draped on its meshes (`setDrape`): an ortho or a solar potential on the roofs */
381
- drape?: Tiles3dDrape | undefined;
399
+ drape?: Drape | undefined;
382
400
  }
383
- /** A raster layer draped on a 3D Tiles layer's meshes, as Cesium's imagery on 3D Tiles: each point of a face takes the
384
- * raster's color where it stands (its longitude and latitude, whatever its height) */
385
- export interface Tiles3dDrape {
401
+ /** A raster layer draped on a 3D layer's faces (3D Tiles, extrusions, a vector tiles layer's buildings, models), as
402
+ * Cesium's imagery on 3D Tiles: each point of a face takes the raster's color where it stands (its longitude and
403
+ * latitude, whatever its height) */
404
+ export interface Drape {
386
405
  /** The raster layer, on the same map (with `ground: false`, on the 3D layers only) */
387
406
  raster: RasterLayer;
388
407
  /** 'up': the faces looking up, the roofs (default); 'all': the walls too, the raster stretched down them */
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,0CAA0C","sourcesContent":["/** Public types of the `isard` package */\n\nimport type { TileGrid } from './basemap/grid.ts';\nimport type { DecoderUrls } from './decoding/decoders.ts';\nimport type { Feature, Ramp, Size } from './layers/features.ts';\nimport type { Layer } from './layers/layers.ts';\nimport type { RasterLayer } from './layers/raster.ts';\nimport type { QualitySettings } from './map/quality.ts';\nimport type { AttributionOptions } from './ui/controls.ts';\nimport type { Camera, Engine } from './wasm/isard_webgpu.js';\n\nexport type LonLat = [lon: number, lat: number];\nexport type Point = [x: number, y: number];\n\n/**\n * The named basemaps. OpenFreeMap's vector styles, OpenStreetMap data worldwide, their labels above the other layers:\n * `osm-positron` (light grey, quiet: data over it reads first), `osm-liberty` and `osm-bright` (in colour), `osm-dark`\n * (near black: bright data over it, a wind's particles, lights). The\n * Géoplateforme's (IGN, France): rasters (`ign-plan`, `ign-plan-grey`, `ign-ortho`, the aerial photographs) or vector\n * tiles with their labels (`ign-plan-vector`, `ign-plan-grey-vector`, the PLAN.IGN styles).\n */\nexport type BasemapName =\n | 'osm-positron'\n | 'osm-liberty'\n | 'osm-bright'\n | 'osm-dark'\n | 'ign-plan'\n | 'ign-plan-grey'\n | 'ign-ortho'\n | 'ign-plan-vector'\n | 'ign-plan-grey-vector'\n | 'none';\n\n/** A basemap by name (see `BasemapName`) */\nexport type Basemap = BasemapName;\n\n/**\n * The Earth's named terrain models. `'terrain-tiles'`: worldwide, the Terrain Tiles of AWS's open data registry\n * (SRTM, EU-DEM, GMTED… merged by Mapzen, 30 m in most places), the sea floor flattened at sea level. `'ign'`: France,\n * the IGN's RGE ALTI from the Géoplateforme (1 to 5 m), raised by the RAF20 geoid to heights above the ellipsoid.\n */\nexport type TerrainModel = 'terrain-tiles' | 'ign';\n\n/** How tiles encode their altitudes: `'float32'`, raw little-endian floats (`image/x-bil;bits=32`, an ArcGIS raw\n * grid); `'terrarium'`, the colors of a PNG, `R × 256 + G + B / 256 - 32768`; `'mapbox'`, those of Terrain-RGB,\n * `(R × 65536 + G × 256 + B) / 10 - 10000` */\nexport type TerrainEncoding = 'float32' | 'terrarium' | 'mapbox';\n\n/**\n * How tiles load and show. 'immediate' (default): everything visible loads, tiles show as soon as they arrive.\n * 'smooth': during flights the levels flown through are skipped, off-center tiles wait while the camera moves, tiles\n * fade in; fewer downloads, for slow networks or GPUs.\n */\nexport type LoadingMode = 'immediate' | 'smooth';\n\n/** 'globe': a sphere at low zoom, blending into Web Mercator between zooms 5 and 7, up to three levels later under a\n * tilted camera (it sees much farther than its center: the horizon stays curved) */\nexport type Projection = 'globe' | 'mercator';\n\n/** A body to draw the map on, other than the named ones (`CelestialBody`) */\nexport interface BodyOptions {\n /** Equatorial radius, metres */\n radius: number;\n /** Flattening of its ellipsoid, 0 for a sphere (default 0) */\n flattening?: number;\n /** An atmosphere: its halo around the globe, true for the Earth's light blue, or a CSS color (its alpha the\n * halo's strength) (default false) */\n atmosphere?: boolean | string;\n /** Color of the globe where no tile covers it (past the Web Mercator latitudes, 85°), a CSS color (default\n * `#808080`) */\n color?: string;\n /** Lowest and highest altitudes of its ground, metres around the ellipsoid: what its relief may raise into view\n * (default ±1 % of the radius) */\n relief?: [lowest: number, highest: number];\n}\n\n/**\n * The body the map is drawn on: 'earth' (WGS 84, the default), 'moon' (a sphere of 1 737 400 m, no atmosphere),\n * 'mars' (a sphere of 3 396 190 m, its equatorial radius, a thin dusty halo; planetocentric latitudes) or another\n * one. Zoom levels keep their meaning on screen (the Web Mercator tile pyramid), their metres follow the body:\n * altitudes, relief, buildings, 3D Tiles. Off the Earth, the map has none of the Earth's defaults: no basemap, no\n * credits, and space for its background; the Moon and Mars have NASA's relief for `terrain: true`.\n */\nexport type CelestialBody = 'earth' | 'moon' | 'mars' | BodyOptions;\n\n/** A level of the map's quality (`GeoMapOptions.quality`) */\nexport type Quality = 'high' | 'medium' | 'low';\n\nexport interface GeoMapOptions extends Partial<Camera> {\n /** The body the map is drawn on (default 'earth'); set at creation */\n body?: CelestialBody;\n /** Default 'globe' */\n projection?: Projection;\n /** Default 'immediate' */\n loading?: LoadingMode;\n /** The basemap (default 'osm-positron'; 'none' off the Earth) */\n basemap?: Basemap;\n /** Opacity of the IGN hillshade over the basemap (France, Géoplateforme), 0 for none (default 0) */\n hillshade?: number;\n /** Color behind the map (sky of tilted flat views), a CSS color (default `#f2f2f0`; black off the Earth) */\n background?: string;\n /** Space behind the globe: stars and atmosphere halo, fading out as the globe turns flat (default true) */\n sky?: boolean;\n /** The sun casting the shadows of buildings, trees, models and the relief (`setSun`); none by default */\n sun?: SunOptions;\n /** What the map draws less of on a device that cannot keep up (`setQuality`): `'high'` (the default) all of it;\n * `'medium'` at most 1.5 device pixels a CSS pixel, the 3D Tiles coarser far away; `'low'` one device pixel a CSS\n * pixel, no sun's shadows, the 3D Tiles coarser still; `'auto'` high, a level lower each time the frames stay slow\n * while the map moves (`'quality'` event) */\n quality?: Quality | 'auto';\n /** Multisampled antialiasing of the canvas (default true): the edges of the buildings, 3D Tiles and models smooth.\n * False draws each pixel once (lines and halos antialias themselves): wide translucent layers, a network's halo over\n * a region, cost up to four times less on an integrated GPU (MapLibre's default). Set at creation */\n antialias?: boolean;\n /** The engine on wgpu (#146): 'auto' (default) WebGPU where the browser gives an adapter, else wgpu's WebGL2 fallback;\n * 'webgpu' or 'webgl' forces one */\n renderer?: 'auto' | 'webgpu' | 'webgl2';\n /** Relief under the basemap: true for the body's terrain model (on the Earth the worldwide Terrain Tiles; NASA's on\n * the Moon and Mars: LOLA, MOLA), one of the Earth's models by name (`'ign'`: France, RGE ALTI), or its options\n * (default false; on another body, its `url` is required). Network layers are draped on it */\n terrain?: boolean | TerrainModel | TerrainOptions;\n minZoom?: number;\n maxZoom?: number;\n /** Highest pitch, degrees, up to 85 (default 70) */\n maxPitch?: number;\n /** Sky over the plane, seen when the camera is tilted towards the horizon, and the fog the ground fades into\n * (MapLibre's `setSky`); default none: the background color */\n atmosphere?: AtmosphereOptions;\n /** Mouse, touch and keyboard controls (default true) */\n interactive?: boolean;\n /** Keyboard controls once the map has the focus (it is reached with Tab): arrows pan, Shift + arrows rotate and\n * tilt, + and - zoom (Shift: two levels), 0 faces north and levels the view (default true; none when not\n * `interactive`) */\n keyboard?: boolean;\n /** Accessible name of the map, read by screen readers (default 'Map') */\n ariaLabel?: string;\n /** A preset of map options (`IGN_PRESETS`: `'ign'`, `'ign-3d'`, `'ign-ortho-3d'`), the other options over it */\n preset?: 'ign' | 'ign-3d' | 'ign-ortho-3d';\n /** The folder isard's files are served from (its engines, `isard_webgpu_bg.wasm`, `isard_webgl2_bg.wasm`, its\n * modules, `isard_points_bg.wasm`, `isard_tiles3d_bg.wasm`, `isard_tess_bg.wasm`, `isard_grid_bg.wasm`, and its\n * workers, `decoder.worker.js`, `basemap.worker.js`): one option for a bundler that moves them, the `…Url` options\n * below for each one. `isard/vite` sets it for the whole page; default next to the module */\n assetsUrl?: string | URL;\n /** Where to load the engine on WebGPU from (`isard_webgpu_bg.wasm`), when a bundler does not resolve the default URL */\n webgpuWasmUrl?: string | URL;\n /** Where to load the engine's WebGL2 fallback from (`isard_webgl2_bg.wasm`, for a browser without WebGPU), when a\n * bundler does not resolve the default URL */\n webgl2WasmUrl?: string | URL;\n /** Where the decoding workers load the point cloud module from (`isard_points_bg.wasm`, the LAZ decoder of COPC),\n * when a bundler does not resolve the default URL. Loaded with the first point cloud only */\n pointsWasmUrl?: string | URL;\n /** Where the decoding workers load the 3D Tiles module from (`isard_tiles3d_bg.wasm`: a tile's content decoded for\n * the GPU), when a bundler does not resolve the default URL. Loaded with the first tile */\n tiles3dWasmUrl?: string | URL;\n /** Where the basemap workers load the tessellation module from (`isard_tess_bg.wasm`: the vector tiles drawn as\n * geometry, `vectorTiles().vectors()`, made ready for the GPU off the main thread), when a bundler does not resolve\n * the default URL. Loaded with the first tile of geometry; without it, the main thread does that work */\n tessWasmUrl?: string | URL;\n /** Where the workers load the grid module from (`isard_grid_bg.wasm`: GRIB2 and NetCDF files read by\n * `map.readGrids`), when a bundler does not resolve the default URL. Loaded with the first file */\n gridWasmUrl?: string | URL;\n /** Where to load the vector basemap worker from, when a bundler does not resolve the default URL */\n basemapWorkerUrl?: string | URL;\n /** Texture size of the vector basemap's tiles, pixels (default 512: lines and edges sharp at every zoom on a screen\n * of pixel ratio 1). 256: a quarter of the drawing in the workers, of the uploads and of the GPU memory, for lines\n * and edges a little softer between two zoom levels (the tiles are shown 181 to 362 CSS pixels wide) */\n basemapTileSize?: number;\n /** Glyphs of the symbol layers: a URL with `{fontstack}` and `{range}` (MapLibre's glyph format; default\n * OpenFreeMap's fonts, Noto Sans). A vector basemap's labels take the glyphs of its style */\n glyphs?: string;\n /** Workers decoding 3D Tiles off the main thread: a count, or false to decode on the main thread (default: cores - 1,\n * 1 to 4). False (or 0) also decodes the PNG relief and reprojects the equirectangular rasters on the main thread,\n * else done by the vector basemap's workers */\n workers?: number | false;\n /** Where to load the decoding worker from, when a bundler does not resolve the default URL */\n workerUrl?: string | URL;\n /** Folders of the Draco and Basis Universal decoders, loaded by the workers on first use (default: the official\n * builds on gstatic.com and jsDelivr; self-host them for offline or locked-down networks). They run through\n * `new Function`: a Content Security Policy needs `'unsafe-eval'` (see `DecoderUrls`) */\n decoders?: Partial<DecoderUrls>;\n /** Credits at the bottom right: false for none, or its options (default true: the credits of the basemap,\n * hillshade and relief in use, compact on maps narrower than 640 px) */\n attributionControl?: boolean | AttributionOptions;\n}\n\nexport interface TerrainOptions {\n /** One of the Earth's named models (default `'terrain-tiles'` on the Earth); unused with a `url` */\n model?: TerrainModel;\n /** Altitudes of 256 × 256 tiles in `encoding`: a WMS GetMap URL with {bbox} (EPSG:3857 on the Earth, the body's\n * Mercator metres elsewhere: the sphere of its radius), a tile URL with {z}, {x} and {y}, or an ArcGIS image service\n * (a URL ending in `/ImageServer`), asked for raw altitudes in the body's Mercator (default: the `model`'s; on the\n * Moon and Mars, NASA's Trek LOLA and MOLA models) */\n url?: string;\n /** How the tiles of `url` encode their altitudes (default `'float32'`); `'terrarium'` and `'mapbox'` take a URL with\n * {z}, {x} and {y} */\n encoding?: TerrainEncoding;\n /** Vertical exaggeration, 1 for the true relief (default 1) */\n exaggeration?: number;\n /** Finest level of the relief, up to 15 (default 15; 14 for the Terrain Tiles, 8 for the Moon's and Mars's models). It\n * starts at level 6 on the Earth, coarser on bodies of a larger relief for their size (3 on the Moon and Mars) */\n maxZoom?: number;\n /** Altitudes over mainland France raised by the height of the RAF20 geoid (the French one, 0 away from France), to\n * heights above the ellipsoid (those of 3D Tiles); false keeps the altitudes as served (NGF-IGN69 for the IGN's)\n * (default true for the `'ign'` model, false otherwise) */\n geoid?: boolean;\n}\n\n/** Sky, horizon and fog over the plane, with the names and meanings of MapLibre's `setSky` */\nexport interface AtmosphereOptions {\n /** A CSS color (default `#9cc7ec`) */\n skyColor?: string;\n /** (default `#e8f1f8`) */\n horizonColor?: string;\n /** (default `#f2f5f8`) */\n fogColor?: string;\n /** Blend from the horizon to the sky color, share of the field of view above the horizon, 0-1 (default 0.6) */\n skyHorizonBlend?: number;\n /** Blend from the horizon to the fog color below the horizon, 0-1 (default 0.7) */\n horizonFogBlend?: number;\n /** Share of the distance to the far plane over which the ground fades into the fog, 0-1 (default 0.4) */\n fogGroundBlend?: number;\n}\n\n/** The sun casting shadows (`GeoMap.setSun`): where it stands, by date or by hand, and how dark its shadows are */\nexport interface SunOptions {\n /** The time: the sun where it stands then over the map's center (default now, unless `azimuth` and `altitude`) */\n date?: Date;\n /** Degrees clockwise from north, with `altitude`: the sun placed by hand */\n azimuth?: number;\n /** Degrees above the horizon; at or under it, no shadows */\n altitude?: number;\n /** How dark the shadows are, 0 to 1 (default 0.35) */\n opacity?: number;\n /** How dark the night is, 0 to 1: the scene tinted in its blue, the windows of the buildings and the streets of\n * `vectors()` lit, the labels light on dark. By default from the sun's altitude: falling from 6° above the horizon\n * to 6° under it */\n night?: number;\n}\n\n/** What can be seen from a point (`GeoMap.setViewshed`); with several observers, the colors, the opacity and the\n * cone's color are the first one's */\nexport interface ViewshedOptions {\n /** The observer */\n position: LonLat;\n /** Metres above the ground (default 1.7, eye level) */\n height?: number;\n /** Metres around the observer that are tinted (default 1000) */\n range?: number;\n /** A CSS color for what is seen (default `#2f9e44`) */\n visibleColor?: string;\n /** A CSS color for what is hidden (default `#e03131`) */\n hiddenColor?: string;\n /** How strongly the colors tint the scene, multiplied into it so that its textures and shading stay, 0-1 (default\n * 0.7) */\n opacity?: number;\n /** A CSS color for the cone drawn in 3D (one way only): its fan through the axis, at the eye's height and tilted\n * with it, from the eye to the range; solid where nothing hides it, faint behind the scene; none by default */\n coneColor?: string;\n /** To look one way only (a camera, a lookout), degrees clockwise from north; all around without it */\n direction?: number;\n /** Degrees above the horizon the cone looks, negative below (default 0) */\n tilt?: number;\n /** Angle of view across, degrees (default 60) */\n fov?: number;\n /** Angle of view up and down, degrees (default 40) */\n verticalFov?: number;\n}\n\n/** An eye at street level (`GeoMap.setFirstPerson`) */\nexport interface FirstPersonView {\n /** Where it stands */\n lonLat: LonLat;\n /** Metres above the ground (default 1.7) */\n height?: number;\n /** Degrees clockwise from north it looks to */\n bearing: number;\n /** Degrees from straight down: 90 level (the default), 180 straight up */\n pitch?: number;\n /** Vertical field of view, degrees (default 75) */\n fov?: number;\n}\n\n/** Layers shown on one side of a vertical line only (`GeoMap.setSwipe`) */\nexport interface SwipeOptions {\n /** CSS pixels from the left of the map */\n position: number;\n layers: readonly Layer[];\n /** The side they show on (default 'left') */\n side?: 'left' | 'right';\n /** Layers shown on the other side only: two meshes of the same place, each on its side, never drawn over each other */\n other?: readonly Layer[];\n}\n\n/** Animation of a camera move */\nexport interface AnimationOptions {\n /** Milliseconds */\n duration?: number;\n /** Progress over time, both 0 to 1 */\n easing?: (t: number) => number;\n}\n\nexport interface FlyToOptions extends AnimationOptions {\n /** How far the flight zooms out on its way, as MapLibre's `curve` (default 1.42) */\n curve?: number;\n /** Average speed in screens per second when `duration` is not given (default 1.2) */\n speed?: number;\n}\n\n/**\n * Tile grid of a raster's URL. 'mercator': Web Mercator (XYZ, WMTS PM), the engine's own. 'equirectangular':\n * longitudes and latitudes (Plate Carrée, EPSG:4326-like), two 256 px tiles side by side at level 0, rows from the\n * north (NASA's Trek WMTS, WorldCRS84Quad). A `TileGrid`: the tile matrices of a WMTS in any CRS (Lambert-93…), or a\n * WMS asked for each tile's box in its CRS. The last two are reprojected into Web Mercator tiles by the map's workers\n * (in the page with `workers: false`).\n */\nexport type RasterGrid = 'mercator' | 'equirectangular' | TileGrid;\n\n/** What `RasterLayer.setStyle` changes */\nexport interface RasterStyle {\n opacity: number;\n /** 0 = greyscale, 1 = original colors */\n saturation: number;\n}\n\n/** Where a new layer goes: under `before`, or on top of the others (under the labels kept on top) */\nexport interface Placement {\n before?: Layer;\n}\n\nexport interface RasterOptions extends Placement {\n /** Tile URL with {z}, {x} and {y} (256 px tiles); unused with a `loader` */\n url: string;\n /** Tile grid of `url` (default 'mercator'); with 'equirectangular', `minZoom` and `maxZoom` are levels of that\n * grid; with a `TileGrid`, they are map zooms, by default those its matrices span */\n grid?: RasterGrid;\n minZoom?: number;\n maxZoom?: number;\n opacity?: number;\n /** 0 = greyscale, 1 = original colors */\n saturation?: number;\n /** Side of the tiles' textures, pixels (default 256): more for sharper tiles drawn by a `loader` */\n size?: number;\n /** Draws each tile instead of fetching `url`: an image of `size` × `size`, null for nothing there; a rejection is\n * retried like a network error */\n loader?: (z: number, x: number, y: number, signal: AbortSignal) => Promise<ImageBitmap | null>;\n /** Credits of the tiles, HTML: shown by the attribution control while the layer is on the map */\n attribution?: string;\n /** Drawn on the ground (default true); false: only on the 3D layers it is draped on (`Tiles3dOptions.drape`), its\n * tiles still loaded as the ground's would be: a solar potential on the roofs only */\n ground?: boolean;\n}\n\nexport interface NetworkStyle {\n /** Line width, CSS pixels, or zoom stops `[[zoom, width], …]` (default 2) */\n width: Size;\n /** Values above are drawn as unreached (default 1800) */\n max: number;\n /** Darker line every `contour` value units, 0 for none (default 0) */\n contour: number;\n opacity: number;\n /** Width of the halo drawn under the lines, CSS pixels or zoom stops, 0 for none (default 0): wide and faint, the\n * reached streets add up into a heat map that fills the blocks */\n halo: Size;\n /** Opacity of the halo at the middle of a line, fading quadratically to its sides (default 0.11) */\n haloOpacity: number;\n /** Colors from 0 to `max`: `[[fraction of max, color], …]` (default green to red) */\n ramp: Ramp | undefined;\n /** Color of the parts beyond `max` or unreached (default `rgba(140, 140, 140, 0.25)`) */\n unreachedColor: string;\n /** Share of `max` over which the colors fade out before it, 0 to 1 (default 0) */\n fade: number;\n}\n\nexport interface NetworkOptions extends Partial<NetworkStyle>, Placement {\n /** Node coordinates in degrees: lon0, lat0, lon1, lat1… */\n nodes: Float64Array;\n /** Edges as node index pairs: a0, b0, a1, b1… */\n edges: Uint32Array;\n /** Line of each edge, from A to B: the points of edge e are `points[start[e] .. start[e + 1]]` (lon, lat pairs,\n * counted in points); with fewer than two points an edge is straight. Default: all straight. */\n lines?: { start: Uint32Array; points: Float64Array };\n /** Per edge, the cost of travelling it from A to B then from B to A, in value units (Infinity: closed that way;\n * closed both ways: not drawn). A point along an edge then takes the quickest way there, min(value(A) + cost from\n * A, value(B) + cost from B), as a travel time does. Without costs, values are interpolated along the edges. */\n costs?: Float32Array;\n /** Width factor of each edge (default 1): rail lines wider than streets */\n edgeWidths?: Float32Array;\n}\n\nexport interface Tiles3dStyle {\n /** Screen-space error (CSS pixels) above which a tile is refined: 16 by default, lower is finer and heavier */\n maxScreenSpaceError: number;\n opacity: number;\n /** Size of the points of point cloud tiles (`.pnts`, glTF points), CSS pixels: 2 by default */\n pointSize?: number;\n /** A CSS color multiplying the textures of the meshes, the color of the untextured ones (buildings without\n * textures are light grey without it); none by default */\n color?: string;\n /** Each feature's color from its properties (a building's height, its use: a thematic map), in place of `color`: a\n * CSS color, or undefined for the layer's. Asked once for each feature of a tile, when the tile is first drawn, and\n * again for every tile when it changes (in React, keep the same function from one render to the next) */\n featureColor?: FeatureColor | undefined;\n}\n\n/** A feature's color from its properties and its index in its tile (`Tiles3dStyle.featureColor`) */\nexport type FeatureColor = (properties: Record<string, unknown>, feature: number) => string | undefined;\n\nexport interface Tiles3dOptions extends Partial<Tiles3dStyle>, Placement {\n /** URL of a `tileset.json` (3D Tiles 1.0 b3dm and pnts, 1.1 glb meshes and points, external tilesets) */\n url: string;\n /** Its heights are altitudes above the geoid (NGF-IGN69), as the IGN's Bâtiments 3D, rather than above the\n * ellipsoid (3D Tiles as specified): each tile raised by the RAF20 geoid, onto the IGN relief (default false) */\n geoid?: boolean;\n /** The walls of its untextured meshes show windows: glass by day, some lit at night (`setFacades`; default false) */\n facades?: boolean;\n /** A raster layer draped on its meshes (`setDrape`): an ortho or a solar potential on the roofs */\n drape?: Tiles3dDrape | undefined;\n}\n\n/** A raster layer draped on a 3D Tiles layer's meshes, as Cesium's imagery on 3D Tiles: each point of a face takes the\n * raster's color where it stands (its longitude and latitude, whatever its height) */\nexport interface Tiles3dDrape {\n /** The raster layer, on the same map (with `ground: false`, on the 3D layers only) */\n raster: RasterLayer;\n /** 'up': the faces looking up, the roofs (default); 'all': the walls too, the raster stretched down them */\n faces?: 'up' | 'all';\n /** 0 to 1 (default 1), times the raster layer's opacity */\n opacity?: number;\n}\n\nexport interface MapPointerEvent {\n point: Point;\n /** Undefined above the horizon */\n lonLat: LonLat | undefined;\n}\n\n/** What 'hoverfeature' found under the pointer */\nexport interface MapHoverFeatureEvent extends MapPointerEvent {\n /** The feature under the pointer (see `GeoMap.pickFeature`), undefined if none */\n hit: FeatureHit | undefined;\n}\n\n/** The GPU time of a frame (`GeoMap.gpuTimings`), in all and by part (ms) */\nexport interface MapGpuTimings {\n /** The frame's number */\n frame: number;\n ms: number;\n /** The backdrop (sky, globe), the ground (the raster layers over the relief), each layer (with its handle), the\n * shadows, the panorama, the viewshed */\n parts: { part: 'backdrop' | 'ground' | 'layer' | 'shadows' | 'panorama' | 'viewshed'; layer?: Layer; ms: number }[];\n}\n\n/** What a pick looks at: within `radius` CSS pixels of the point (default 0), among `layers` (default every layer;\n * the others hide nothing) */\nexport interface PickOptions {\n radius?: number;\n layers?: readonly Layer[];\n}\n\n/** A picked feature: its layer handle, its index there and, for line, circle, fill, extrusion, point cloud and 3D\n * Tiles layers, the feature itself (a building of 3D Tiles with its properties) */\nexport interface FeatureHit {\n layer: Layer;\n index: number;\n feature: Feature | undefined;\n}\n\nexport interface MapEvents {\n /** The camera started moving (a gesture, an animation or `setCamera`) */\n movestart: Camera;\n /** The camera moved */\n move: Camera;\n /** The camera stopped: no gesture held, no animation running */\n moveend: Camera;\n /** The map changed size (CSS pixels) */\n resize: { width: number; height: number };\n /** The pointer moved over the map (at most once per frame, not while dragging) */\n hover: MapPointerEvent;\n /** What is under the pointer, picked without stalling the GPU: a frame or two after 'hover', only while listened to\n * (radius and layers in `GeoMap.hoverPicking`) */\n hoverfeature: MapHoverFeatureEvent;\n /** Click without drag */\n click: MapPointerEvent;\n /** A frame was drawn; duration of the engine call in milliseconds */\n render: { ms: number };\n /** The map's quality changed, by `setQuality` or stepped down by `'auto'` */\n quality: { quality: Quality };\n /** Everything in view is loaded and drawn, nothing moves: the end of a load, once after each change (as MapLibre's\n * `idle`). Tiles requested by the first frame count, so it never fires before they arrive. */\n idle: Record<string, never>;\n /** The pointer left the canvas (a mouse going out of the map, or onto a control or marker) */\n leave: Record<string, never>;\n}\n\n/** What a layer handle needs from its map */\nexport interface LayerHost {\n readonly engine: Engine;\n requestRender(): void;\n /** Forgets a removed layer */\n detach(layer: Layer): void;\n /** Moves a layer under `before`, or on top */\n moveLayer(layer: Layer, before: Layer | undefined): void;\n /** A layer created again in the engine (new id): put at the place of its old id, which is removed */\n replaceLayer(layer: Layer, old: number): void;\n /** Resolves once the map is idle (everything in view loaded and drawn) */\n whenIdle(): Promise<void>;\n /** Work the map waits on before it is idle (`GeoMap.track`) */\n track<T>(work: Promise<T>): Promise<T>;\n /** What its quality draws (`GeoMap.setQuality`) */\n readonly quality: QualitySettings;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,0CAA0C","sourcesContent":["/** Public types of the `isard` package */\n\nimport type { TileGrid } from './basemap/grid.ts';\nimport type { DecoderUrls } from './decoding/decoders.ts';\nimport type { Feature, Ramp, Size } from './layers/features.ts';\nimport type { Layer } from './layers/layers.ts';\nimport type { RasterLayer } from './layers/raster.ts';\nimport type { QualitySettings } from './map/quality.ts';\nimport type { AttributionOptions } from './ui/controls.ts';\nimport type { Camera, Engine } from './wasm/isard_webgpu.js';\n\nexport type LonLat = [lon: number, lat: number];\nexport type Point = [x: number, y: number];\n\n/**\n * The named basemaps. OpenFreeMap's vector styles, OpenStreetMap data worldwide, their labels above the other layers:\n * `osm-positron` (light grey, quiet: data over it reads first), `osm-liberty` and `osm-bright` (in colour), `osm-dark`\n * (near black: bright data over it, a wind's particles, lights). The\n * Géoplateforme's (IGN, France): rasters (`ign-plan`, `ign-plan-grey`, `ign-ortho`, the aerial photographs) or vector\n * tiles with their labels (`ign-plan-vector`, `ign-plan-grey-vector`, the PLAN.IGN styles).\n */\nexport type BasemapName =\n | 'osm-positron'\n | 'osm-liberty'\n | 'osm-bright'\n | 'osm-dark'\n | 'ign-plan'\n | 'ign-plan-grey'\n | 'ign-ortho'\n | 'ign-plan-vector'\n | 'ign-plan-grey-vector'\n | 'none';\n\n/** A basemap by name (see `BasemapName`) */\nexport type Basemap = BasemapName;\n\n/**\n * The Earth's named terrain models. `'terrain-tiles'`: worldwide, the Terrain Tiles of AWS's open data registry\n * (SRTM, EU-DEM, GMTED… merged by Mapzen, 30 m in most places), the sea floor flattened at sea level. `'ign'`: France,\n * the IGN's RGE ALTI from the Géoplateforme (1 to 5 m), raised by the RAF20 geoid to heights above the ellipsoid.\n */\nexport type TerrainModel = 'terrain-tiles' | 'ign';\n\n/** How tiles encode their altitudes: `'float32'`, raw little-endian floats (`image/x-bil;bits=32`, an ArcGIS raw\n * grid); `'terrarium'`, the colors of a PNG, `R × 256 + G + B / 256 - 32768`; `'mapbox'`, those of Terrain-RGB,\n * `(R × 65536 + G × 256 + B) / 10 - 10000` */\nexport type TerrainEncoding = 'float32' | 'terrarium' | 'mapbox';\n\n/**\n * How tiles load and show. 'immediate' (default): everything visible loads, tiles show as soon as they arrive.\n * 'smooth': during flights the levels flown through are skipped, off-center tiles wait while the camera moves, tiles\n * fade in; fewer downloads, for slow networks or GPUs.\n */\nexport type LoadingMode = 'immediate' | 'smooth';\n\n/** 'globe': a sphere at low zoom, blending into Web Mercator between zooms 5 and 7, up to three levels later under a\n * tilted camera (it sees much farther than its center: the horizon stays curved) */\nexport type Projection = 'globe' | 'mercator';\n\n/** A body to draw the map on, other than the named ones (`CelestialBody`) */\nexport interface BodyOptions {\n /** Equatorial radius, metres */\n radius: number;\n /** Flattening of its ellipsoid, 0 for a sphere (default 0) */\n flattening?: number;\n /** An atmosphere: its halo around the globe, true for the Earth's light blue, or a CSS color (its alpha the\n * halo's strength) (default false) */\n atmosphere?: boolean | string;\n /** Color of the globe where no tile covers it (past the Web Mercator latitudes, 85°), a CSS color (default\n * `#808080`) */\n color?: string;\n /** Lowest and highest altitudes of its ground, metres around the ellipsoid: what its relief may raise into view\n * (default ±1 % of the radius) */\n relief?: [lowest: number, highest: number];\n}\n\n/**\n * The body the map is drawn on: 'earth' (WGS 84, the default), 'moon' (a sphere of 1 737 400 m, no atmosphere),\n * 'mars' (a sphere of 3 396 190 m, its equatorial radius, a thin dusty halo; planetocentric latitudes) or another\n * one. Zoom levels keep their meaning on screen (the Web Mercator tile pyramid), their metres follow the body:\n * altitudes, relief, buildings, 3D Tiles. Off the Earth, the map has none of the Earth's defaults: no basemap, no\n * credits, and space for its background; the Moon and Mars have NASA's relief for `terrain: true`.\n */\nexport type CelestialBody = 'earth' | 'moon' | 'mars' | BodyOptions;\n\n/** A level of the map's quality (`GeoMapOptions.quality`) */\nexport type Quality = 'high' | 'medium' | 'low';\n\nexport interface GeoMapOptions extends Partial<Camera> {\n /** The body the map is drawn on (default 'earth'); set at creation */\n body?: CelestialBody;\n /** Default 'globe' */\n projection?: Projection;\n /** Default 'immediate' */\n loading?: LoadingMode;\n /** The basemap (default 'osm-positron'; 'none' off the Earth) */\n basemap?: Basemap;\n /** Opacity of the IGN hillshade over the basemap (France, Géoplateforme), 0 for none (default 0) */\n hillshade?: number;\n /** Color behind the map (sky of tilted flat views), a CSS color (default `#f2f2f0`; black off the Earth) */\n background?: string;\n /** Space behind the globe: stars and atmosphere halo, fading out as the globe turns flat (default true) */\n sky?: boolean;\n /** The sun casting the shadows of buildings, trees, models and the relief (`setSun`); none by default */\n sun?: SunOptions;\n /** What the map draws less of on a device that cannot keep up (`setQuality`): `'high'` (the default) all of it;\n * `'medium'` at most 1.5 device pixels a CSS pixel, the 3D Tiles coarser far away; `'low'` one device pixel a CSS\n * pixel, no sun's shadows, the 3D Tiles coarser still; `'auto'` high, a level lower each time the frames stay slow\n * while the map moves (`'quality'` event) */\n quality?: Quality | 'auto';\n /** The GPU memory, megabytes, the layers' tiles (3D Tiles, point clouds) and the rasters' tiles may hold all\n * together: past it the tiles drawn least recently are unloaded, whichever their layer (`GeoMap.memory`). `'auto'`\n * (the default): 256 on a touch screen (a phone, a tablet: iOS closes a page past about a gigabyte, the page's\n * workers and vector tiles included), 1024 elsewhere. Set at creation */\n memory?: number | 'auto';\n /** Multisampled antialiasing of the canvas (default true): the edges of the buildings, 3D Tiles and models smooth.\n * False draws each pixel once (lines and halos antialias themselves): wide translucent layers, a network's halo over\n * a region, cost up to four times less on an integrated GPU (MapLibre's default). Set at creation */\n antialias?: boolean;\n /** The engine on wgpu (#146): 'auto' (default) WebGPU where the browser gives an adapter, else wgpu's WebGL2 fallback;\n * 'webgpu' or 'webgl' forces one */\n renderer?: 'auto' | 'webgpu' | 'webgl2';\n /** Relief under the basemap: true for the body's terrain model (on the Earth the worldwide Terrain Tiles; NASA's on\n * the Moon and Mars: LOLA, MOLA), one of the Earth's models by name (`'ign'`: France, RGE ALTI), or its options\n * (default false; on another body, its `url` is required). Network layers are draped on it */\n terrain?: boolean | TerrainModel | TerrainOptions;\n minZoom?: number;\n maxZoom?: number;\n /** Highest pitch, degrees, up to 85 (default 70) */\n maxPitch?: number;\n /** Sky over the plane, seen when the camera is tilted towards the horizon, and the fog the ground fades into\n * (MapLibre's `setSky`); default none: the background color */\n atmosphere?: AtmosphereOptions;\n /** Mouse, touch and keyboard controls (default true) */\n interactive?: boolean;\n /** Keyboard controls once the map has the focus (it is reached with Tab): arrows pan, Shift + arrows rotate and\n * tilt, + and - zoom (Shift: two levels), 0 faces north and levels the view (default true; none when not\n * `interactive`) */\n keyboard?: boolean;\n /** Accessible name of the map, read by screen readers (default 'Map') */\n ariaLabel?: string;\n /** A preset of map options (`IGN_PRESETS`: `'ign'`, `'ign-3d'`, `'ign-ortho-3d'`), the other options over it */\n preset?: 'ign' | 'ign-3d' | 'ign-ortho-3d';\n /** The folder isard's files are served from (its engines, `isard_webgpu_bg.wasm`, `isard_webgl2_bg.wasm`, its\n * modules, `isard_points_bg.wasm`, `isard_tiles3d_bg.wasm`, `isard_tess_bg.wasm`, `isard_grid_bg.wasm`, and its\n * workers, `decoder.worker.js`, `basemap.worker.js`): one option for a bundler that moves them, the `…Url` options\n * below for each one. `isard/vite` sets it for the whole page; default next to the module */\n assetsUrl?: string | URL;\n /** Where to load the engine on WebGPU from (`isard_webgpu_bg.wasm`), when a bundler does not resolve the default URL */\n webgpuWasmUrl?: string | URL;\n /** Where to load the engine's WebGL2 fallback from (`isard_webgl2_bg.wasm`, for a browser without WebGPU), when a\n * bundler does not resolve the default URL */\n webgl2WasmUrl?: string | URL;\n /** Where the decoding workers load the point cloud module from (`isard_points_bg.wasm`, the LAZ decoder of COPC),\n * when a bundler does not resolve the default URL. Loaded with the first point cloud only */\n pointsWasmUrl?: string | URL;\n /** Where the decoding workers load the 3D Tiles module from (`isard_tiles3d_bg.wasm`: a tile's content decoded for\n * the GPU), when a bundler does not resolve the default URL. Loaded with the first tile */\n tiles3dWasmUrl?: string | URL;\n /** Where the basemap workers load the tessellation module from (`isard_tess_bg.wasm`: the vector tiles drawn as\n * geometry, `vectorTiles().vectors()`, made ready for the GPU off the main thread), when a bundler does not resolve\n * the default URL. Loaded with the first tile of geometry; without it, the main thread does that work */\n tessWasmUrl?: string | URL;\n /** Where the workers load the grid module from (`isard_grid_bg.wasm`: GRIB2 and NetCDF files read by\n * `map.readGrids`), when a bundler does not resolve the default URL. Loaded with the first file */\n gridWasmUrl?: string | URL;\n /** Where to load the vector basemap worker from, when a bundler does not resolve the default URL */\n basemapWorkerUrl?: string | URL;\n /** Texture size of the vector basemap's tiles, pixels (default 512: lines and edges sharp at every zoom on a screen\n * of pixel ratio 1). 256: a quarter of the drawing in the workers, of the uploads and of the GPU memory, for lines\n * and edges a little softer between two zoom levels (the tiles are shown 181 to 362 CSS pixels wide) */\n basemapTileSize?: number;\n /** Glyphs of the symbol layers: a URL with `{fontstack}` and `{range}` (MapLibre's glyph format; default\n * OpenFreeMap's fonts, Noto Sans). A vector basemap's labels take the glyphs of its style */\n glyphs?: string;\n /** Workers decoding 3D Tiles off the main thread: a count, or false to decode on the main thread (default: cores - 1,\n * 1 to 4). False (or 0) also decodes the PNG relief and reprojects the equirectangular rasters on the main thread,\n * else done by the vector basemap's workers */\n workers?: number | false;\n /** Where to load the decoding worker from, when a bundler does not resolve the default URL */\n workerUrl?: string | URL;\n /** Folders of the Draco and Basis Universal decoders, loaded by the workers on first use (default: the official\n * builds on gstatic.com and jsDelivr; self-host them for offline or locked-down networks). They run through\n * `new Function`: a Content Security Policy needs `'unsafe-eval'` (see `DecoderUrls`) */\n decoders?: Partial<DecoderUrls>;\n /** Credits at the bottom right: false for none, or its options (default true: the credits of the basemap,\n * hillshade and relief in use, compact on maps narrower than 640 px) */\n attributionControl?: boolean | AttributionOptions;\n}\n\nexport interface TerrainOptions {\n /** One of the Earth's named models (default `'terrain-tiles'` on the Earth); unused with a `url` */\n model?: TerrainModel;\n /** Altitudes of 256 × 256 tiles in `encoding`: a WMS GetMap URL with {bbox} (EPSG:3857 on the Earth, the body's\n * Mercator metres elsewhere: the sphere of its radius), a tile URL with {z}, {x} and {y}, or an ArcGIS image service\n * (a URL ending in `/ImageServer`), asked for raw altitudes in the body's Mercator (default: the `model`'s; on the\n * Moon and Mars, NASA's Trek LOLA and MOLA models) */\n url?: string;\n /** How the tiles of `url` encode their altitudes (default `'float32'`); `'terrarium'` and `'mapbox'` take a URL with\n * {z}, {x} and {y} */\n encoding?: TerrainEncoding;\n /** Vertical exaggeration, 1 for the true relief (default 1) */\n exaggeration?: number;\n /** Finest level of the relief, up to 15 (default 15; 14 for the Terrain Tiles, 8 for the Moon's and Mars's models). It\n * starts at level 6 on the Earth, coarser on bodies of a larger relief for their size (3 on the Moon and Mars) */\n maxZoom?: number;\n /** Altitudes over mainland France raised by the height of the RAF20 geoid (the French one, 0 away from France), to\n * heights above the ellipsoid (those of 3D Tiles); false keeps the altitudes as served (NGF-IGN69 for the IGN's)\n * (default true for the `'ign'` model, false otherwise) */\n geoid?: boolean;\n}\n\n/** Sky, horizon and fog over the plane, with the names and meanings of MapLibre's `setSky` */\nexport interface AtmosphereOptions {\n /** A CSS color (default `#9cc7ec`) */\n skyColor?: string;\n /** (default `#e8f1f8`) */\n horizonColor?: string;\n /** (default `#f2f5f8`) */\n fogColor?: string;\n /** Blend from the horizon to the sky color, share of the field of view above the horizon, 0-1 (default 0.6) */\n skyHorizonBlend?: number;\n /** Blend from the horizon to the fog color below the horizon, 0-1 (default 0.7) */\n horizonFogBlend?: number;\n /** Share of the distance to the far plane over which the ground fades into the fog, 0-1 (default 0.4) */\n fogGroundBlend?: number;\n}\n\n/** The sun casting shadows (`GeoMap.setSun`): where it stands, by date or by hand, and how dark its shadows are */\nexport interface SunOptions {\n /** The time: the sun where it stands then over the map's center (default now, unless `azimuth` and `altitude`) */\n date?: Date;\n /** Degrees clockwise from north, with `altitude`: the sun placed by hand */\n azimuth?: number;\n /** Degrees above the horizon; at or under it, no shadows */\n altitude?: number;\n /** How dark the shadows are, 0 to 1 (default 0.35) */\n opacity?: number;\n /** How dark the night is, 0 to 1: the scene tinted in its blue, the windows of the buildings and the streets of\n * `vectors()` lit, the labels light on dark. By default from the sun's altitude: falling from 6° above the horizon\n * to 6° under it */\n night?: number;\n}\n\n/** What can be seen from a point (`GeoMap.setViewshed`); with several observers, the colors, the opacity and the\n * cone's color are the first one's */\nexport interface ViewshedOptions {\n /** The observer */\n position: LonLat;\n /** Metres above the ground (default 1.7, eye level) */\n height?: number;\n /** Metres around the observer that are tinted (default 1000) */\n range?: number;\n /** A CSS color for what is seen (default `#2f9e44`) */\n visibleColor?: string;\n /** A CSS color for what is hidden (default `#e03131`) */\n hiddenColor?: string;\n /** How strongly the colors tint the scene, multiplied into it so that its textures and shading stay, 0-1 (default\n * 0.7) */\n opacity?: number;\n /** A CSS color for the cone drawn in 3D (one way only): its fan through the axis, at the eye's height and tilted\n * with it, from the eye to the range; solid where nothing hides it, faint behind the scene; none by default */\n coneColor?: string;\n /** To look one way only (a camera, a lookout), degrees clockwise from north; all around without it */\n direction?: number;\n /** Degrees above the horizon the cone looks, negative below (default 0) */\n tilt?: number;\n /** Angle of view across, degrees (default 60) */\n fov?: number;\n /** Angle of view up and down, degrees (default 40) */\n verticalFov?: number;\n}\n\n/** An eye at street level (`GeoMap.setFirstPerson`) */\nexport interface FirstPersonView {\n /** Where it stands */\n lonLat: LonLat;\n /** Metres above the ground (default 1.7) */\n height?: number;\n /** Degrees clockwise from north it looks to */\n bearing: number;\n /** Degrees from straight down: 90 level (the default), 180 straight up */\n pitch?: number;\n /** Vertical field of view, degrees (default 75) */\n fov?: number;\n}\n\n/** Layers shown on one side of a vertical line only (`GeoMap.setSwipe`) */\nexport interface SwipeOptions {\n /** CSS pixels from the left of the map */\n position: number;\n layers: readonly Layer[];\n /** The side they show on (default 'left') */\n side?: 'left' | 'right';\n /** Layers shown on the other side only: two meshes of the same place, each on its side, never drawn over each other */\n other?: readonly Layer[];\n}\n\n/** Animation of a camera move */\nexport interface AnimationOptions {\n /** Milliseconds */\n duration?: number;\n /** Progress over time, both 0 to 1 */\n easing?: (t: number) => number;\n}\n\nexport interface FlyToOptions extends AnimationOptions {\n /** How far the flight zooms out on its way, as MapLibre's `curve` (default 1.42) */\n curve?: number;\n /** Average speed in screens per second when `duration` is not given (default 1.2) */\n speed?: number;\n}\n\n/**\n * Tile grid of a raster's URL. 'mercator': Web Mercator (XYZ, WMTS PM), the engine's own. 'equirectangular':\n * longitudes and latitudes (Plate Carrée, EPSG:4326-like), two 256 px tiles side by side at level 0, rows from the\n * north (NASA's Trek WMTS, WorldCRS84Quad). A `TileGrid`: the tile matrices of a WMTS in any CRS (Lambert-93…), or a\n * WMS asked for each tile's box in its CRS. The last two are reprojected into Web Mercator tiles by the map's workers\n * (in the page with `workers: false`).\n */\nexport type RasterGrid = 'mercator' | 'equirectangular' | TileGrid;\n\n/** The GPU memory of a map's layers (`GeoMap.memory`), bytes */\nexport interface MapMemory {\n /** What they may hold (`GeoMapOptions.memory`) */\n budget: number;\n /** What they hold: the tiles of the 3D Tiles and point clouds, the pools of the rasters' tiles (the relief's\n * included), each one's full from its creation */\n held: number;\n /** Each layer's, bottom first */\n layers: { layer: Layer; bytes: number }[];\n}\n\n/** What `RasterLayer.setStyle` changes */\nexport interface RasterStyle {\n opacity: number;\n /** 0 = greyscale, 1 = original colors */\n saturation: number;\n}\n\n/** Where a new layer goes: under `before`, or on top of the others (under the labels kept on top) */\nexport interface Placement {\n before?: Layer;\n}\n\nexport interface RasterOptions extends Placement {\n /** Tile URL with {z}, {x} and {y} (256 px tiles); unused with a `loader` */\n url: string;\n /** Tile grid of `url` (default 'mercator'); with 'equirectangular', `minZoom` and `maxZoom` are levels of that\n * grid; with a `TileGrid`, they are map zooms, by default those its matrices span */\n grid?: RasterGrid;\n minZoom?: number;\n maxZoom?: number;\n opacity?: number;\n /** 0 = greyscale, 1 = original colors */\n saturation?: number;\n /** Side of the tiles' textures, pixels (default 256): more for sharper tiles drawn by a `loader` */\n size?: number;\n /** Draws each tile instead of fetching `url`: an image of `size` × `size`, null for nothing there; a rejection is\n * retried like a network error */\n loader?: (z: number, x: number, y: number, signal: AbortSignal) => Promise<ImageBitmap | null>;\n /** Credits of the tiles, HTML: shown by the attribution control while the layer is on the map */\n attribution?: string;\n /** Drawn on the ground (default true); false: only on the 3D layers it is draped on (`Tiles3dOptions.drape`), its\n * tiles still loaded as the ground's would be: a solar potential on the roofs only */\n ground?: boolean;\n}\n\nexport interface NetworkStyle {\n /** Line width, CSS pixels, or zoom stops `[[zoom, width], …]` (default 2) */\n width: Size;\n /** Values above are drawn as unreached (default 1800) */\n max: number;\n /** Darker line every `contour` value units, 0 for none (default 0) */\n contour: number;\n opacity: number;\n /** Width of the halo drawn under the lines, CSS pixels or zoom stops, 0 for none (default 0): wide and faint, the\n * reached streets add up into a heat map that fills the blocks */\n halo: Size;\n /** Opacity of the halo at the middle of a line, fading quadratically to its sides (default 0.11) */\n haloOpacity: number;\n /** Colors from 0 to `max`: `[[fraction of max, color], …]` (default green to red) */\n ramp: Ramp | undefined;\n /** Color of the parts beyond `max` or unreached (default `rgba(140, 140, 140, 0.25)`) */\n unreachedColor: string;\n /** Share of `max` over which the colors fade out before it, 0 to 1 (default 0) */\n fade: number;\n}\n\nexport interface NetworkOptions extends Partial<NetworkStyle>, Placement {\n /** Node coordinates in degrees: lon0, lat0, lon1, lat1… */\n nodes: Float64Array;\n /** Edges as node index pairs: a0, b0, a1, b1… */\n edges: Uint32Array;\n /** Line of each edge, from A to B: the points of edge e are `points[start[e] .. start[e + 1]]` (lon, lat pairs,\n * counted in points); with fewer than two points an edge is straight. Default: all straight. */\n lines?: { start: Uint32Array; points: Float64Array };\n /** Per edge, the cost of travelling it from A to B then from B to A, in value units (Infinity: closed that way;\n * closed both ways: not drawn). A point along an edge then takes the quickest way there, min(value(A) + cost from\n * A, value(B) + cost from B), as a travel time does. Without costs, values are interpolated along the edges. */\n costs?: Float32Array;\n /** Width factor of each edge (default 1): rail lines wider than streets */\n edgeWidths?: Float32Array;\n}\n\nexport interface Tiles3dStyle {\n /** Screen-space error (CSS pixels) above which a tile is refined: 16 by default, lower is finer and heavier */\n maxScreenSpaceError: number;\n opacity: number;\n /** Size of the points of point cloud tiles (`.pnts`, glTF points), CSS pixels: 2 by default */\n pointSize?: number;\n /** A CSS color multiplying the textures of the meshes, the color of the untextured ones (buildings without\n * textures are light grey without it); none by default */\n color?: string;\n /** Each feature's color from its properties (a building's height, its use: a thematic map), in place of `color`: a\n * CSS color, or undefined for the layer's. Asked once for each feature of a tile, when the tile is first drawn, and\n * again for every tile when it changes (in React, keep the same function from one render to the next) */\n featureColor?: FeatureColor | undefined;\n}\n\n/** A feature's color from its properties and its index in its tile (`Tiles3dStyle.featureColor`) */\nexport type FeatureColor = (properties: Record<string, unknown>, feature: number) => string | undefined;\n\nexport interface Tiles3dOptions extends Partial<Tiles3dStyle>, Placement {\n /** URL of a `tileset.json` (3D Tiles 1.0 b3dm and pnts, 1.1 glb meshes and points, external tilesets) */\n url: string;\n /** Its heights are altitudes above the geoid (NGF-IGN69), as the IGN's Bâtiments 3D, rather than above the\n * ellipsoid (3D Tiles as specified): each tile raised by the RAF20 geoid, onto the IGN relief (default false) */\n geoid?: boolean;\n /** The walls of its untextured meshes show windows: glass by day, some lit at night (`setFacades`; default false) */\n facades?: boolean;\n /** A raster layer draped on its meshes (`setDrape`): an ortho or a solar potential on the roofs */\n drape?: Drape | undefined;\n}\n\n/** A raster layer draped on a 3D layer's faces (3D Tiles, extrusions, a vector tiles layer's buildings, models), as\n * Cesium's imagery on 3D Tiles: each point of a face takes the raster's color where it stands (its longitude and\n * latitude, whatever its height) */\nexport interface Drape {\n /** The raster layer, on the same map (with `ground: false`, on the 3D layers only) */\n raster: RasterLayer;\n /** 'up': the faces looking up, the roofs (default); 'all': the walls too, the raster stretched down them */\n faces?: 'up' | 'all';\n /** 0 to 1 (default 1), times the raster layer's opacity */\n opacity?: number;\n}\n\nexport interface MapPointerEvent {\n point: Point;\n /** Undefined above the horizon */\n lonLat: LonLat | undefined;\n}\n\n/** What 'hoverfeature' found under the pointer */\nexport interface MapHoverFeatureEvent extends MapPointerEvent {\n /** The feature under the pointer (see `GeoMap.pickFeature`), undefined if none */\n hit: FeatureHit | undefined;\n}\n\n/** The GPU time of a frame (`GeoMap.gpuTimings`), in all and by part (ms) */\nexport interface MapGpuTimings {\n /** The frame's number */\n frame: number;\n ms: number;\n /** The backdrop (sky, globe), the ground (the raster layers over the relief), each layer (with its handle), the\n * shadows, the panorama, the viewshed */\n parts: { part: 'backdrop' | 'ground' | 'layer' | 'shadows' | 'panorama' | 'viewshed'; layer?: Layer; ms: number }[];\n}\n\n/** What a pick looks at: within `radius` CSS pixels of the point (default 0), among `layers` (default every layer;\n * the others hide nothing) */\nexport interface PickOptions {\n radius?: number;\n layers?: readonly Layer[];\n}\n\n/** A picked feature: its layer handle, its index there and, for line, circle, fill, extrusion, point cloud and 3D\n * Tiles layers, the feature itself (a building of 3D Tiles with its properties) */\nexport interface FeatureHit {\n layer: Layer;\n index: number;\n feature: Feature | undefined;\n}\n\nexport interface MapEvents {\n /** The camera started moving (a gesture, an animation or `setCamera`) */\n movestart: Camera;\n /** The camera moved */\n move: Camera;\n /** The camera stopped: no gesture held, no animation running */\n moveend: Camera;\n /** The map changed size (CSS pixels) */\n resize: { width: number; height: number };\n /** The pointer moved over the map (at most once per frame, not while dragging) */\n hover: MapPointerEvent;\n /** What is under the pointer, picked without stalling the GPU: a frame or two after 'hover', only while listened to\n * (radius and layers in `GeoMap.hoverPicking`) */\n hoverfeature: MapHoverFeatureEvent;\n /** Click without drag */\n click: MapPointerEvent;\n /** A frame was drawn; duration of the engine call in milliseconds */\n render: { ms: number };\n /** The map's quality changed, by `setQuality` or stepped down by `'auto'` */\n quality: { quality: Quality };\n /** Everything in view is loaded and drawn, nothing moves: the end of a load, once after each change (as MapLibre's\n * `idle`). Tiles requested by the first frame count, so it never fires before they arrive. */\n idle: Record<string, never>;\n /** The pointer left the canvas (a mouse going out of the map, or onto a control or marker) */\n leave: Record<string, never>;\n}\n\n/** What a layer handle needs from its map */\nexport interface LayerHost {\n readonly engine: Engine;\n requestRender(): void;\n /** Forgets a removed layer */\n detach(layer: Layer): void;\n /** Moves a layer under `before`, or on top */\n moveLayer(layer: Layer, before: Layer | undefined): void;\n /** A layer created again in the engine (new id): put at the place of its old id, which is removed */\n replaceLayer(layer: Layer, old: number): void;\n /** Resolves once the map is idle (everything in view loaded and drawn) */\n whenIdle(): Promise<void>;\n /** Work the map waits on before it is idle (`GeoMap.track`) */\n track<T>(work: Promise<T>): Promise<T>;\n /** What its quality draws (`GeoMap.setQuality`) */\n readonly quality: QualitySettings;\n}\n"]}
@@ -354,6 +354,11 @@ export class Engine {
354
354
  * The largest texture the device takes (pixels a side): the symbol layers' atlases stay within it
355
355
  */
356
356
  maxTextureSize(): number;
357
+ /**
358
+ * The GPU memory of the layers the budget counts (`setMemoryBudget`): two numbers a layer, its id and its bytes
359
+ * (a raster's pool, the tiles of a 3D Tiles layer or a point cloud), the relief last with id 0
360
+ */
361
+ memory(): Float64Array;
357
362
  /**
358
363
  * Moves a layer to a drawing position (0 = bottom)
359
364
  */
@@ -459,6 +464,11 @@ export class Engine {
459
464
  * New points for a circle layer (same features)
460
465
  */
461
466
  setCircles(id: number, points: Float64Array, feature: Uint32Array): void;
467
+ /**
468
+ * A raster layer draped on the roofs, or all the faces, of a 3D Tiles layer, an extrusion layer, a vector tiles
469
+ * layer's buildings or a model layer (`raster` undefined: none)
470
+ */
471
+ setDrape(id: number, raster: number | null | undefined, all_faces: boolean, opacity: number): void;
462
472
  /**
463
473
  * Anchors of batch `key` on the linked network: per feature, node A, node B, cost from A, cost from B
464
474
  *
@@ -627,6 +637,12 @@ export class Engine {
627
637
  * Highest pitch the camera accepts, degrees (up to 85)
628
638
  */
629
639
  setMaxPitch(max: number): void;
640
+ /**
641
+ * The GPU memory the layers' tiles (3D Tiles, point clouds) and the rasters' pools may hold all together (bytes):
642
+ * past it the tiles drawn least recently are unloaded, whichever their layer. A raster's pool takes its memory
643
+ * when it is made: one made later takes the budget as it is then
644
+ */
645
+ setMemoryBudget(bytes: number): void;
630
646
  /**
631
647
  * Lights at night the part of a model layer's model from `from` metres up (a street lamp's head) in `r, g, b`;
632
648
  * `from` not a number: none
@@ -747,10 +763,6 @@ export class Engine {
747
763
  * it, tiles are decoded on the main thread. Set it before adding 3D Tiles layers.
748
764
  */
749
765
  setTileLoader(loader: import('./isard_tiles3d.js').TileLoaderLike | null): void;
750
- /**
751
- * A raster layer draped on a 3D Tiles layer's roofs, or all its faces (`raster` undefined: none)
752
- */
753
- setTiles3dDrape(id: number, raster: number | null | undefined, all_faces: boolean, opacity: number): void;
754
766
  /**
755
767
  * Whether the walls of a 3D Tiles layer's untextured meshes show their windows: glass by day, some lit at night
756
768
  */
@@ -935,6 +947,7 @@ export interface InitOutput {
935
947
  readonly engine_linkExtrusionNetwork: (a: number, b: number, c: number, d: number) => void;
936
948
  readonly engine_localMatrix: (a: number, b: number, c: number, d: number) => [number, number];
937
949
  readonly engine_maxTextureSize: (a: number) => number;
950
+ readonly engine_memory: (a: number) => [number, number];
938
951
  readonly engine_moveLayer: (a: number, b: number, c: number) => void;
939
952
  readonly engine_networkStats: (a: number, b: number) => any;
940
953
  readonly engine_pan: (a: number, b: number, c: number, d: number, e: number) => void;
@@ -958,6 +971,7 @@ export interface InitOutput {
958
971
  readonly engine_setCamera: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
959
972
  readonly engine_setCircleAlignment: (a: number, b: number, c: number) => void;
960
973
  readonly engine_setCircles: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
974
+ readonly engine_setDrape: (a: number, b: number, c: number, d: number, e: number) => void;
961
975
  readonly engine_setExtrusionAnchors: (a: number, b: number, c: number, d: number, e: number) => [number, number];
962
976
  readonly engine_setExtrusionBatch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => [number, number];
963
977
  readonly engine_setFacades: (a: number, b: number, c: number) => void;
@@ -986,6 +1000,7 @@ export interface InitOutput {
986
1000
  readonly engine_setLineDash: (a: number, b: number, c: number, d: number) => void;
987
1001
  readonly engine_setLines: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
988
1002
  readonly engine_setMaxPitch: (a: number, b: number) => void;
1003
+ readonly engine_setMemoryBudget: (a: number, b: number) => void;
989
1004
  readonly engine_setModelGlow: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
990
1005
  readonly engine_setModelHighlight: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
991
1006
  readonly engine_setModelInstances: (a: number, b: number, c: number, d: number, e: number) => void;
@@ -1007,7 +1022,6 @@ export interface InitOutput {
1007
1022
  readonly engine_setSymbols: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number];
1008
1023
  readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
1009
1024
  readonly engine_setTileLoader: (a: number, b: any) => void;
1010
- readonly engine_setTiles3dDrape: (a: number, b: number, c: number, d: number, e: number) => void;
1011
1025
  readonly engine_setTiles3dFacades: (a: number, b: number, c: number) => void;
1012
1026
  readonly engine_setTiles3dFeatureColors: (a: number, b: number, c: any) => void;
1013
1027
  readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
@@ -1034,8 +1048,8 @@ export interface InitOutput {
1034
1048
  readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___js_sys_5e75a17f0680aa0e___Function_fn_wasm_bindgen_4346cdda5a9d72ac___JsValue_____wasm_bindgen_4346cdda5a9d72ac___sys__Undefined___js_sys_5e75a17f0680aa0e___Function_fn_wasm_bindgen_4346cdda5a9d72ac___JsValue_____wasm_bindgen_4346cdda5a9d72ac___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
1035
1049
  readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true_: (a: number, b: number, c: any) => [number, number];
1036
1050
  readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true_: (a: number, b: number, c: any) => [number, number];
1037
- readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__130: (a: number, b: number, c: any) => [number, number];
1038
- readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__131: (a: number, b: number, c: any) => [number, number];
1051
+ readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__132: (a: number, b: number, c: any) => [number, number];
1052
+ readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__133: (a: number, b: number, c: any) => [number, number];
1039
1053
  readonly wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_: (a: number, b: number, c: any) => void;
1040
1054
  readonly __wbindgen_malloc: (a: number, b: number) => number;
1041
1055
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
@@ -488,6 +488,17 @@ export class Engine {
488
488
  const ret = wasm.engine_maxTextureSize(this.__wbg_ptr);
489
489
  return ret >>> 0;
490
490
  }
491
+ /**
492
+ * The GPU memory of the layers the budget counts (`setMemoryBudget`): two numbers a layer, its id and its bytes
493
+ * (a raster's pool, the tiles of a 3D Tiles layer or a point cloud), the relief last with id 0
494
+ * @returns {Float64Array}
495
+ */
496
+ memory() {
497
+ const ret = wasm.engine_memory(this.__wbg_ptr);
498
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
499
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
500
+ return v1;
501
+ }
491
502
  /**
492
503
  * Moves a layer to a drawing position (0 = bottom)
493
504
  * @param {number} id
@@ -719,6 +730,17 @@ export class Engine {
719
730
  const len1 = WASM_VECTOR_LEN;
720
731
  wasm.engine_setCircles(this.__wbg_ptr, id, ptr0, len0, ptr1, len1);
721
732
  }
733
+ /**
734
+ * A raster layer draped on the roofs, or all the faces, of a 3D Tiles layer, an extrusion layer, a vector tiles
735
+ * layer's buildings or a model layer (`raster` undefined: none)
736
+ * @param {number} id
737
+ * @param {number | null | undefined} raster
738
+ * @param {boolean} all_faces
739
+ * @param {number} opacity
740
+ */
741
+ setDrape(id, raster, all_faces, opacity) {
742
+ wasm.engine_setDrape(this.__wbg_ptr, id, isLikeNone(raster) ? Number.MAX_SAFE_INTEGER : (raster) >>> 0, all_faces, opacity);
743
+ }
722
744
  /**
723
745
  * Anchors of batch `key` on the linked network: per feature, node A, node B, cost from A, cost from B
724
746
  *
@@ -1139,6 +1161,15 @@ export class Engine {
1139
1161
  setMaxPitch(max) {
1140
1162
  wasm.engine_setMaxPitch(this.__wbg_ptr, max);
1141
1163
  }
1164
+ /**
1165
+ * The GPU memory the layers' tiles (3D Tiles, point clouds) and the rasters' pools may hold all together (bytes):
1166
+ * past it the tiles drawn least recently are unloaded, whichever their layer. A raster's pool takes its memory
1167
+ * when it is made: one made later takes the budget as it is then
1168
+ * @param {number} bytes
1169
+ */
1170
+ setMemoryBudget(bytes) {
1171
+ wasm.engine_setMemoryBudget(this.__wbg_ptr, bytes);
1172
+ }
1142
1173
  /**
1143
1174
  * Lights at night the part of a model layer's model from `from` metres up (a street lamp's head) in `r, g, b`;
1144
1175
  * `from` not a number: none
@@ -1429,16 +1460,6 @@ export class Engine {
1429
1460
  setTileLoader(loader) {
1430
1461
  wasm.engine_setTileLoader(this.__wbg_ptr, loader);
1431
1462
  }
1432
- /**
1433
- * A raster layer draped on a 3D Tiles layer's roofs, or all its faces (`raster` undefined: none)
1434
- * @param {number} id
1435
- * @param {number | null | undefined} raster
1436
- * @param {boolean} all_faces
1437
- * @param {number} opacity
1438
- */
1439
- setTiles3dDrape(id, raster, all_faces, opacity) {
1440
- wasm.engine_setTiles3dDrape(this.__wbg_ptr, id, isLikeNone(raster) ? Number.MAX_SAFE_INTEGER : (raster) >>> 0, all_faces, opacity);
1441
- }
1442
1463
  /**
1443
1464
  * Whether the walls of a 3D Tiles layer's untextured meshes show their windows: glass by day, some lit at night
1444
1465
  * @param {number} id
@@ -4293,28 +4314,28 @@ function __wbg_get_imports() {
4293
4314
  arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
4294
4315
  }, arguments); },
4295
4316
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
4296
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2376, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4317
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2389, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4297
4318
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true_);
4298
4319
  return ret;
4299
4320
  },
4300
4321
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
4301
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 309, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4322
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 322, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4302
4323
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true_);
4303
4324
  return ret;
4304
4325
  },
4305
4326
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
4306
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 313, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4327
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 326, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4307
4328
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_);
4308
4329
  return ret;
4309
4330
  },
4310
4331
  __wbindgen_generic_0000000000000004: function(arg0, arg1) {
4311
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 309, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4312
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__130);
4332
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 322, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4333
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__132);
4313
4334
  return ret;
4314
4335
  },
4315
4336
  __wbindgen_generic_0000000000000005: function(arg0, arg1) {
4316
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 309, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4317
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__131);
4337
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 322, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4338
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__133);
4318
4339
  return ret;
4319
4340
  },
4320
4341
  __wbindgen_generic_0000000000000006: function(arg0) {
@@ -4396,15 +4417,15 @@ function wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bin
4396
4417
  }
4397
4418
  }
4398
4419
 
4399
- function wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__130(arg0, arg1, arg2) {
4400
- const ret = wasm.wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__130(arg0, arg1, arg2);
4420
+ function wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__132(arg0, arg1, arg2) {
4421
+ const ret = wasm.wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__132(arg0, arg1, arg2);
4401
4422
  if (ret[1]) {
4402
4423
  throw takeFromExternrefTable0(ret[0]);
4403
4424
  }
4404
4425
  }
4405
4426
 
4406
- function wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__131(arg0, arg1, arg2) {
4407
- const ret = wasm.wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__131(arg0, arg1, arg2);
4427
+ function wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__133(arg0, arg1, arg2) {
4428
+ const ret = wasm.wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___sys__JsNullable_wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true__133(arg0, arg1, arg2);
4408
4429
  if (ret[1]) {
4409
4430
  throw takeFromExternrefTable0(ret[0]);
4410
4431
  }
@@ -354,6 +354,11 @@ export class Engine {
354
354
  * The largest texture the device takes (pixels a side): the symbol layers' atlases stay within it
355
355
  */
356
356
  maxTextureSize(): number;
357
+ /**
358
+ * The GPU memory of the layers the budget counts (`setMemoryBudget`): two numbers a layer, its id and its bytes
359
+ * (a raster's pool, the tiles of a 3D Tiles layer or a point cloud), the relief last with id 0
360
+ */
361
+ memory(): Float64Array;
357
362
  /**
358
363
  * Moves a layer to a drawing position (0 = bottom)
359
364
  */
@@ -459,6 +464,11 @@ export class Engine {
459
464
  * New points for a circle layer (same features)
460
465
  */
461
466
  setCircles(id: number, points: Float64Array, feature: Uint32Array): void;
467
+ /**
468
+ * A raster layer draped on the roofs, or all the faces, of a 3D Tiles layer, an extrusion layer, a vector tiles
469
+ * layer's buildings or a model layer (`raster` undefined: none)
470
+ */
471
+ setDrape(id: number, raster: number | null | undefined, all_faces: boolean, opacity: number): void;
462
472
  /**
463
473
  * Anchors of batch `key` on the linked network: per feature, node A, node B, cost from A, cost from B
464
474
  *
@@ -627,6 +637,12 @@ export class Engine {
627
637
  * Highest pitch the camera accepts, degrees (up to 85)
628
638
  */
629
639
  setMaxPitch(max: number): void;
640
+ /**
641
+ * The GPU memory the layers' tiles (3D Tiles, point clouds) and the rasters' pools may hold all together (bytes):
642
+ * past it the tiles drawn least recently are unloaded, whichever their layer. A raster's pool takes its memory
643
+ * when it is made: one made later takes the budget as it is then
644
+ */
645
+ setMemoryBudget(bytes: number): void;
630
646
  /**
631
647
  * Lights at night the part of a model layer's model from `from` metres up (a street lamp's head) in `r, g, b`;
632
648
  * `from` not a number: none
@@ -747,10 +763,6 @@ export class Engine {
747
763
  * it, tiles are decoded on the main thread. Set it before adding 3D Tiles layers.
748
764
  */
749
765
  setTileLoader(loader: import('./isard_tiles3d.js').TileLoaderLike | null): void;
750
- /**
751
- * A raster layer draped on a 3D Tiles layer's roofs, or all its faces (`raster` undefined: none)
752
- */
753
- setTiles3dDrape(id: number, raster: number | null | undefined, all_faces: boolean, opacity: number): void;
754
766
  /**
755
767
  * Whether the walls of a 3D Tiles layer's untextured meshes show their windows: glass by day, some lit at night
756
768
  */
@@ -935,6 +947,7 @@ export interface InitOutput {
935
947
  readonly engine_linkExtrusionNetwork: (a: number, b: number, c: number, d: number) => void;
936
948
  readonly engine_localMatrix: (a: number, b: number, c: number, d: number) => [number, number];
937
949
  readonly engine_maxTextureSize: (a: number) => number;
950
+ readonly engine_memory: (a: number) => [number, number];
938
951
  readonly engine_moveLayer: (a: number, b: number, c: number) => void;
939
952
  readonly engine_networkStats: (a: number, b: number) => any;
940
953
  readonly engine_pan: (a: number, b: number, c: number, d: number, e: number) => void;
@@ -958,6 +971,7 @@ export interface InitOutput {
958
971
  readonly engine_setCamera: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
959
972
  readonly engine_setCircleAlignment: (a: number, b: number, c: number) => void;
960
973
  readonly engine_setCircles: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
974
+ readonly engine_setDrape: (a: number, b: number, c: number, d: number, e: number) => void;
961
975
  readonly engine_setExtrusionAnchors: (a: number, b: number, c: number, d: number, e: number) => [number, number];
962
976
  readonly engine_setExtrusionBatch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => [number, number];
963
977
  readonly engine_setFacades: (a: number, b: number, c: number) => void;
@@ -986,6 +1000,7 @@ export interface InitOutput {
986
1000
  readonly engine_setLineDash: (a: number, b: number, c: number, d: number) => void;
987
1001
  readonly engine_setLines: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
988
1002
  readonly engine_setMaxPitch: (a: number, b: number) => void;
1003
+ readonly engine_setMemoryBudget: (a: number, b: number) => void;
989
1004
  readonly engine_setModelGlow: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
990
1005
  readonly engine_setModelHighlight: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
991
1006
  readonly engine_setModelInstances: (a: number, b: number, c: number, d: number, e: number) => void;
@@ -1007,7 +1022,6 @@ export interface InitOutput {
1007
1022
  readonly engine_setSymbols: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number];
1008
1023
  readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
1009
1024
  readonly engine_setTileLoader: (a: number, b: any) => void;
1010
- readonly engine_setTiles3dDrape: (a: number, b: number, c: number, d: number, e: number) => void;
1011
1025
  readonly engine_setTiles3dFacades: (a: number, b: number, c: number) => void;
1012
1026
  readonly engine_setTiles3dFeatureColors: (a: number, b: number, c: any) => void;
1013
1027
  readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
@@ -1034,8 +1048,8 @@ export interface InitOutput {
1034
1048
  readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___js_sys_b1e1c29ba6b0e6b3___Function_fn_wasm_bindgen_2e566c63402fe7fa___JsValue_____wasm_bindgen_2e566c63402fe7fa___sys__Undefined___js_sys_b1e1c29ba6b0e6b3___Function_fn_wasm_bindgen_2e566c63402fe7fa___JsValue_____wasm_bindgen_2e566c63402fe7fa___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
1035
1049
  readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_: (a: number, b: number, c: any) => [number, number];
1036
1050
  readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___sys__JsNullable_wgpu_79b597b3111bcbe9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_: (a: number, b: number, c: any) => [number, number];
1037
- readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___sys__JsNullable_wgpu_79b597b3111bcbe9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true__130: (a: number, b: number, c: any) => [number, number];
1038
- readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___sys__JsNullable_wgpu_79b597b3111bcbe9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true__131: (a: number, b: number, c: any) => [number, number];
1051
+ readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___sys__JsNullable_wgpu_79b597b3111bcbe9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true__132: (a: number, b: number, c: any) => [number, number];
1052
+ readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___sys__JsNullable_wgpu_79b597b3111bcbe9___backend__webgpu__webgpu_sys__gen_GpuError__GpuError___core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true__133: (a: number, b: number, c: any) => [number, number];
1039
1053
  readonly wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wgpu_79b597b3111bcbe9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_: (a: number, b: number, c: any) => void;
1040
1054
  readonly __wbindgen_malloc: (a: number, b: number) => number;
1041
1055
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;