isard 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,37 @@ versions [Semantic Versioning](https://semver.org) (before 1.0.0, a minor versio
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.7.0] - 2026-11-02
9
+
10
+ With `isard-react-native` and `isard-map` (Python) 2.7.0.
11
+
12
+ ### Added
13
+
14
+ - `ogcSource(url)`: an OGC API - Tiles tileset as a MapLibre style's source of the kind its metadata says, vector
15
+ or raster (a map tileset: `{ type: 'raster', tileSize, … }`, drawn under the vector layers by `tiles.raster()`):
16
+ images and vector tiles of OGC APIs in one style.
17
+
18
+ ### Changed
19
+
20
+ - `ogcVectorSource` is `ogcSource`, which gives a raster source too (a map tileset): rename the calls.
21
+ - The computers are expected to have WebGPU: the guide's page Weaker GPUs and phones says which browsers give it and
22
+ how to turn Vulkan on in Chrome on Linux (without it, Chrome offers no WebGPU device and the map draws through its
23
+ WebGL2 fallback).
24
+
25
+ ## [2.6.1] - 2026-11-02
26
+
27
+ With `isard-react-native` and `isard-map` (Python) 2.6.1.
28
+
29
+ ### Fixed
30
+
31
+ - On the WebGL2 fallback (a browser without WebGPU), the browser's console no longer fills with warnings
32
+ (`READ-usage buffer was written, then fenced…`, then `too many errors`), and the frames no longer read back the
33
+ scene's depth: the copy that `pickSurface` and the camera's grab and pivot read is taken once the camera stops, then
34
+ every 500 ms at most while the scene changes, not at every frame (WebGPU too, the GPU's work less).
35
+ - The three.js example says when the browser has no WebGPU (custom layers are drawn through WebGPU only), rather than
36
+ showing the map without its objects.
37
+ - The pages of the OGC API examples and of Find a building show their shared code too.
38
+
8
39
  ## [2.6.0] - 2026-11-02
9
40
 
10
41
  With `isard-react-native` and `isard-map` (Python) 2.6.0.
@@ -51,14 +51,28 @@ export declare const ogcTiles: (url: string | URL, { signal }?: {
51
51
  export declare const ogcMapTiles: (url: string | URL, options?: Omit<RasterOptions, "url"> & {
52
52
  signal?: AbortSignal;
53
53
  }) => Promise<RasterOptions>;
54
- /** A vector style's source from an OGC API - Tiles vector tileset (`ogcTiles`): `{ type: 'vector', tiles, minzoom,
55
- * maxzoom }`, in a MapLibre style's `sources` given to `map.vectorTiles({ style })` */
56
- export declare const ogcVectorSource: (url: string | URL, { signal }?: {
57
- signal?: AbortSignal;
58
- }) => Promise<{
59
- type: "vector";
54
+ /** A style's source of a tileset (`ogcSource`): vector tiles, or images */
55
+ export type OgcSource = {
56
+ type: 'vector';
57
+ tiles: string[];
58
+ minzoom: number;
59
+ maxzoom: number;
60
+ attribution?: string;
61
+ } | {
62
+ type: 'raster';
60
63
  tiles: string[];
64
+ tileSize: number;
61
65
  minzoom: number;
62
66
  maxzoom: number;
63
67
  attribution?: string;
64
- }>;
68
+ };
69
+ /**
70
+ * A MapLibre style's source from an OGC API - Tiles tileset (`ogcTiles`), of the kind its metadata says: a vector
71
+ * tileset a `{ type: 'vector', … }` source, a map tileset a `{ type: 'raster', tileSize, … }` one, drawn under the
72
+ * vector layers into the same images (`tiles.raster()`). In a style's `sources`, given to `map.vectorTiles({ style })`.
73
+ * `tileSize`: a map tileset's tiles' side in pixels (default 256, OGC API - Tiles' WebMercatorQuad)
74
+ */
75
+ export declare const ogcSource: (url: string | URL, { signal, tileSize }?: {
76
+ signal?: AbortSignal;
77
+ tileSize?: number;
78
+ }) => Promise<OgcSource>;
@@ -104,7 +104,7 @@ export const ogcMapTiles = async (url, options = {}) => {
104
104
  const { signal, ...raster } = options;
105
105
  const tileset = await ogcTiles(url, signal ? { signal } : {});
106
106
  if (tileset.dataType !== 'map')
107
- throw new Error(`isard: ${String(url)}: vector tiles, a style's source`);
107
+ throw new Error(`isard: ${String(url)}: vector tiles, a style's source (ogcSource)`);
108
108
  return {
109
109
  url: tileset.url,
110
110
  minZoom: tileset.minZoom,
@@ -113,18 +113,17 @@ export const ogcMapTiles = async (url, options = {}) => {
113
113
  ...raster,
114
114
  };
115
115
  };
116
- /** A vector style's source from an OGC API - Tiles vector tileset (`ogcTiles`): `{ type: 'vector', tiles, minzoom,
117
- * maxzoom }`, in a MapLibre style's `sources` given to `map.vectorTiles({ style })` */
118
- export const ogcVectorSource = async (url, { signal } = {}) => {
119
- const tileset = await ogcTiles(url, signal ? { signal } : {});
120
- if (tileset.dataType !== 'vector')
121
- throw new Error(`isard: ${String(url)}: images, a raster layer's tiles`);
122
- return {
123
- type: 'vector',
124
- tiles: [tileset.url],
125
- minzoom: tileset.minZoom,
126
- maxzoom: tileset.maxZoom,
127
- ...(tileset.attribution ? { attribution: tileset.attribution } : {}),
128
- };
116
+ /**
117
+ * A MapLibre style's source from an OGC API - Tiles tileset (`ogcTiles`), of the kind its metadata says: a vector
118
+ * tileset a `{ type: 'vector', … }` source, a map tileset a `{ type: 'raster', tileSize, … }` one, drawn under the
119
+ * vector layers into the same images (`tiles.raster()`). In a style's `sources`, given to `map.vectorTiles({ style })`.
120
+ * `tileSize`: a map tileset's tiles' side in pixels (default 256, OGC API - Tiles' WebMercatorQuad)
121
+ */
122
+ export const ogcSource = async (url, { signal, tileSize = 256 } = {}) => {
123
+ const { url: template, minZoom: minzoom, maxZoom: maxzoom, dataType, attribution, } = await ogcTiles(url, signal ? { signal } : {});
124
+ const credit = attribution ? { attribution } : {};
125
+ return dataType === 'vector'
126
+ ? { type: 'vector', tiles: [template], minzoom, maxzoom, ...credit }
127
+ : { type: 'raster', tiles: [template], tileSize, minzoom, maxzoom, ...credit };
129
128
  };
130
129
  //# sourceMappingURL=ogcapi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ogcapi.js","sourceRoot":"","sources":["../../src/data/ogcapi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAsBlD,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,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in another CRS, paged by their links)\n * for the feature layers; tiles from OGC API - Tiles (a tileset's metadata: its URL template, its levels) for a raster\n * layer or a vector style's source. The tilesets in Web Mercator (`WebMercatorQuad`), the engine's grid.\n */\n\nimport type { FeatureCollection, Properties } from '../layers/features.ts';\nimport type { RasterOptions } from '../types.ts';\nimport { fetchOk } from '../util/fetch.ts';\nimport { withHeaders } from '../util/requests.ts';\n\n/** What `ogcFeatures` asks for */\nexport interface OgcFeaturesOptions {\n /** The box the features meet: west, south, east, north (degrees) */\n bbox?: [west: number, south: number, east: number, north: number];\n /** A CQL2 filter (Part 3), as text by default: `\"hauteur > 30\"`, `\"S_INTERSECTS(geometry, POINT(2.33 48.87))\"` */\n filter?: string;\n /** The filter's language (default `'cql2-text'`) */\n filterLang?: 'cql2-text' | 'cql2-json';\n /** The CRS of the features' coordinates (Part 2), a URI (`'http://www.opengis.net/def/crs/EPSG/0/2154'`): the\n * collection names it in its `crs` member, the feature layers reproject it. Default the server's, CRS84 */\n crs?: string;\n /** The properties kept (default all of them) */\n properties?: string[];\n /** At most this many features (default 10 000) */\n count?: number;\n /** Features a page (default 1000), the next pages followed by their `next` link */\n pageSize?: number;\n signal?: AbortSignal;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null;\n\n/** A link of an OGC API answer */\ninterface Link {\n href: string;\n rel?: string;\n type?: string;\n templated?: boolean;\n}\n\nconst isLink = (value: unknown): value is Link => isRecord(value) && typeof value.href === 'string';\n\n/** The links of an answer */\nconst linksOf = (value: unknown): Link[] =>\n isRecord(value) && Array.isArray(value.links) ? value.links.filter(isLink) : [];\n\n/** A page of features: a GeoJSON collection with its links */\ntype FeaturesPage<P> = FeatureCollection<P> & { links?: unknown[] };\n\nconst isFeaturesPage = <P>(value: unknown): value is FeaturesPage<P> =>\n isRecord(value) && Array.isArray(value.features);\n\n/** The JSON of a URL, the page's request headers on it */\nconst json = async (url: string | URL, signal: AbortSignal | undefined): Promise<unknown> =>\n (\n await fetchOk(url, withHeaders(url, { ...(signal ? { signal } : {}), headers: { Accept: 'application/json' } }))\n ).json();\n\n/** A link's URL, relative to the answer it came in */\nconst resolve = (href: string, base: string | URL): URL => new URL(href, base);\n\n/**\n * Features of a collection of an OGC API - Features service as GeoJSON: `await ogcFeatures(url, 'buildings', { bbox,\n * filter: 'height > 30' })`, `url` the service's landing page. The pages followed by their `next` links until `count`\n * features or the last page. With `crs`, the coordinates come in it, the collection naming it (`crs` member)\n */\nexport const ogcFeatures = async <P = Properties>(\n url: string | URL,\n collection: string,\n options: OgcFeaturesOptions = {},\n): Promise<FeatureCollection<P>> => {\n const { bbox, filter, filterLang = 'cql2-text', crs, properties, count = 10_000, pageSize = 1000, signal } = options;\n const items = new URL(`collections/${encodeURIComponent(collection)}/items`, `${String(url).replace(/\\/?$/, '/')}`);\n\n // Spaces as %20, not + (URLSearchParams): a server re-encodes a + in its next link (%2B), which breaks the filter\n // past one page\n items.search = Object.entries({\n f: 'json',\n limit: String(Math.max(1, Math.min(pageSize, count))),\n ...(bbox ? { bbox: bbox.join(',') } : {}),\n ...(filter ? { filter, 'filter-lang': filterLang } : {}),\n ...(crs ? { crs } : {}),\n ...(properties ? { properties: properties.join(',') } : {}),\n })\n .map(([key, value]) => `${key}=${encodeURIComponent(value)}`)\n .join('&');\n\n const features: FeatureCollection<P>['features'] = [];\n let next: URL | undefined = items;\n\n while (next && features.length < count) {\n const page: unknown = await json(next, signal);\n\n if (!isFeaturesPage<P>(page)) throw new Error(`isard: ${String(next)}: not a GeoJSON feature collection`);\n features.push(...page.features);\n\n const link = linksOf(page).find((l) => l.rel === 'next');\n // An empty page ends it whatever its links say (a server that always links further)\n next = link && page.features.length > 0 ? resolve(link.href, next) : undefined;\n }\n\n return {\n type: 'FeatureCollection',\n features: features.slice(0, count),\n ...(crs ? { crs: { type: 'name', properties: { name: crs } } } : {}),\n };\n};\n\n/** A tileset of OGC API - Tiles as isard reads it: its tiles' URL template (`{z}`, `{x}`, `{y}`), its levels, whether\n * its tiles are images (`'map'`) or vector tiles (`'vector'`), its credits */\nexport interface OgcTileset {\n url: string;\n minZoom: number;\n maxZoom: number;\n dataType: 'map' | 'vector';\n attribution?: string;\n}\n\n/** The level numbers of a tileset's limits, if it has some */\nconst levelsOf = (tileset: Record<string, unknown>): number[] =>\n (Array.isArray(tileset.tileMatrixSetLimits) ? tileset.tileMatrixSetLimits : [])\n .map((limit) => (isRecord(limit) ? Number(limit.tileMatrix) : Number.NaN))\n .filter(Number.isInteger);\n\n/** Whether a tileset's grid is Web Mercator's */\nconst isWebMercator = (tileset: Record<string, unknown>): boolean =>\n [tileset.tileMatrixSetURI, tileset.tileMatrixSetId, tileset.tileMatrixSet].some(\n (id) => typeof id === 'string' && /WebMercatorQuad$/i.test(id),\n );\n\n/**\n * A tileset of OGC API - Tiles read from its metadata (`…/tiles/WebMercatorQuad`, or the list of a collection's\n * tilesets `…/tiles`, its Web Mercator one taken): its tiles' URL template, its levels, its kind. In Web Mercator only\n * (`WebMercatorQuad`, the engine's grid)\n */\nexport const ogcTiles = async (url: string | URL, { signal }: { signal?: AbortSignal } = {}): Promise<OgcTileset> => {\n const answer: unknown = await json(url, signal);\n\n if (!isRecord(answer)) throw new Error(`isard: ${String(url)}: not a tileset`);\n // A list of tilesets: its Web Mercator one\n if (Array.isArray(answer.tilesets)) {\n const listed = answer.tilesets.filter(isRecord).find(isWebMercator);\n // Its own link (`self`), else the first that is not its tiling scheme's\n const links = listed ? linksOf(listed) : [];\n const link = links.find((l) => l.rel === 'self') ?? links.find((l) => !l.rel?.endsWith('tiling-scheme'));\n\n if (!link) throw new Error(`isard: ${String(url)}: no tileset in Web Mercator (WebMercatorQuad)`);\n\n return ogcTiles(resolve(link.href, url), signal ? { signal } : {});\n }\n if (!isWebMercator(answer))\n throw new Error(`isard: ${String(url)}: a tileset in Web Mercator (WebMercatorQuad) only`);\n\n const tiles = linksOf(answer).filter((l) => l.rel === 'item' && l.href.includes('{tileMatrix}'));\n const vector = tiles.find((l) => /mapbox-vector-tile|mvt|pbf/i.test(l.type ?? ''));\n const image = tiles.find((l) => /^image\\//.test(l.type ?? ''));\n const dataType = answer.dataType === 'vector' || (vector && !image) ? 'vector' : 'map';\n const link = (dataType === 'vector' ? vector : image) ?? tiles[0];\n\n if (!link) throw new Error(`isard: ${String(url)}: no URL template of its tiles`);\n\n const template = resolve(link.href.replace(/\\{(tileMatrix|tileRow|tileCol)\\}/g, '_$1_'), url)\n .toString()\n .replace('_tileMatrix_', '{z}')\n .replace('_tileRow_', '{y}')\n .replace('_tileCol_', '{x}');\n const levels = levelsOf(answer);\n\n return {\n url: template,\n minZoom: levels.length > 0 ? Math.min(...levels) : 0,\n maxZoom: levels.length > 0 ? Math.max(...levels) : 22,\n dataType,\n ...(typeof answer.attribution === 'string' ? { attribution: answer.attribution } : {}),\n };\n};\n\n/** A raster layer's options from an OGC API - Tiles map tileset (`ogcTiles`): `map.addRaster(await ogcMapTiles(url))` */\nexport const ogcMapTiles = async (\n url: string | URL,\n options: Omit<RasterOptions, 'url'> & { signal?: AbortSignal } = {},\n): Promise<RasterOptions> => {\n const { signal, ...raster } = options;\n const tileset = await ogcTiles(url, signal ? { signal } : {});\n\n if (tileset.dataType !== 'map') throw new Error(`isard: ${String(url)}: vector tiles, a style's source`);\n\n return {\n url: tileset.url,\n minZoom: tileset.minZoom,\n maxZoom: tileset.maxZoom,\n ...(tileset.attribution ? { attribution: tileset.attribution } : {}),\n ...raster,\n };\n};\n\n/** A vector style's source from an OGC API - Tiles vector tileset (`ogcTiles`): `{ type: 'vector', tiles, minzoom,\n * maxzoom }`, in a MapLibre style's `sources` given to `map.vectorTiles({ style })` */\nexport const ogcVectorSource = async (\n url: string | URL,\n { signal }: { signal?: AbortSignal } = {},\n): Promise<{ type: 'vector'; tiles: string[]; minzoom: number; maxzoom: number; attribution?: string }> => {\n const tileset = await ogcTiles(url, signal ? { signal } : {});\n\n if (tileset.dataType !== 'vector') throw new Error(`isard: ${String(url)}: images, a raster layer's tiles`);\n\n return {\n type: 'vector',\n tiles: [tileset.url],\n minzoom: tileset.minZoom,\n maxzoom: tileset.maxZoom,\n ...(tileset.attribution ? { attribution: tileset.attribution } : {}),\n };\n};\n"]}
1
+ {"version":3,"file":"ogcapi.js","sourceRoot":"","sources":["../../src/data/ogcapi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAsBlD,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AAUnH,MAAM,MAAM,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAEpG,6BAA6B;AAC7B,MAAM,OAAO,GAAG,CAAC,KAAc,EAAU,EAAE,CACzC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAKlF,MAAM,cAAc,GAAG,CAAI,KAAc,EAA4B,EAAE,CACrE,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAEnD,0DAA0D;AAC1D,MAAM,IAAI,GAAG,KAAK,EAAE,GAAiB,EAAE,MAA+B,EAAoB,EAAE,CAC1F,CACE,MAAM,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EA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AClD,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAElD,OAAO,QAAQ,KAAK,QAAQ;QAC1B,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE;QACpE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC;AACnF,CAAC,CAAC","sourcesContent":["/**\n * The OGC APIs: features from OGC API - Features (by box and by a CQL2 filter, in another CRS, paged by their links)\n * for the feature layers; tiles from OGC API - Tiles (a tileset's metadata: its URL template, its levels) for a raster\n * layer or a vector style's source. The tilesets in Web Mercator (`WebMercatorQuad`), the engine's grid.\n */\n\nimport type { FeatureCollection, Properties } from '../layers/features.ts';\nimport type { RasterOptions } from '../types.ts';\nimport { fetchOk } from '../util/fetch.ts';\nimport { withHeaders } from '../util/requests.ts';\n\n/** What `ogcFeatures` asks for */\nexport interface OgcFeaturesOptions {\n /** The box the features meet: west, south, east, north (degrees) */\n bbox?: [west: number, south: number, east: number, north: number];\n /** A CQL2 filter (Part 3), as text by default: `\"hauteur > 30\"`, `\"S_INTERSECTS(geometry, POINT(2.33 48.87))\"` */\n filter?: string;\n /** The filter's language (default `'cql2-text'`) */\n filterLang?: 'cql2-text' | 'cql2-json';\n /** The CRS of the features' coordinates (Part 2), a URI (`'http://www.opengis.net/def/crs/EPSG/0/2154'`): the\n * collection names it in its `crs` member, the feature layers reproject it. Default the server's, CRS84 */\n crs?: string;\n /** The properties kept (default all of them) */\n properties?: string[];\n /** At most this many features (default 10 000) */\n count?: number;\n /** Features a page (default 1000), the next pages followed by their `next` link */\n pageSize?: number;\n signal?: AbortSignal;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null;\n\n/** A link of an OGC API answer */\ninterface Link {\n href: string;\n rel?: string;\n type?: string;\n templated?: boolean;\n}\n\nconst isLink = (value: unknown): value is Link => isRecord(value) && typeof value.href === 'string';\n\n/** The links of an answer */\nconst linksOf = (value: unknown): Link[] =>\n isRecord(value) && Array.isArray(value.links) ? value.links.filter(isLink) : [];\n\n/** A page of features: a GeoJSON collection with its links */\ntype FeaturesPage<P> = FeatureCollection<P> & { links?: unknown[] };\n\nconst isFeaturesPage = <P>(value: unknown): value is FeaturesPage<P> =>\n isRecord(value) && Array.isArray(value.features);\n\n/** The JSON of a URL, the page's request headers on it */\nconst json = async (url: string | URL, signal: AbortSignal | undefined): Promise<unknown> =>\n (\n await fetchOk(url, withHeaders(url, { ...(signal ? { signal } : {}), headers: { Accept: 'application/json' } }))\n ).json();\n\n/** A link's URL, relative to the answer it came in */\nconst resolve = (href: string, base: string | URL): URL => new URL(href, base);\n\n/**\n * Features of a collection of an OGC API - Features service as GeoJSON: `await ogcFeatures(url, 'buildings', { bbox,\n * filter: 'height > 30' })`, `url` the service's landing page. The pages followed by their `next` links until `count`\n * features or the last page. With `crs`, the coordinates come in it, the collection naming it (`crs` member)\n */\nexport const ogcFeatures = async <P = Properties>(\n url: string | URL,\n collection: string,\n options: OgcFeaturesOptions = {},\n): Promise<FeatureCollection<P>> => {\n const { bbox, filter, filterLang = 'cql2-text', crs, properties, count = 10_000, pageSize = 1000, signal } = options;\n const items = new URL(`collections/${encodeURIComponent(collection)}/items`, `${String(url).replace(/\\/?$/, '/')}`);\n\n // Spaces as %20, not + (URLSearchParams): a server re-encodes a + in its next link (%2B), which breaks the filter\n // past one page\n items.search = Object.entries({\n f: 'json',\n limit: String(Math.max(1, Math.min(pageSize, count))),\n ...(bbox ? { bbox: bbox.join(',') } : {}),\n ...(filter ? { filter, 'filter-lang': filterLang } : {}),\n ...(crs ? { crs } : {}),\n ...(properties ? { properties: properties.join(',') } : {}),\n })\n .map(([key, value]) => `${key}=${encodeURIComponent(value)}`)\n .join('&');\n\n const features: FeatureCollection<P>['features'] = [];\n let next: URL | undefined = items;\n\n while (next && features.length < count) {\n const page: unknown = await json(next, signal);\n\n if (!isFeaturesPage<P>(page)) throw new Error(`isard: ${String(next)}: not a GeoJSON feature collection`);\n features.push(...page.features);\n\n const link = linksOf(page).find((l) => l.rel === 'next');\n // An empty page ends it whatever its links say (a server that always links further)\n next = link && page.features.length > 0 ? resolve(link.href, next) : undefined;\n }\n\n return {\n type: 'FeatureCollection',\n features: features.slice(0, count),\n ...(crs ? { crs: { type: 'name', properties: { name: crs } } } : {}),\n };\n};\n\n/** A tileset of OGC API - Tiles as isard reads it: its tiles' URL template (`{z}`, `{x}`, `{y}`), its levels, whether\n * its tiles are images (`'map'`) or vector tiles (`'vector'`), its credits */\nexport interface OgcTileset {\n url: string;\n minZoom: number;\n maxZoom: number;\n dataType: 'map' | 'vector';\n attribution?: string;\n}\n\n/** The level numbers of a tileset's limits, if it has some */\nconst levelsOf = (tileset: Record<string, unknown>): number[] =>\n (Array.isArray(tileset.tileMatrixSetLimits) ? tileset.tileMatrixSetLimits : [])\n .map((limit) => (isRecord(limit) ? Number(limit.tileMatrix) : Number.NaN))\n .filter(Number.isInteger);\n\n/** Whether a tileset's grid is Web Mercator's */\nconst isWebMercator = (tileset: Record<string, unknown>): boolean =>\n [tileset.tileMatrixSetURI, tileset.tileMatrixSetId, tileset.tileMatrixSet].some(\n (id) => typeof id === 'string' && /WebMercatorQuad$/i.test(id),\n );\n\n/**\n * A tileset of OGC API - Tiles read from its metadata (`…/tiles/WebMercatorQuad`, or the list of a collection's\n * tilesets `…/tiles`, its Web Mercator one taken): its tiles' URL template, its levels, its kind. In Web Mercator only\n * (`WebMercatorQuad`, the engine's grid)\n */\nexport const ogcTiles = async (url: string | URL, { signal }: { signal?: AbortSignal } = {}): Promise<OgcTileset> => {\n const answer: unknown = await json(url, signal);\n\n if (!isRecord(answer)) throw new Error(`isard: ${String(url)}: not a tileset`);\n // A list of tilesets: its Web Mercator one\n if (Array.isArray(answer.tilesets)) {\n const listed = answer.tilesets.filter(isRecord).find(isWebMercator);\n // Its own link (`self`), else the first that is not its tiling scheme's\n const links = listed ? linksOf(listed) : [];\n const link = links.find((l) => l.rel === 'self') ?? links.find((l) => !l.rel?.endsWith('tiling-scheme'));\n\n if (!link) throw new Error(`isard: ${String(url)}: no tileset in Web Mercator (WebMercatorQuad)`);\n\n return ogcTiles(resolve(link.href, url), signal ? { signal } : {});\n }\n if (!isWebMercator(answer))\n throw new Error(`isard: ${String(url)}: a tileset in Web Mercator (WebMercatorQuad) only`);\n\n const tiles = linksOf(answer).filter((l) => l.rel === 'item' && l.href.includes('{tileMatrix}'));\n const vector = tiles.find((l) => /mapbox-vector-tile|mvt|pbf/i.test(l.type ?? ''));\n const image = tiles.find((l) => /^image\\//.test(l.type ?? ''));\n const dataType = answer.dataType === 'vector' || (vector && !image) ? 'vector' : 'map';\n const link = (dataType === 'vector' ? vector : image) ?? tiles[0];\n\n if (!link) throw new Error(`isard: ${String(url)}: no URL template of its tiles`);\n\n const template = resolve(link.href.replace(/\\{(tileMatrix|tileRow|tileCol)\\}/g, '_$1_'), url)\n .toString()\n .replace('_tileMatrix_', '{z}')\n .replace('_tileRow_', '{y}')\n .replace('_tileCol_', '{x}');\n const levels = levelsOf(answer);\n\n return {\n url: template,\n minZoom: levels.length > 0 ? Math.min(...levels) : 0,\n maxZoom: levels.length > 0 ? Math.max(...levels) : 22,\n dataType,\n ...(typeof answer.attribution === 'string' ? { attribution: answer.attribution } : {}),\n };\n};\n\n/** A raster layer's options from an OGC API - Tiles map tileset (`ogcTiles`): `map.addRaster(await ogcMapTiles(url))` */\nexport const ogcMapTiles = async (\n url: string | URL,\n options: Omit<RasterOptions, 'url'> & { signal?: AbortSignal } = {},\n): Promise<RasterOptions> => {\n const { signal, ...raster } = options;\n const tileset = await ogcTiles(url, signal ? { signal } : {});\n\n if (tileset.dataType !== 'map') throw new Error(`isard: ${String(url)}: vector tiles, a style's source (ogcSource)`);\n\n return {\n url: tileset.url,\n minZoom: tileset.minZoom,\n maxZoom: tileset.maxZoom,\n ...(tileset.attribution ? { attribution: tileset.attribution } : {}),\n ...raster,\n };\n};\n\n/** A style's source of a tileset (`ogcSource`): vector tiles, or images */\nexport type OgcSource =\n | { type: 'vector'; tiles: string[]; minzoom: number; maxzoom: number; attribution?: string }\n | { type: 'raster'; tiles: string[]; tileSize: number; minzoom: number; maxzoom: number; attribution?: string };\n\n/**\n * A MapLibre style's source from an OGC API - Tiles tileset (`ogcTiles`), of the kind its metadata says: a vector\n * tileset a `{ type: 'vector', … }` source, a map tileset a `{ type: 'raster', tileSize, … }` one, drawn under the\n * vector layers into the same images (`tiles.raster()`). In a style's `sources`, given to `map.vectorTiles({ style })`.\n * `tileSize`: a map tileset's tiles' side in pixels (default 256, OGC API - Tiles' WebMercatorQuad)\n */\nexport const ogcSource = async (\n url: string | URL,\n { signal, tileSize = 256 }: { signal?: AbortSignal; tileSize?: number } = {},\n): Promise<OgcSource> => {\n const {\n url: template,\n minZoom: minzoom,\n maxZoom: maxzoom,\n dataType,\n attribution,\n } = await ogcTiles(url, signal ? { signal } : {});\n const credit = attribution ? { attribution } : {};\n\n return dataType === 'vector'\n ? { type: 'vector', tiles: [template], minzoom, maxzoom, ...credit }\n : { type: 'raster', tiles: [template], tileSize, minzoom, maxzoom, ...credit };\n};\n"]}
package/dist/index.d.ts CHANGED
@@ -33,7 +33,7 @@ export { type Crs, type CrsLike, getCrs, lambertConformalConic, registerCrs, rep
33
33
  export { parseGpx } from './data/gpx.ts';
34
34
  export { type IfcElement, type IfcModel, type IfcOptions, type IfcPlace, type IfcProperties, type IfcStorey, loadIfc, WEB_IFC, } from './data/ifc.ts';
35
35
  export { parseKml } from './data/kml.ts';
36
- export { type OgcFeaturesOptions, type OgcTileset, ogcFeatures, ogcMapTiles, ogcTiles, ogcVectorSource, } from './data/ogcapi.ts';
36
+ export { type OgcFeaturesOptions, type OgcSource, type OgcTileset, ogcFeatures, ogcMapTiles, ogcSource, ogcTiles, } from './data/ogcapi.ts';
37
37
  export { parseTopoJson, type TopoGeometry, type Topology } from './data/topojson.ts';
38
38
  export type { DecoderUrls } from './decoding/decoders.ts';
39
39
  export { BATIMENTS_3D_URL, type BdTopoBuilding, batiments3d, bdtopoBuildings, bdtopoRoofs, type GeocodedPlace, geoplateformeGeocode, geoplateformeWfs, geoplateformeWms, geoplateformeWmts, IGN_ATTRIBUTION, IGN_PRESETS, type IgnPreset, lambert93Grid, } from './geoplateforme.ts';
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ export { getCrs, lambertConformalConic, registerCrs, reproject, transverseMercat
23
23
  export { parseGpx } from "./data/gpx.js";
24
24
  export { loadIfc, WEB_IFC, } from "./data/ifc.js";
25
25
  export { parseKml } from "./data/kml.js";
26
- export { ogcFeatures, ogcMapTiles, ogcTiles, ogcVectorSource, } from "./data/ogcapi.js";
26
+ export { ogcFeatures, ogcMapTiles, ogcSource, ogcTiles, } from "./data/ogcapi.js";
27
27
  export { parseTopoJson } from "./data/topojson.js";
28
28
  export { BATIMENTS_3D_URL, batiments3d, bdtopoBuildings, bdtopoRoofs, geoplateformeGeocode, geoplateformeWfs, geoplateformeWms, geoplateformeWmts, IGN_ATTRIBUTION, IGN_PRESETS, lambert93Grid, } from "./geoplateforme.js";
29
29
  export { windAt, windFields } from "./grids.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAmB,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EACL,OAAO,EAIP,WAAW,EACX,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EA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oBAAoB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["/**\n * isard: a WebGL2 map engine for large, interactive data layers, labels and 3D Tiles.\n *\n * ```ts\n * import { GeoMap } from 'isard';\n * const map = await GeoMap.create(container, { center: [2.4246, 48.8457], zoom: 13 });\n * const network = map.addNetwork({ nodes, edges, max: 1800, contour: 300 });\n * map.on('hover', ({ lonLat }) => lonLat && network.setValues(travelTimes(lonLat)));\n * map.addTiles3d({ url: 'https://…/tileset.json' });\n * map.addControl(new NavigationControl());\n * new Marker().setLonLat([2.4246, 48.8457]).setPopup(new Popup({ offset: [0, -34] }).setText('Here')).addTo(map);\n * ```\n */\nexport { OPENFREEMAP_ATTRIBUTION, TERRAIN_TILES_ATTRIBUTION } from './basemap/basemaps.ts';\nexport type { TileGrid, TileMatrix } from './basemap/grid.ts';\nexport { coniferModel, type TreeColors, treeModel } from './basemap/models/trees.ts';\nexport {\n PMTiles,\n type PmtilesEntry,\n type PmtilesHeader,\n type PmtilesTileType,\n tileIdToZxy,\n zxyToTileId,\n} from './basemap/pmtiles.ts';\nexport { basicStyle, type PmtilesOptions } from './basemap/pmtileslayer.ts';\nexport type {\n CandidateIcon,\n CandidateOverlap,\n Json,\n LabelCandidate,\n RasterSource,\n Style,\n StyleLayer,\n} from './basemap/vectorstyle.ts';\nexport type { VectorExtrusionOptions } from './basemap/vectortiles/extrusions.ts';\nexport type { FurnitureOptions } from './basemap/vectortiles/furniture.ts';\nexport type { LabelsOptions } from './basemap/vectortiles/labels.ts';\nexport type { LampsOptions } from './basemap/vectortiles/lamps.ts';\nexport type { StreetWindLayer, StreetWindOptions } from './basemap/vectortiles/street-wind.ts';\nexport type { LoadedStyle } from './basemap/vectortiles/style.ts';\nexport type { TreesOptions } from './basemap/vectortiles/trees.ts';\nexport { isStreet, type VectorsOptions } from './basemap/vectortiles/vectors.ts';\nexport type { VectorRasterOptions, VectorTilesOptions } from './basemap/vectortiles.ts';\nexport { OPENFREEMAP_STYLES, PLAN_STYLES, VectorTiles } from './basemap/vectortiles.ts';\nexport { parseWmtsGrid, wmtsGrid } from './basemap/wmts.ts';\nexport { type ColladaImages, colladaImages, loadCollada, parseCollada } from './data/collada.ts';\nexport {\n type Crs,\n type CrsLike,\n getCrs,\n lambertConformalConic,\n registerCrs,\n reproject,\n transverseMercator,\n} from './data/crs.ts';\nexport { parseGpx } from './data/gpx.ts';\nexport {\n type IfcElement,\n type IfcModel,\n type IfcOptions,\n type IfcPlace,\n type IfcProperties,\n type IfcStorey,\n loadIfc,\n WEB_IFC,\n} from './data/ifc.ts';\nexport { parseKml } from './data/kml.ts';\nexport {\n type OgcFeaturesOptions,\n type OgcTileset,\n ogcFeatures,\n ogcMapTiles,\n ogcTiles,\n ogcVectorSource,\n} from './data/ogcapi.ts';\nexport { parseTopoJson, type TopoGeometry, type Topology } from './data/topojson.ts';\nexport type { DecoderUrls } from './decoding/decoders.ts';\nexport {\n BATIMENTS_3D_URL,\n type BdTopoBuilding,\n batiments3d,\n bdtopoBuildings,\n bdtopoRoofs,\n type GeocodedPlace,\n geoplateformeGeocode,\n geoplateformeWfs,\n geoplateformeWms,\n geoplateformeWmts,\n IGN_ATTRIBUTION,\n IGN_PRESETS,\n type IgnPreset,\n lambert93Grid,\n} from './geoplateforme.ts';\nexport { type Grid, windAt, windFields } from './grids.ts';\nexport type { CustomFrame, CustomLayerInterface } from './layers/custom.ts';\nexport { CustomLayer } from './layers/custom.ts';\nexport type { ExtrusionOptions, ExtrusionStyle, PolygonArrays, TileKey } from './layers/extrusions.ts';\nexport { ExtrusionLayer } from './layers/extrusions.ts';\nexport type {\n CircleOptions,\n CircleStyle,\n Feature,\n FeatureCollection,\n FeatureData,\n FeatureLayerStyle,\n FillOptions,\n FillStyle,\n Geometry,\n LineOptions,\n LineStyle,\n Position,\n Properties,\n Ramp,\n Size,\n Stops,\n Styled,\n} from './layers/features.ts';\nexport { CircleLayer, FeatureLayer, FillLayer, interpolate, LineLayer, parseColor } from './layers/features.ts';\nexport type { FlowField, FlowOptions, FlowStyle, TimedField } from './layers/flow.ts';\nexport { FlowLayer, flowFieldFromImage, flowFieldsFromImage } from './layers/flow.ts';\nexport type { TextPart } from './layers/glyphs.ts';\nexport { DEFAULT_FONT, GLYPHS_URL } from './layers/glyphs.ts';\nexport type { GroundOptions, GroundTexture, GroundUniform } from './layers/ground.ts';\nexport { GroundLayer } from './layers/ground.ts';\nexport type { ImageOptions, Pixels, SpriteIcon } from './layers/icons.ts';\nexport { Layer } from './layers/layers.ts';\nexport type { ModelInstance, ModelOptions } from './layers/models.ts';\nexport { ModelLayer } from './layers/models.ts';\nexport { NetworkLayer } from './layers/network.ts';\nexport {\n type CalibratedPanoramaOptions,\n type Panorama,\n type PanoramaOptions,\n type PanoramaPhoto,\n Panoramas,\n type PhotoPanoramaOptions,\n} from './layers/panoramas.ts';\nexport { type PhotoOptions, photoModel } from './layers/photos.ts';\nexport type { ClassStyle, PointCloudOptions, PointCloudStyle, PointColor } from './layers/pointclouds.ts';\nexport { CLASSIFICATIONS, ELEVATION_RAMP, PointCloudLayer } from './layers/pointclouds.ts';\nexport { RasterLayer } from './layers/raster.ts';\nexport type { Overlap, SymbolOptions, SymbolStyle } from './layers/symbols.ts';\nexport { SymbolLayer } from './layers/symbols.ts';\nexport { Tiles3dLayer } from './layers/tiles3d.ts';\nexport { type TreeKind, type TreeOptions, treeKind } from './layers/trees.ts';\nexport { type VectorFeature, VectorLayer, type VectorSublayer } from './layers/vectors.ts';\nexport type { HoverPicking } from './map/hover-pick.ts';\nexport { GeoMap, type LayerSpec } from './map.ts';\nexport {\n PANORAMAX_API,\n type PanoramaxPicture,\n type PanoramaxSequenceOptions,\n panoramaxPanoramas,\n panoramaxPhoto,\n panoramaxPicture,\n panoramaxSequence,\n panoramaxStyle,\n} from './panoramax.ts';\nexport type {\n AnimationOptions,\n AtmosphereOptions,\n Basemap,\n BasemapName,\n BodyOptions,\n CelestialBody,\n ClipBox,\n ClipCylinder,\n ClipPolygon,\n ClipVolume,\n Drape,\n FeatureColor,\n FeatureHit,\n FirstPersonView,\n FitBoundsOptions,\n FitBox,\n FlyToOptions,\n GeoMapOptions,\n LoadingMode,\n LonLat,\n MapEvents,\n MapGpuTimings,\n MapHoverFeatureEvent,\n MapMemory,\n MapPointerEvent,\n NetworkOptions,\n NetworkStyle,\n PickOptions,\n Placement,\n Point,\n Projection,\n Quality,\n RasterGrid,\n RasterOptions,\n RasterStyle,\n SunOptions,\n SwipeOptions,\n TerrainEncoding,\n TerrainModel,\n TerrainOptions,\n Tiles3dOptions,\n Tiles3dStyle,\n ViewshedOptions,\n} from './types.ts';\nexport {\n AttributionControl,\n type AttributionOptions,\n type Control,\n type ControlPosition,\n NavigationControl,\n type NavigationOptions,\n} from './ui/controls.ts';\nexport { MinimapControl, type MinimapOptions } from './ui/minimap.ts';\nexport {\n type Anchor,\n Marker,\n type MarkerEvent,\n type MarkerEvents,\n type MarkerOptions,\n Panel,\n type PanelOptions,\n Popup,\n type PopupEvents,\n type PopupOptions,\n} from './ui/overlay.ts';\nexport { lengthLabel, roundLength, ScaleControl, type ScaleOptions } from './ui/scale.ts';\nexport { SearchControl, type SearchOptions } from './ui/search.ts';\nexport { setRequestHeaders } from './util/requests.ts';\nexport type { RoofMode } from './util/roofs.ts';\nexport { sunPosition } from './util/sun.ts';\nexport type {\n Camera,\n NetworkStats,\n PickHit,\n PickResult,\n PointCloudInfo,\n PointCloudPoint,\n PointCloudStats,\n RasterLayerStats,\n Tiles3dStats,\n} from './wasm/isard_webgpu.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAmB,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EACL,OAAO,EAIP,WAAW,EACX,WAAW,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gBAAgB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["/**\n * isard: a WebGL2 map engine for large, interactive data layers, labels and 3D Tiles.\n *\n * ```ts\n * import { GeoMap } from 'isard';\n * const map = await GeoMap.create(container, { center: [2.4246, 48.8457], zoom: 13 });\n * const network = map.addNetwork({ nodes, edges, max: 1800, contour: 300 });\n * map.on('hover', ({ lonLat }) => lonLat && network.setValues(travelTimes(lonLat)));\n * map.addTiles3d({ url: 'https://…/tileset.json' });\n * map.addControl(new NavigationControl());\n * new Marker().setLonLat([2.4246, 48.8457]).setPopup(new Popup({ offset: [0, -34] }).setText('Here')).addTo(map);\n * ```\n */\nexport { OPENFREEMAP_ATTRIBUTION, TERRAIN_TILES_ATTRIBUTION } from './basemap/basemaps.ts';\nexport type { TileGrid, TileMatrix } from './basemap/grid.ts';\nexport { coniferModel, type TreeColors, treeModel } from './basemap/models/trees.ts';\nexport {\n PMTiles,\n type PmtilesEntry,\n type PmtilesHeader,\n type PmtilesTileType,\n tileIdToZxy,\n zxyToTileId,\n} from './basemap/pmtiles.ts';\nexport { basicStyle, type PmtilesOptions } from './basemap/pmtileslayer.ts';\nexport type {\n CandidateIcon,\n CandidateOverlap,\n Json,\n LabelCandidate,\n RasterSource,\n Style,\n StyleLayer,\n} from './basemap/vectorstyle.ts';\nexport type { VectorExtrusionOptions } from './basemap/vectortiles/extrusions.ts';\nexport type { FurnitureOptions } from './basemap/vectortiles/furniture.ts';\nexport type { LabelsOptions } from './basemap/vectortiles/labels.ts';\nexport type { LampsOptions } from './basemap/vectortiles/lamps.ts';\nexport type { StreetWindLayer, StreetWindOptions } from './basemap/vectortiles/street-wind.ts';\nexport type { LoadedStyle } from './basemap/vectortiles/style.ts';\nexport type { TreesOptions } from './basemap/vectortiles/trees.ts';\nexport { isStreet, type VectorsOptions } from './basemap/vectortiles/vectors.ts';\nexport type { VectorRasterOptions, VectorTilesOptions } from './basemap/vectortiles.ts';\nexport { OPENFREEMAP_STYLES, PLAN_STYLES, VectorTiles } from './basemap/vectortiles.ts';\nexport { parseWmtsGrid, wmtsGrid } from './basemap/wmts.ts';\nexport { type ColladaImages, colladaImages, loadCollada, parseCollada } from './data/collada.ts';\nexport {\n type Crs,\n type CrsLike,\n getCrs,\n lambertConformalConic,\n registerCrs,\n reproject,\n transverseMercator,\n} from './data/crs.ts';\nexport { parseGpx } from './data/gpx.ts';\nexport {\n type IfcElement,\n type IfcModel,\n type IfcOptions,\n type IfcPlace,\n type IfcProperties,\n type IfcStorey,\n loadIfc,\n WEB_IFC,\n} from './data/ifc.ts';\nexport { parseKml } from './data/kml.ts';\nexport {\n type OgcFeaturesOptions,\n type OgcSource,\n type OgcTileset,\n ogcFeatures,\n ogcMapTiles,\n ogcSource,\n ogcTiles,\n} from './data/ogcapi.ts';\nexport { parseTopoJson, type TopoGeometry, type Topology } from './data/topojson.ts';\nexport type { DecoderUrls } from './decoding/decoders.ts';\nexport {\n BATIMENTS_3D_URL,\n type BdTopoBuilding,\n batiments3d,\n bdtopoBuildings,\n bdtopoRoofs,\n type GeocodedPlace,\n geoplateformeGeocode,\n geoplateformeWfs,\n geoplateformeWms,\n geoplateformeWmts,\n IGN_ATTRIBUTION,\n IGN_PRESETS,\n type IgnPreset,\n lambert93Grid,\n} from './geoplateforme.ts';\nexport { type Grid, windAt, windFields } from './grids.ts';\nexport type { CustomFrame, CustomLayerInterface } from './layers/custom.ts';\nexport { CustomLayer } from './layers/custom.ts';\nexport type { ExtrusionOptions, ExtrusionStyle, PolygonArrays, TileKey } from './layers/extrusions.ts';\nexport { ExtrusionLayer } from './layers/extrusions.ts';\nexport type {\n CircleOptions,\n CircleStyle,\n Feature,\n FeatureCollection,\n FeatureData,\n FeatureLayerStyle,\n FillOptions,\n FillStyle,\n Geometry,\n LineOptions,\n LineStyle,\n Position,\n Properties,\n Ramp,\n Size,\n Stops,\n Styled,\n} from './layers/features.ts';\nexport { CircleLayer, FeatureLayer, FillLayer, interpolate, LineLayer, parseColor } from './layers/features.ts';\nexport type { FlowField, FlowOptions, FlowStyle, TimedField } from './layers/flow.ts';\nexport { FlowLayer, flowFieldFromImage, flowFieldsFromImage } from './layers/flow.ts';\nexport type { TextPart } from './layers/glyphs.ts';\nexport { DEFAULT_FONT, GLYPHS_URL } from './layers/glyphs.ts';\nexport type { GroundOptions, GroundTexture, GroundUniform } from './layers/ground.ts';\nexport { GroundLayer } from './layers/ground.ts';\nexport type { ImageOptions, Pixels, SpriteIcon } from './layers/icons.ts';\nexport { Layer } from './layers/layers.ts';\nexport type { ModelInstance, ModelOptions } from './layers/models.ts';\nexport { ModelLayer } from './layers/models.ts';\nexport { NetworkLayer } from './layers/network.ts';\nexport {\n type CalibratedPanoramaOptions,\n type Panorama,\n type PanoramaOptions,\n type PanoramaPhoto,\n Panoramas,\n type PhotoPanoramaOptions,\n} from './layers/panoramas.ts';\nexport { type PhotoOptions, photoModel } from './layers/photos.ts';\nexport type { ClassStyle, PointCloudOptions, PointCloudStyle, PointColor } from './layers/pointclouds.ts';\nexport { CLASSIFICATIONS, ELEVATION_RAMP, PointCloudLayer } from './layers/pointclouds.ts';\nexport { RasterLayer } from './layers/raster.ts';\nexport type { Overlap, SymbolOptions, SymbolStyle } from './layers/symbols.ts';\nexport { SymbolLayer } from './layers/symbols.ts';\nexport { Tiles3dLayer } from './layers/tiles3d.ts';\nexport { type TreeKind, type TreeOptions, treeKind } from './layers/trees.ts';\nexport { type VectorFeature, VectorLayer, type VectorSublayer } from './layers/vectors.ts';\nexport type { HoverPicking } from './map/hover-pick.ts';\nexport { GeoMap, type LayerSpec } from './map.ts';\nexport {\n PANORAMAX_API,\n type PanoramaxPicture,\n type PanoramaxSequenceOptions,\n panoramaxPanoramas,\n panoramaxPhoto,\n panoramaxPicture,\n panoramaxSequence,\n panoramaxStyle,\n} from './panoramax.ts';\nexport type {\n AnimationOptions,\n AtmosphereOptions,\n Basemap,\n BasemapName,\n BodyOptions,\n CelestialBody,\n ClipBox,\n ClipCylinder,\n ClipPolygon,\n ClipVolume,\n Drape,\n FeatureColor,\n FeatureHit,\n FirstPersonView,\n FitBoundsOptions,\n FitBox,\n FlyToOptions,\n GeoMapOptions,\n LoadingMode,\n LonLat,\n MapEvents,\n MapGpuTimings,\n MapHoverFeatureEvent,\n MapMemory,\n MapPointerEvent,\n NetworkOptions,\n NetworkStyle,\n PickOptions,\n Placement,\n Point,\n Projection,\n Quality,\n RasterGrid,\n RasterOptions,\n RasterStyle,\n SunOptions,\n SwipeOptions,\n TerrainEncoding,\n TerrainModel,\n TerrainOptions,\n Tiles3dOptions,\n Tiles3dStyle,\n ViewshedOptions,\n} from './types.ts';\nexport {\n AttributionControl,\n type AttributionOptions,\n type Control,\n type ControlPosition,\n NavigationControl,\n type NavigationOptions,\n} from './ui/controls.ts';\nexport { MinimapControl, type MinimapOptions } from './ui/minimap.ts';\nexport {\n type Anchor,\n Marker,\n type MarkerEvent,\n type MarkerEvents,\n type MarkerOptions,\n Panel,\n type PanelOptions,\n Popup,\n type PopupEvents,\n type PopupOptions,\n} from './ui/overlay.ts';\nexport { lengthLabel, roundLength, ScaleControl, type ScaleOptions } from './ui/scale.ts';\nexport { SearchControl, type SearchOptions } from './ui/search.ts';\nexport { setRequestHeaders } from './util/requests.ts';\nexport type { RoofMode } from './util/roofs.ts';\nexport { sunPosition } from './util/sun.ts';\nexport type {\n Camera,\n NetworkStats,\n PickHit,\n PickResult,\n PointCloudInfo,\n PointCloudPoint,\n PointCloudStats,\n RasterLayerStats,\n Tiles3dStats,\n} from './wasm/isard_webgpu.js';\n"]}
Binary file
Binary file
Binary file
Binary file
package/dist/map.d.ts CHANGED
@@ -268,7 +268,7 @@ export declare class GeoMap {
268
268
  setRotateAroundPointer(enabled: boolean): void;
269
269
  /** What is drawn under a screen point (CSS pixels), on the relief or standing on it (a roof, a wall, a mesh): its
270
270
  * position and its height above the relief, in metres; undefined where nothing was drawn. Read from the last copy of
271
- * the scene's depth (a frame or two old, a pixel every 4 CSS pixels): at once, without waiting for the GPU */
271
+ * the scene's depth (taken once the camera stops, a pixel every 4 CSS pixels): at once, without waiting for the GPU */
272
272
  pickSurface(point: Point): {
273
273
  lonLat: LonLat;
274
274
  height: number;
package/dist/map.js CHANGED
@@ -824,7 +824,7 @@ export class GeoMap {
824
824
  }
825
825
  /** What is drawn under a screen point (CSS pixels), on the relief or standing on it (a roof, a wall, a mesh): its
826
826
  * position and its height above the relief, in metres; undefined where nothing was drawn. Read from the last copy of
827
- * the scene's depth (a frame or two old, a pixel every 4 CSS pixels): at once, without waiting for the GPU */
827
+ * the scene's depth (taken once the camera stops, a pixel every 4 CSS pixels): at once, without waiting for the GPU */
828
828
  pickSurface(point) {
829
829
  const hit = this.engine.surface(point[0], point[1]);
830
830
  return hit && { lonLat: [hit[0], hit[1]], height: hit[2] };
package/dist/map.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAuB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,WAAW,EAA2B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAuB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EACL,eAAe,EAGf,SAAS,EACT,OAAO,EACP,UAAU,EACV,YAAY,EACZ,OAAO,GACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAA6B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAyB,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EACL,WAAW,EAEX,WAAW,EAEX,SAAS,EAET,SAAS,EACT,SAAS,EAET,SA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ChD,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACvC,oEAAoE;QACpE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["/**\n * The map: canvas, camera, layers, events, overlays, credits and the frame loop. Frames are drawn on demand only: an\n * idle map costs nothing. Hover events are coalesced to one per frame, so the values computed for a mouse position are\n * drawn in the same frame. The engine's loading is in engine-loader.ts, its settings from the options in settings.ts,\n * the camera animations in animation.ts; the parts of the map with a state of their own (the drawing order of the\n * layers, the overlays and controls, the frame loop, the hover picking, the workers…) in map/.\n */\n\nimport { SEA } from './basemap/basemaps.ts';\nimport { type PmtilesOptions, pmtilesLayer } from './basemap/pmtileslayer.ts';\nimport { VectorTiles, type VectorTilesOptions } from './basemap/vectortiles.ts';\nimport { type BasemapWorkers, defaultWorkerUrl } from './basemap/workerpool.ts';\nimport {\n destroyedEngine,\n type EngineClass,\n type EngineKind,\n engineUrl,\n gridUrl,\n loadEngine,\n rendererKind,\n tessUrl,\n} from './engine-loader.ts';\nimport { IGN_PRESETS } from './geoplateforme.ts';\nimport type { Grid } from './grids.ts';\nimport { CustomLayer, type CustomLayerInterface } from './layers/custom.ts';\nimport { ExtrusionLayer, type ExtrusionOptions, extrusionStyle } from './layers/extrusions.ts';\nimport {\n CircleLayer,\n type CircleOptions,\n circleStyle,\n type Feature,\n FillLayer,\n type FillOptions,\n fillStyle,\n LineLayer,\n type LineOptions,\n lineStyle,\n} from './layers/features.ts';\nimport { FlowLayer, type FlowOptions } from './layers/flow.ts';\nimport type { Glyphs } from './layers/glyphs.ts';\nimport { GroundLayer, type GroundOptions } from './layers/ground.ts';\nimport type { Icons, ImageOptions, Pixels } from './layers/icons.ts';\nimport type { Layer } from './layers/layers.ts';\nimport { ModelLayer, type ModelOptions } from './layers/models.ts';\nimport { NetworkLayer } from './layers/network.ts';\nimport { loadPanoramas, type PanoramaOptions, type Panoramas } from './layers/panoramas.ts';\nimport { addPhoto, type PhotoOptions } from './layers/photos.ts';\nimport { PointCloudLayer, type PointCloudOptions } from './layers/pointclouds.ts';\nimport { RasterLayer } from './layers/raster.ts';\nimport { SymbolLayer, type SymbolOptions, symbolStyle } from './layers/symbols.ts';\nimport { Tiles3dLayer } from './layers/tiles3d.ts';\nimport { addTrees, type TreeOptions } from './layers/trees.ts';\nimport { VectorLayer } from './layers/vectors.ts';\nimport { BasemapLayers } from './map/basemap-layers.ts';\nimport { createCanvas, labelCanvas, watchContext, watchPixelRatio } from './map/canvas.ts';\nimport { checkBasemap, report, validateNetwork } from './map/checks.ts';\nimport { applyClipVolume, ClipVolumeHandles } from './map/clip-volume.ts';\nimport { Credits } from './map/credits.ts';\nimport { mapSettings, sendHeaders } from './map/engine-settings.ts';\nimport { MapEngines } from './map/engines.ts';\nimport { MapListeners } from './map/events.ts';\nimport { FrameLoop } from './map/frame-loop.ts';\nimport { HoverPick, type HoverPicking, pickOnce } from './map/hover-pick.ts';\nimport { addSpec, type LayerSpec } from './map/layer-spec.ts';\nimport { LayerStack } from './map/layer-stack.ts';\nimport { OverlayHost } from './map/overlay-host.ts';\nimport { panoramaHost } from './map/panorama-host.ts';\nimport { QUALITY, type QualitySettings, QualityWatch, startLevel } from './map/quality.ts';\nimport { rasterSource } from './map/raster-source.ts';\nimport { SymbolAtlases } from './map/symbol-atlases.ts';\nimport { applyViewshed } from './map/viewshed.ts';\nimport { MapWorkers } from './map/workers.ts';\nimport { atmosphereSettings, rgb, type Settings, terrainSettings } from './settings.ts';\nimport type {\n AnimationOptions,\n AtmosphereOptions,\n Basemap,\n CelestialBody,\n ClipVolume,\n FeatureHit,\n FirstPersonView,\n FitBoundsOptions,\n FitBox,\n FlyToOptions,\n GeoMapOptions,\n LoadingMode,\n LonLat,\n MapEvents,\n MapGpuTimings,\n MapMemory,\n NetworkOptions,\n PickOptions,\n Point,\n Projection,\n Quality,\n RasterOptions,\n SunOptions,\n SwipeOptions,\n TerrainModel,\n TerrainOptions,\n Tiles3dOptions,\n ViewshedOptions,\n} from './types.ts';\nimport { AttributionControl, type Control, type ControlPosition } from './ui/controls.ts';\nimport { Interaction } from './ui/interaction.ts';\nimport type { Positioned } from './ui/overlay.ts';\nimport { easeTo, flyTo, type Step } from './util/animation.ts';\nimport { RAD } from './util/geo.ts';\nimport { clamp } from './util/math.ts';\nimport { onHeaderRules } from './util/requests.ts';\nimport { sunPosition } from './util/sun.ts';\nimport type { Camera, Engine, PickHit, RasterLayerStats } from './wasm/isard_webgpu.js';\n\nexport type { LayerSpec } from './map/layer-spec.ts';\n\n/** Where a map of the Earth opens without a camera given: Saint-Mandé, the IGN's home, its streets in view; of another\n * body, all of it */\nconst EARTH_START: Camera = { center: [2.4246, 48.8457], zoom: 13, pitch: 0, bearing: 0 };\nconst BODY_START: Camera = { center: [0, 0], zoom: 2, pitch: 0, bearing: 0 };\n\n/** The eye's pitch at street level (degrees from straight down): off the vertical, where its heading means nothing */\nconst FIRST_PERSON_PITCH: [min: number, max: number] = [1, 179];\n\n/** The eye's field of view at street level (degrees): from a telephoto to a wide angle, the projection still sane */\nconst FIRST_PERSON_FOV: [min: number, max: number] = [10, 140];\n\n/** The least GPU memory budget a lost device leaves the map (bytes, `lighten`) */\nconst MIN_MEMORY = 64 * 2 ** 20;\n\n/** A network's defaults: the values past which it is unreached (half an hour of travel, in seconds), its halo's\n * opacity at the middle of a line (a glow, not a second line) */\nconst NETWORK_MAX = 1800;\nconst NETWORK_HALO_OPACITY = 0.11;\n\n/** A layer whose picked features come back with their properties (lines, circles, fills, extrusions, 3D Tiles…) */\nconst hasFeatures = (layer: Layer): layer is Layer & { featureAt(index: number): Feature | undefined } =>\n 'featureAt' in layer && typeof layer.featureAt === 'function';\n\n/** A map (see `GeoMap.create`); layers take it as their host */\n/** The parts of a frame by their code in the engine's GPU timings (`Engine.gpuTimings`) */\nconst GPU_PARTS = ['backdrop', 'ground', 'layer', 'shadows', 'panorama', 'viewshed'] as const;\n\n/** Turns the GPU timing of an engine on or off: whether it times, false for an engine built without it (only a build to\n * profile has `setGpuTiming`) */\nconst engineGpuTiming = (engine: Engine, on: boolean): boolean => {\n const set: unknown = Reflect.get(engine, 'setGpuTiming');\n\n return typeof set === 'function' && Reflect.apply(set, engine, [on]) === true;\n};\n\nexport class GeoMap {\n readonly canvas: HTMLCanvasElement;\n #engine: Engine;\n /** The frames' parts timed on the GPU (`setGpuTiming`), again on a new engine */\n private gpuTiming = false;\n /** The work the map waits on before it is idle (`track`) */\n #working = 0;\n /** The engine, made asynchronously, and the workers decoding its 3D Tiles */\n private readonly engines: MapEngines;\n /** The layers in drawing order and those kept on top */\n private readonly stack = new LayerStack(() => this.#engine);\n /** The basemap and the hillshade */\n private readonly basemaps: BasemapLayers;\n /** The glyphs and icons of the symbol layers */\n private readonly atlases: SymbolAtlases;\n /** The workers of the vector tiles, the relief and the reprojected rasters */\n private readonly workers: MapWorkers;\n private readonly container: HTMLElement;\n /** The canvas in the container, the markers and popups over it, the controls in its corners */\n private readonly overlays: OverlayHost;\n private readonly settings: Settings;\n /** @internal Where the basemap workers load the tessellation module from (`isard_tess_bg.wasm`) */\n readonly tessUrl: string;\n /** @internal Where the workers load the grid module from (`isard_grid_bg.wasm`) */\n readonly gridUrl: string;\n /** The GPU is lost (the WebGL context, the WebGPU device): nothing is drawn until a new engine is there */\n private lost = false;\n private gone = false;\n private readonly listeners = new MapListeners();\n /** Frames drawn on demand, with their events */\n private readonly frames: FrameLoop;\n private readonly resizeObserver: ResizeObserver;\n private readonly interaction: Interaction | undefined;\n /** The map is of the Earth: a basemap by default */\n private readonly earth: boolean;\n /** The body, as the option named it */\n private readonly body: CelestialBody | undefined;\n /** Credits of the raster layers that have some, and the attribution controls told when they change */\n private readonly credits = new Credits();\n /** The picking for 'hoverfeature', its answer emitted on a later frame */\n private readonly hoverPick = new HoverPick(\n () => this.engine,\n () => this.lost,\n (result) =>\n this.emit('hoverfeature', {\n point: [result.x, result.y],\n lonLat: result.lonLat,\n hit: result.hit && this.featureHit(result.hit),\n }),\n );\n /** What 'hoverfeature' looks for: within `radius` CSS pixels, in `layers` only if given */\n hoverPicking: HoverPicking = {};\n /** Vector tiles made by `vectorTiles()`, destroyed with the map */\n private readonly vectorSets = new Set<VectorTiles>();\n /** Stops watching the device pixel ratio */\n private readonly unwatchRatio: () => void;\n /** Stops following the page's request headers (`setRequestHeaders`) */\n private unwatchHeaders: () => void = () => undefined;\n /** Stops listening to the canvas's context loss and restoration */\n private readonly unwatchContext: () => void;\n\n /** Loads the engine (once per page) and creates a map filling `container` */\n static async create(container: HTMLElement, given: GeoMapOptions = {}): Promise<GeoMap> {\n // A preset under the options given\n const options: GeoMapOptions = given.preset ? { ...IGN_PRESETS[given.preset], ...given } : given;\n // Before anything is created\n if (options.basemap !== undefined) checkBasemap(options.basemap);\n\n // The engine on wgpu (#146): WebGPU, else wgpu's WebGL2 fallback\n const kind = await rendererKind(options.renderer);\n const bindings = await loadEngine(kind, engineUrl(kind, options));\n const map = new GeoMap(container, options, bindings.Engine, kind);\n\n // Its device asked for: the map started on a placeholder meanwhile, its layers created on the engine once it is\n // there (as after a context loss)\n map.adopt(await map.engines.create(map.canvas, () => map.requestRender(), map.settings));\n\n // A profiling script's page (`window.__isardProfile` set before isard loads): its maps, to time\n if (Reflect.get(globalThis, '__isardProfile')) {\n const maps: unknown = Reflect.get(globalThis, '__isardMaps');\n\n Reflect.set(globalThis, '__isardMaps', [...(Array.isArray(maps) ? maps : []), map]);\n }\n\n return map;\n }\n\n private constructor(container: HTMLElement, options: GeoMapOptions, engineClass: EngineClass, renderer: EngineKind) {\n this.engines = new MapEngines(engineClass, renderer, options);\n\n const workerUrl = options.basemapWorkerUrl ?? defaultWorkerUrl(options.assetsUrl);\n\n this.tessUrl = tessUrl(options);\n this.gridUrl = gridUrl(options);\n\n this.workers = new MapWorkers(\n workerUrl,\n options.workers,\n () => this.gone,\n this,\n () => this.quality.workers,\n );\n this.basemaps = new BasemapLayers(this, this.stack, workerUrl, options.basemapTileSize);\n this.container = container;\n this.canvas = createCanvas();\n // The engine takes the canvas for itself: it says how large a texture its device takes\n this.atlases = new SymbolAtlases(\n () => this.#engine.maxTextureSize(),\n options.glyphs,\n () => this.#engine,\n );\n this.overlays = new OverlayHost(container, this.canvas, this);\n this.earth = (options.body ?? 'earth') === 'earth';\n this.body = options.body;\n this.settings = mapSettings(options, this.earth, this.workers.terrainLoader);\n this.frames = new FrameLoop(\n {\n engine: () => this.engine,\n camera: () => this.getCamera(),\n lost: () => this.lost,\n interacting: () => this.interaction?.active === true,\n customLayers: () => this.layers.some((layer) => layer instanceof CustomLayer),\n working: () => this.#working > 0,\n drawn: (hovered) => {\n this.qualityWatch?.frame(performance.now(), this.movingNow);\n // The picking pass sees the frame just drawn; its answer comes on a later frame\n if (hovered && this.listeners.has('hoverfeature')) this.hoverPick.request(hovered, this.hoverPicking);\n // Overlays follow the frame just drawn\n this.overlays.positionAll();\n },\n },\n this.listeners,\n );\n // The engine is made asynchronously (`GeoMap.create` adopts it): a placeholder meanwhile\n this.#engine = destroyedEngine(EARTH_START);\n // Once it has an engine: a map whose creation failed before is not left following them\n this.unwatchHeaders = onHeaderRules((rules) => sendHeaders(this.#engine, rules));\n // The browser may take the GPU away (driver reset, background tab on mobile): the map waits, then rebuilds. A\n // WebGPU device lost is watched with each engine (`adopt`)\n this.unwatchContext = watchContext(\n this.canvas,\n () => this.gpuLost(),\n () => this.restore(),\n );\n\n const start = this.earth ? EARTH_START : BODY_START;\n\n this.setCamera({ ...start, ...options });\n this.setBasemap(options.basemap ?? (this.earth ? 'osm-positron' : 'none'), options.hillshade ?? 0);\n if (options.sun) this.setSun(options.sun);\n this.resizeObserver = new ResizeObserver(() => this.resize());\n this.resizeObserver.observe(container);\n this.#quality = startLevel(options.quality);\n if (options.quality === 'auto') {\n this.qualityWatch = new QualityWatch('high', (level) => this.applyQuality(level));\n // The frames measured are those of a move\n this.on('movestart', () => {\n this.movingNow = true;\n });\n this.on('moveend', () => {\n this.movingNow = false;\n });\n }\n this.unwatchRatio = watchPixelRatio(() => this.resize());\n this.resize();\n\n const interactive = options.interactive ?? true;\n const keyboard = interactive && (options.keyboard ?? true);\n\n this.interaction = interactive ? new Interaction(this, { keyboard }) : undefined;\n labelCanvas(this.canvas, keyboard, options.ariaLabel ?? 'Map');\n\n const attribution = options.attributionControl ?? true;\n\n if (attribution !== false) {\n this.addControl(new AttributionControl(attribution === true ? {} : attribution), 'bottom-right');\n }\n }\n\n /** The element the map was created in */\n getContainer(): HTMLElement {\n return this.container;\n }\n\n getCanvas(): HTMLCanvasElement {\n return this.canvas;\n }\n\n /** @internal The engine (replaced after a context loss) */\n get engine(): Engine {\n return this.#engine;\n }\n\n /** Layers in drawing order (bottom first) */\n private get layers(): readonly Layer[] {\n return this.stack.layers;\n }\n\n /** Layers new layers go under */\n private get onTop(): Set<Layer> {\n return this.stack.onTop;\n }\n\n /** WebGPU devices lost so far: each one makes the next engine lighter (`lighten`) */\n #losses = 0;\n\n /** What the map draws through: `'webgpu'`, or `'webgl2'` (the fallback of a browser without WebGPU, or of a device\n * WebGPU kept losing) */\n get renderer(): 'webgpu' | 'webgl2' {\n return this.engines.renderer;\n }\n\n /** The GPU is lost: nothing drawn, the engine dropped (`dropLostEngine`) */\n private gpuLost(): void {\n this.lost = true;\n this.frames.cancel();\n this.dropLostEngine();\n }\n\n /**\n * Follows the loss of `engine`'s WebGPU device (a phone taking its memory back, a driver reset, the GPU process\n * gone): while it is the map's, the map drops it and makes a new one at once, WebGPU having no event for the GPU\n * given back, lighter so as not to lose it again (`lighten`). The device of an engine the map freed itself\n * (replaced, the map destroyed) is lost too: not the map's any more, left be\n */\n private watchDevice(engine: Engine): void {\n void engine\n .gpuDevice()\n ?.lost.then(async (info) => {\n if (this.gone || this.#engine !== engine) return;\n this.gpuLost();\n\n const recovery = await this.lighten();\n\n console.warn(\n `isard: the GPU device was lost (${info.reason}: ${info.message}), the map made again (${recovery})`,\n );\n this.emit('gpulost', { reason: info.reason, message: info.message, losses: this.#losses, recovery });\n this.restore();\n })\n // The fallback's module not loaded: told, as a failed restore is\n .catch(report);\n }\n\n /**\n * After a device lost, the next engine lighter, the same scene then holding less: at the first loss the low quality\n * (one pixel a CSS pixel, no sun's shadows, one worker, fewer tiles far away) and half the GPU memory budget; at the\n * next one, the WebGL2 fallback (a phone whose WebGPU keeps losing its device: Safari's GPU process taking its\n * memory back) and half the budget again. What it did: `'lighter'` or `'webgl2'`\n */\n private async lighten(): Promise<'lighter' | 'webgl2'> {\n this.#losses += 1;\n this.settings.memory = Math.max(MIN_MEMORY, this.settings.memory / 2);\n if (this.#losses === 1 || this.engines.renderer === 'webgl2') {\n this.qualityWatch = undefined;\n this.applyQuality('low');\n\n return 'lighter';\n }\n await this.engines.fallBack();\n\n return 'webgl2';\n }\n\n /**\n * The context is lost: its engine freed at once, the map's calls going to one that does nothing until `restore`\n * builds the next. The old engine's GPU objects went with the context: deleted now, it is silent (on the context\n * restored, each one warns); its 3D Tiles downloads stop. Its layers' updates meanwhile (a tile uploaded, labels)\n * would fail on the lost context, whose limits read 0\n */\n private dropLostEngine(): void {\n this.hoverPick.cancel();\n\n const camera = this.getCamera();\n\n this.#engine.free();\n this.#engine = destroyedEngine(camera);\n // Glyph ranges and icons arriving meanwhile upload to it, not to the freed engine\n this.atlases.attach(this.#engine);\n }\n\n /** After the GPU lost: a new engine with the same camera, settings and layers (same handles, same order); the engine\n * made asynchronously, adopted once there */\n private restore(): void {\n if (this.gone) return;\n\n const make = () => this.engines.create(this.canvas, () => this.requestRender(), this.settings);\n\n make()\n .catch(async (error: unknown) => {\n // WebGPU giving no new device after a loss (an adapter refused): the WebGL2 fallback\n if (this.engines.renderer === 'webgl2') throw error;\n console.warn(`isard: no new WebGPU device (${String(error)}), the map made again through WebGL2`);\n await this.engines.fallBack();\n this.emit('gpulost', { reason: 'unknown', message: String(error), losses: this.#losses, recovery: 'webgl2' });\n\n return make();\n })\n .then((engine) => this.adopt(engine))\n .catch(report);\n }\n\n /** A new engine in place of the map's (a placeholder, or a lost one): the same camera, settings and layers (same\n * handles, same order) */\n private adopt(engine: Engine): void {\n if (this.gone) {\n engine.free();\n\n return;\n }\n this.hoverPick.cancel();\n\n const camera = this.getCamera();\n\n this.#engine.free();\n this.#engine = engine;\n this.lost = false;\n this.watchDevice(engine);\n // Still timed (profiling)\n if (this.gpuTiming) engineGpuTiming(engine, true);\n this.setCamera(camera);\n this.atlases.attach(this.#engine);\n this.stack.reattach(this.#engine);\n this.applySwipe();\n // A street-level eye stays one in the new engine\n if (this.#firstPerson) this.setFirstPerson(this.#firstPerson);\n // What the old engine drew over the scene: the viewshed, the sun's shadows, the panoramas shown\n if (this.viewshed) this.setViewshed(this.viewshed);\n applyClipVolume(this.engine, this.clipVolume, this.settings.body.radius);\n if (this.sun) this.setSun(this.sun);\n this.panoramaSets.forEach((set) => {\n if (set.current) void set.show(set.current.index).catch(report);\n });\n this.resize();\n this.requestRender();\n }\n\n /** The street-level eye, while there is one (`setFirstPerson`) */\n #firstPerson: Required<FirstPersonView> | undefined;\n\n /** The street-level eye, if the camera is one */\n get firstPerson(): Readonly<Required<FirstPersonView>> | undefined {\n return this.#firstPerson;\n }\n\n /**\n * Puts the camera at street level: an eye `height` metres above the ground, looking `bearing` and `pitch`, the\n * drag turning it around (the wheel narrows or widens its field of view); undefined gives back the camera turning\n * around a point, above where the eye stood, facing the same way\n */\n setFirstPerson(view: FirstPersonView | undefined): void {\n if (!view) {\n const was = this.#firstPerson;\n\n this.#firstPerson = undefined;\n if (was) this.setCamera({ center: was.lonLat, zoom: 18, pitch: 60, bearing: was.bearing });\n\n return;\n }\n\n const lonLat: LonLat = [view.lonLat[0], view.lonLat[1]];\n const eye = { height: 1.7, pitch: 90, fov: 75, ...view, lonLat };\n\n eye.pitch = clamp(eye.pitch, ...FIRST_PERSON_PITCH);\n eye.fov = clamp(eye.fov, ...FIRST_PERSON_FOV);\n eye.bearing = ((eye.bearing % 360) + 360) % 360;\n this.#firstPerson = eye;\n this.engine.setFirstPerson(eye.lonLat[0], eye.lonLat[1], eye.height, eye.bearing, eye.pitch, eye.fov);\n this.requestRender();\n }\n\n /** The swipe set (`setSwipe`), applied again with the layers' ids of a new engine */\n private swipe: SwipeOptions | undefined;\n\n /**\n * Compares two states of a place: `layers` shown on one side of a vertical line only, at `position` CSS pixels\n * from the left of the map (left of it by default, `side: 'right'` for the other), the layers beneath them on the\n * other side; `other`: layers shown on the other side only (two meshes of a place, each on its side). Set again as\n * the line moves (a slider, a drag); undefined stops\n */\n setSwipe(options: SwipeOptions | undefined): void {\n const used = options && (options.layers.length > 0 || (options.other?.length ?? 0) > 0);\n\n this.swipe = used ? { ...options, layers: [...options.layers], other: [...(options.other ?? [])] } : undefined;\n this.applySwipe();\n this.requestRender();\n }\n\n private applySwipe(): void {\n const s = this.swipe;\n const idsOf = (layers: readonly Layer[] | undefined) =>\n Uint32Array.from(\n (layers ?? []).filter((l) => l.id >= 0),\n (l) => l.id,\n );\n const ids = idsOf(s?.layers);\n const others = idsOf(s?.other);\n const shown = ids.length > 0 || others.length > 0;\n\n this.engine.setSwipe(s && shown ? s.position : Number.NaN, s?.side === 'right', ids, others);\n }\n\n /** @internal Forgets a removed layer */\n detach(layer: Layer): void {\n this.stack.forget(layer);\n this.credits.forget(layer);\n }\n\n /** @internal The layer is on the map */\n hasLayer(layer: Layer): boolean {\n return !this.gone && this.stack.has(layer);\n }\n\n private addLayer<L extends Layer>(layer: L): L {\n try {\n layer.attach(this.engine);\n } catch (error) {\n // A context lost before the browser says so (its event comes later): nothing could be made on it, the layer is\n // made with the others on the next engine (`restore`). Any other failure is the caller's\n if (!this.contextLost()) throw error;\n }\n // Under the layers kept on top (the basemap's labels)\n this.stack.add(layer);\n this.requestRender();\n\n return layer;\n }\n\n /** Whether the canvas's WebGL context is lost, its event come or not */\n private contextLost(): boolean {\n // On a WebGPU canvas, no WebGL context: null, nothing taken\n return this.lost || this.canvas.getContext('webgl2')?.isContextLost() === true;\n }\n\n /** @internal Keeps a layer above the layers added after it (they go under it), as the labels of a basemap */\n keepOnTop(layer: Layer): void {\n this.onTop.add(layer);\n }\n\n /** @internal Moves a layer under `before`, or on top of all */\n moveLayer(layer: Layer, before: Layer | undefined): void {\n this.stack.move(layer, before);\n this.requestRender();\n }\n\n /** @internal See `LayerHost.replaceLayer` */\n replaceLayer(layer: Layer, old: number): void {\n this.stack.replace(layer, old);\n }\n\n // ── Events ──\n\n /** Listens to an event; returns the function that stops listening */\n on<K extends keyof MapEvents>(type: K, listener: (event: MapEvents[K]) => void): () => void {\n return this.listeners.on(type, listener);\n }\n\n /** @internal Calls the listeners; one that throws is reported and does not stop the others nor the frame */\n emit<K extends keyof MapEvents>(type: K, event: MapEvents[K]): void {\n this.listeners.emit(type, event);\n }\n\n // ── Camera ──\n\n #quality: Quality = 'high';\n /** 'auto': the frames watched, the map stepped down while they stay slow */\n private qualityWatch: QualityWatch | undefined;\n private movingNow = false;\n\n /** The map's quality: `'high'`, `'medium'` or `'low'` (as `GeoMapOptions.quality` says; `'auto'` the level it\n * stepped down to) */\n getQuality(): Quality {\n return this.#quality;\n }\n\n /** @internal What its quality draws */\n get quality(): QualitySettings {\n return QUALITY[this.#quality];\n }\n\n /** Sets the map's quality (`GeoMapOptions.quality`); `'auto'` starts again from `'high'` */\n setQuality(quality: Quality | 'auto'): void {\n this.qualityWatch = quality === 'auto' ? new QualityWatch('high', (level) => this.applyQuality(level)) : undefined;\n this.applyQuality(quality === 'auto' ? 'high' : quality);\n }\n\n private applyQuality(quality: Quality): void {\n if (quality === this.#quality) return;\n this.#quality = quality;\n // The canvas at its pixel ratio, the sun's shadows, the layers' detail\n this.resize();\n if (this.sun) this.setSun(this.sun);\n this.layers.forEach((layer) => {\n layer.qualityChanged();\n });\n this.emit('quality', { quality });\n this.requestRender();\n }\n\n getCamera(): Camera {\n return this.frames.camera ?? this.engine.camera();\n }\n\n setCamera(camera: Partial<Camera>): void {\n const c = { ...this.getCamera(), ...camera };\n\n this.engine.setCamera(c.center[0], c.center[1], c.zoom, c.pitch, c.bearing);\n this.requestRender();\n }\n\n /** Animated move to a camera: over `duration` milliseconds (or the options), ease-out by default */\n easeTo(camera: Partial<Camera>, options: number | AnimationOptions = 600): void {\n const from = this.getCamera();\n const to = { ...from, ...camera };\n\n this.animate(easeTo(() => this.engine, from, to, options));\n // The destination's tiles load during the flight (as Cesium does)\n this.engine.preload(to.center[0], to.center[1], to.zoom, to.pitch, to.bearing);\n }\n\n /**\n * Flight to a camera that zooms out on its way and back in (van Wijk and Nuij's optimal path, as MapLibre's\n * `flyTo`): long moves stay readable. Pitch and bearing follow the progress.\n */\n flyTo(camera: Partial<Camera>, options: FlyToOptions = {}): void {\n const from = this.getCamera();\n const to = { ...from, ...camera };\n const viewport = Math.max(this.canvas.clientWidth, this.canvas.clientHeight);\n\n this.animate(flyTo(() => this.engine, from, to, viewport, options));\n this.engine.preload(to.center[0], to.center[1], to.zoom, to.pitch, to.bearing);\n }\n\n /**\n * Moves the camera to frame a box: a ground box (`[west, south, east, north]`), or a box in space (a building, a\n * pipe underground: `{ bounds, bottom, top }`, altitudes in metres), all its corners within the canvas less the\n * padding, at the pitch and bearing given (default the current ones); an ease, a flight with `fly`, a jump with\n * `duration: 0`\n */\n fitBounds(box: FitBox | FitBox['bounds'], options: FitBoundsOptions = {}): void {\n const { bounds, bottom = 0, top = bottom } = Array.isArray(box) ? { bounds: box } : box;\n const current = this.getCamera();\n const room = options.padding ?? 40;\n const padding =\n typeof room === 'number'\n ? [room, room, room, room]\n : [room.top ?? 0, room.right ?? 0, room.bottom ?? 0, room.left ?? 0];\n const camera = this.engine.fitCamera(\n Float64Array.from(bounds),\n bottom,\n top,\n Float64Array.from(padding),\n options.pitch ?? current.pitch,\n options.bearing ?? current.bearing,\n );\n\n if (!camera) throw new Error('isard: fitBounds needs a box, west not past east nor south past north');\n\n const to = { ...camera, zoom: Math.min(camera.zoom, options.maxZoom ?? Number.POSITIVE_INFINITY) };\n\n if (options.duration === 0) this.setCamera(to);\n else if (options.fly) this.flyTo(to, options);\n else this.easeTo(to, { duration: 600, ...options });\n }\n\n /** Height of the RAF20 geoid above the ellipsoid at a position (metres; 0 away from mainland France): what turns an\n * altitude (NGF-IGN69: the BD TOPO's, the RGE ALTI's) into a height above the ellipsoid (`fitBounds`, `refine`) */\n geoidHeight([lon, lat]: LonLat): number {\n return this.engines.geoidHeight(lon, lat);\n }\n\n /** Longitudes and latitudes the view covers on the ground: `[west, south, east, north]` */\n getBounds(): [west: number, south: number, east: number, north: number] {\n const [west = -180, south = -85, east = 180, north = 85] = this.engine.bounds();\n\n return [west, south, east, north];\n }\n\n /** Lowest zoom the camera accepts (the widest view) */\n setMinZoom(zoom: number): void {\n this.settings.zoomRange[0] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n setMaxZoom(zoom: number): void {\n this.settings.zoomRange[1] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n /** Highest pitch, degrees, up to 85 */\n setMaxPitch(pitch: number): void {\n this.settings.maxPitch = pitch;\n this.engine.setMaxPitch(pitch);\n this.requestRender();\n }\n\n /** Sky over the plane and the fog of the ground (see `GeoMapOptions.atmosphere`); undefined to remove them */\n setAtmosphere(options: AtmosphereOptions | undefined): void {\n this.settings.atmosphere = atmosphereSettings(options);\n this.engine.setAtmosphere(this.settings.atmosphere);\n this.requestRender();\n }\n\n setProjection(projection: Projection): void {\n this.settings.globe = projection === 'globe';\n this.engine.setGlobe(this.settings.globe);\n this.requestRender();\n }\n\n /** How tiles load and show (see `LoadingMode`) */\n setLoading(mode: LoadingMode): void {\n this.settings.loading = mode;\n this.engine.setImmediateLoading(mode === 'immediate');\n this.requestRender();\n }\n\n /** Space behind the globe (stars, atmosphere halo) */\n setSky(enabled: boolean): void {\n this.settings.sky = enabled;\n this.engine.setSky(enabled);\n this.requestRender();\n }\n\n /** The viewshed set, set again in a new engine */\n private viewshed: ViewshedOptions | readonly ViewshedOptions[] | undefined;\n\n /** The sun set, set again in a new engine */\n private sun: SunOptions | undefined;\n\n /**\n * The sun casting shadows: the buildings, trees, models, 3D Tiles and the relief shade the ground and one another,\n * the walls turned away from it are in their own shade; the labels stay over them. The sun stands where it is at\n * `date` over the map's center (now by default), or at `azimuth` and `altitude`. As it sets the night falls (`night`\n * to set it by hand): the scene tinted in its blue, the windows of the buildings and the streets of `vectors()` lit,\n * the labels light on dark.\n * The shadows cover the ground around the view's center, fading out away from it, and cost two more depth passes\n * of the solid scene each frame. Undefined removes them\n */\n setSun(options: SunOptions | undefined): void {\n this.sun = options;\n if (!options) {\n this.engine.setSun(Number.NaN, Number.NaN, 0, 0);\n this.requestRender();\n\n return;\n }\n\n const { azimuth, altitude } =\n options.azimuth !== undefined && options.altitude !== undefined\n ? { azimuth: options.azimuth, altitude: options.altitude }\n : sunPosition(options.date ?? new Date(), this.getCamera().center);\n // The twilight: from 6° above the horizon to 6° under it, smoothly\n const dusk = Math.min(1, Math.max(0, (6 - altitude) / 12));\n const night = Math.min(1, Math.max(0, options.night ?? dusk * dusk * (3 - 2 * dusk)));\n // The shadows fade with the sun's light; none at a low quality (its light and the night stay)\n const opacity = this.quality.shadows ? Math.min(1, Math.max(0, options.opacity ?? 0.35)) * (1 - night) : 0;\n\n this.engine.setSun(azimuth, altitude, opacity, night);\n this.requestRender();\n }\n\n /** Tints what can be seen from a point and what is hidden from it, within a range, all around or within a cone\n * (`direction`): the relief, extrusions, 3D Tiles and models hide what lies behind them (only what the map has\n * loaded for its view). Several observers (16 at most): what any of them sees is seen, what is hidden from all those\n * that reach it is hidden, in the colors and opacity of the first. Undefined or none removes it */\n setViewshed(options: ViewshedOptions | readonly ViewshedOptions[] | undefined): void {\n this.viewshed = options;\n if (applyViewshed(this.engine, options)) this.requestRender();\n }\n\n private clipVolume: ClipVolume | undefined;\n /** The clipping volume's handles over the map, while it has them */\n private clipHandles: ClipVolumeHandles | undefined;\n\n /** Cuts the 3D layers (models, 3D Tiles, extrusions, point clouds) by a volume, a box, a cylinder or a prism on a\n * polygon: what lies inside it, or outside it (`cut`), the faces the cut opens filled; with `handles`, sized and\n * moved with the pointer (`'clipvolume'` tells each change). Undefined removes it */\n setClipVolume(volume: ClipVolume | undefined): void {\n this.clipVolume = volume;\n applyClipVolume(this.engine, volume, this.settings.body.radius);\n if (volume?.handles) {\n this.clipHandles ??= this.addClipHandles(volume);\n this.clipHandles.set(volume);\n this.overlays.position(this.clipHandles);\n } else if (this.clipHandles) {\n this.overlays.detach(this.clipHandles, this.clipHandles.element);\n this.clipHandles = undefined;\n }\n this.requestRender();\n }\n\n /** The clipping volume set (`setClipVolume`), as its handles left it */\n getClipVolume(): ClipVolume | undefined {\n return this.clipVolume;\n }\n\n private addClipHandles(volume: ClipVolume): ClipVolumeHandles {\n const handles = new ClipVolumeHandles(\n {\n project: (lonLat, height) => this.project(lonLat, height),\n unproject: (point) => this.unproject(point),\n elevationAt: (lonLat) => this.elevationAt(lonLat),\n getCanvas: () => this.canvas,\n moved: (moved) => {\n this.setClipVolume(moved);\n this.emit('clipvolume', moved);\n },\n },\n volume,\n this.settings.body.radius,\n );\n\n this.overlays.attach(handles, handles.element);\n\n return handles;\n }\n\n /** Relief under the basemap: true for the body's terrain model (on the Earth the worldwide Terrain Tiles, NASA's\n * on the Moon and Mars), one of the Earth's models by name (`'ign'`), its options, or false; on another body, its\n * options with a `url` */\n setTerrain(terrain: boolean | TerrainModel | TerrainOptions): void {\n this.settings.terrain = terrainSettings(terrain, this.body, this.settings.body.radius, this.workers.terrainLoader);\n\n const t = this.settings.terrain;\n\n this.engine.setTerrain(t?.url, t?.exaggeration ?? 1, t?.maxZoom, t?.geoid, t?.loader);\n this.credits.changed();\n this.requestRender();\n }\n\n /** @internal Whether a relief is under the basemap: the fills of vector tiles drawn as geometry need their prisms */\n get hasRelief(): boolean {\n return this.settings.terrain !== undefined;\n }\n\n /** @internal The credits of the raster layers (the basemap first) and of the relief in use, each once */\n attributions(): string[] {\n return this.credits.of(this.layers, this.settings.terrain?.attribution);\n }\n\n /** @internal Calls `listener` when the credits change; returns what stops it */\n onAttributionChange(listener: () => void): () => void {\n return this.credits.onChange(listener);\n }\n\n /** Color behind the map, a CSS color (its alpha ignored) */\n setBackground(color: string): void {\n this.settings.background = rgb(color);\n this.engine.setBackground(...this.settings.background);\n this.requestRender();\n }\n\n /** The GPU memory its layers hold (bytes): the tiles of the 3D Tiles and point clouds, kept within the budget\n * (`GeoMapOptions.memory`), the rasters' pools */\n memory(): MapMemory {\n // Two numbers a layer, its id and its bytes, the relief's (id 0) last\n const pairs = this.engine.memory();\n const byId = new Map(Array.from({ length: pairs.length / 2 }, (_, i) => [pairs[2 * i], pairs[2 * i + 1] ?? 0]));\n const layers = this.layers.flatMap((layer) => {\n const bytes = layer.id >= 0 ? byId.get(layer.id) : undefined;\n\n return bytes === undefined ? [] : [{ layer, bytes }];\n });\n\n return {\n budget: this.settings.memory,\n held: [...byId.values()].reduce((sum, bytes) => sum + bytes, 0),\n layers,\n };\n }\n\n /** Tile counters of the raster layers, for diagnostics */\n stats(): RasterLayerStats[] {\n return this.engine.stats();\n }\n\n /** Times the parts of each frame on the GPU, for profiling (`gpuTimings`): timer queries, read a few frames later.\n * An engine built to profile only (`PROFILE=1 bun run build`); false without one, or if the browser cannot\n * (`EXT_disjoint_timer_query_webgl2`) */\n setGpuTiming(on: boolean): boolean {\n this.gpuTiming = engineGpuTiming(this.engine, on);\n\n return this.gpuTiming;\n }\n\n /** The GPU time of the last frame measured (`setGpuTiming`), in all and by part: the backdrop, the ground (the raster\n * layers over the relief), each layer, the shadows, the panorama, the viewshed (ms) */\n gpuTimings(): MapGpuTimings | undefined {\n // The frame's number, then each part's code, layer id (-1 for none) and milliseconds\n const read: unknown = Reflect.get(this.engine, 'gpuTimings');\n const flat: unknown = typeof read === 'function' ? Reflect.apply(read, this.engine, []) : undefined;\n\n if (!(flat instanceof Float64Array) || flat.length === 0) return undefined;\n\n const parts = Array.from({ length: (flat.length - 1) / 3 }, (_, k) => {\n const [code = 0, id = -1, ms = 0] = flat.subarray(1 + k * 3, 4 + k * 3);\n const layer = id >= 0 ? this.layers.find((l) => l.id === id) : undefined;\n\n return { part: GPU_PARTS[code] ?? 'layer', ms, ...(layer && { layer }) };\n });\n\n return { frame: flat[0] ?? 0, ms: parts.reduce((sum, p) => sum + p.ms, 0), parts };\n }\n\n /**\n * The feature under a screen point (CSS pixels), undefined if none: its layer id and index. Reads the pixels around\n * the point of an offscreen picking pass, whatever the number of features, once the GPU is done (a frame or two\n * later: the GPU is not waited for). On hover, listen to 'hoverfeature' instead.\n */\n async pick(point: Point, { radius = 0, layers }: PickOptions = {}): Promise<PickHit | undefined> {\n const only = layers && Uint32Array.from(layers.map((l) => l.id));\n\n return (await pickOnce(() => this.engine, point, radius, only))?.hit;\n }\n\n /**\n * The feature under a screen point (CSS pixels), or the nearest one within `radius` pixels: its layer handle, its\n * index there and, for line, circle and fill layers, the feature itself; undefined if none. `layers` restricts the\n * search to some layers (the others hide nothing).\n */\n async pickFeature(point: Point, options: PickOptions = {}): Promise<FeatureHit | undefined> {\n const hit = await this.pick(point, options);\n\n return hit && this.featureHit(hit);\n }\n\n /** A hit with its layer handle and feature; undefined if the layer is gone */\n private featureHit(hit: PickHit): FeatureHit | undefined {\n const layer = this.layers.find((l) => l.id === hit.layer);\n\n if (!layer) return undefined;\n\n const feature = hasFeatures(layer) ? layer.featureAt(hit.index) : undefined;\n\n return { layer, index: hit.index, feature };\n }\n\n /** Screen point (CSS pixels) of a position on the ground (the relief), or `height` metres above it, undefined\n * behind the camera */\n project(lonLat: LonLat, height = 0): Point | undefined {\n return this.engine.project(lonLat[0], lonLat[1], height);\n }\n\n /** Position under a screen point (CSS pixels), undefined above the horizon */\n unproject(point: Point): LonLat | undefined {\n return this.engine.ground(point[0], point[1]);\n }\n\n /**\n * Street-level panoramas (oriented images of a vehicle's cameras, the iTowns immersive format): their positions\n * and calibrations loaded, none shown until `show`, which projects one onto the scene around it\n */\n async addPanoramas(options: PanoramaOptions): Promise<Panoramas> {\n const host = panoramaHost(this, (lon, lat) => this.engines.geoidHeight(lon, lat));\n const panoramas = await loadPanoramas(host, options);\n\n this.panoramaSets.add(panoramas);\n panoramas.whenRemoved.push(() => {\n this.panoramaSets.delete(panoramas);\n });\n\n return panoramas;\n }\n\n /** The panorama sets, their panorama shown again in a new engine */\n private readonly panoramaSets = new Set<Panoramas>();\n\n /** Altitude of the relief at a position, in metres (exaggeration included): from the copy of its tiles the map\n * keeps, as fine as the tiles loaded there; undefined without relief or where none is loaded yet */\n elevationAt(lonLat: LonLat): number | undefined {\n return this.engine.elevationAt(lonLat[0], lonLat[1]);\n }\n\n /** Metres on the ground per CSS pixel at a screen point (default the center of the map), across the screen: for a\n * scale bar; undefined above the horizon */\n metersPerPixel(point?: Point): number | undefined {\n const [x, y] = point ?? [this.canvas.clientWidth / 2, this.canvas.clientHeight / 2];\n const a = this.unproject([x - 0.5, y]);\n const b = this.unproject([x + 0.5, y]);\n\n if (!a || !b) return undefined;\n\n // Haversine, on the mean radius of the body\n const [dLat, dLon] = [(b[1] - a[1]) * RAD, (b[0] - a[0]) * RAD];\n const h = Math.sin(dLat / 2) ** 2 + Math.cos(a[1] * RAD) * Math.cos(b[1] * RAD) * Math.sin(dLon / 2) ** 2;\n\n return 2 * this.settings.body.radius * Math.asin(Math.min(1, Math.sqrt(h)));\n }\n\n /** Whether a double click zooms in (Shift: out), on by default: off while a drawing takes double clicks */\n setDoubleClickZoom(enabled: boolean): void {\n if (this.interaction) this.interaction.doubleClickZoom = enabled;\n }\n\n /** Whether a drag that turns and tilts the map (right button, Ctrl or Shift) goes around what is under the pointer\n * where it starts, a roof or a mesh as the relief (on by default), or around the screen center */\n setRotateAroundPointer(enabled: boolean): void {\n if (this.interaction) this.interaction.rotateAroundPointer = enabled;\n }\n\n /** What is drawn under a screen point (CSS pixels), on the relief or standing on it (a roof, a wall, a mesh): its\n * position and its height above the relief, in metres; undefined where nothing was drawn. Read from the last copy of\n * the scene's depth (a frame or two old, a pixel every 4 CSS pixels): at once, without waiting for the GPU */\n pickSurface(point: Point): { lonLat: LonLat; height: number } | undefined {\n const hit = this.engine.surface(point[0], point[1]);\n\n return hit && { lonLat: [hit[0], hit[1]], height: hit[2] };\n }\n\n /** The height above the relief, in metres, of the top of what stands at a position: a roof, a mesh, 0 on the bare\n * ground; undefined where nothing of the last frame is there, or until measured: the scene is drawn looking down at\n * it after a frame and read back a frame or two later, the answer kept and measured again every 250 ms at most (ask\n * again on the next `render` event) */\n surfaceAt(lonLat: LonLat): number | undefined {\n return this.engine.surfaceAt(lonLat[0], lonLat[1]);\n }\n\n // ── Overlays and controls ──\n\n /** Adds a control in a corner of the map; controls stack from the corner inward */\n addControl(control: Control, position: ControlPosition = 'top-right'): this {\n this.overlays.addControl(control, position);\n\n return this;\n }\n\n removeControl(control: Control): this {\n this.overlays.removeControl(control);\n\n return this;\n }\n\n /** @internal Shows a marker or popup, placed after every frame from now on */\n attachOverlay(item: Positioned, element: HTMLElement): void {\n this.overlays.attach(item, element);\n }\n\n /** @internal */\n detachOverlay(item: Positioned, element: HTMLElement): void {\n this.overlays.detach(item, element);\n }\n\n /** @internal Places one overlay now (it moved), without drawing a frame */\n positionOverlay(item: Positioned): void {\n this.overlays.position(item);\n }\n\n // ── Layers ──\n\n /** Replaces the basemap and the IGN hillshade, under the other layers (hillshade by default: 0, none). The former\n * names of the Géoplateforme basemaps throw, naming the new ones */\n setBasemap(basemap: Basemap, hillshade = 0): void {\n const name = checkBasemap(basemap);\n\n this.basemaps.replace(name);\n // Off the Earth, the body's own color\n if (this.earth) this.settings.globeColor = SEA[name];\n this.engine.setGlobeColor(...this.settings.globeColor);\n this.basemaps.addHillshade(hillshade);\n this.credits.changed();\n }\n\n /** Raster tiles ({z}, {x}, {y} URL; Web Mercator, or reprojected from another `grid`: longitudes and latitudes,\n * Lambert-93, UTM…), over the layers already added */\n addRaster(options: RasterOptions): RasterLayer {\n const { url, opacity = 1, saturation = 1, size, before, ground = true } = options;\n const { loader, minZoom, maxZoom } = rasterSource(options, this.workers.remoteReprojection);\n const layer = new RasterLayer(this, { url, minZoom, maxZoom, opacity, saturation, size, loader, ground });\n\n this.place(layer, before);\n if (options.attribution) this.credits.set(layer, options.attribution);\n\n return layer;\n }\n\n /**\n * A PMTiles archive (v3) read by range requests: a raster layer of its images, or vector tiles drawn with `style` (by\n * default a plain style of the archive's layers) with their labels. Its header decides which unless `kind` says;\n * `url` with or without `pmtiles://`, relative to the page, or a `blob:` URL. `addRaster({ url: 'pmtiles://…' })` and\n * a style source `pmtiles://…` in `vectorTiles` read archives too\n */\n addPmtiles(options: PmtilesOptions): Promise<RasterLayer | VectorTiles> {\n return pmtilesLayer(this, options);\n }\n\n /** Line network colored by a value per node; `layer.setValues` recolors it in one texture upload */\n addNetwork(options: NetworkOptions): NetworkLayer {\n const { nodes, edges, lines, costs, edgeWidths, width = 2, max = NETWORK_MAX, contour = 0, opacity = 1 } = options;\n const {\n halo = 0,\n haloOpacity = NETWORK_HALO_OPACITY,\n ramp,\n unreachedColor = 'rgba(140, 140, 140, 0.25)',\n fade = 0,\n } = options;\n const style = { width, max, contour, opacity, halo, haloOpacity, ramp, unreachedColor, fade };\n\n validateNetwork(nodes, edges);\n\n return this.place(new NetworkLayer(this, { nodes, edges, lines }, costs, style, edgeWidths), options.before);\n }\n\n /**\n * A layer from its description, as an application's configuration gives it: `{ type, ...options }`, the options of\n * the `add…` method of that type (`'lines'` for `addLines`, `'tiles3d'` for `addTiles3d`…); `before` to go under\n * another layer. The layer's `ready` resolves once the map has drawn it\n */\n add<P = Record<string, unknown>>(spec: LayerSpec<P>): Layer {\n return addSpec<P>(this, spec);\n }\n\n /** @internal A layer made anew from its description, in the place of `old` in the drawing order (old removed) */\n rebuildLayer<P = Record<string, unknown>>(old: Layer, spec: LayerSpec<P>): Layer {\n const index = this.layers.indexOf(old);\n // The first layer above that goes not with it: its companions are removed with it\n const above = index >= 0 ? this.layers.slice(index + 1).find((l) => !old.companions.includes(l)) : undefined;\n const layer = this.add(spec);\n\n if (!('before' in spec && spec.before) && index >= 0) layer.moveBefore(above);\n old.remove();\n\n return layer;\n }\n\n /**\n * @internal Work the map waits on before it is idle (the vector tiles cut in the workers, uploaded over frames): the\n * engine knows only the tiles it holds, not those coming (an engine made anew holds none until the workers cut them\n * again from their cache, no request on the network meanwhile); a frame once it is done, to tell\n */\n track<T>(work: Promise<T>): Promise<T> {\n this.#working += 1;\n\n const done = () => {\n this.#working -= 1;\n this.requestRender();\n };\n\n work.then(done, done);\n\n return work;\n }\n\n /** @internal Resolves once the map is idle (everything in view loaded and drawn) */\n whenIdle(): Promise<void> {\n if (this.gone) return Promise.resolve();\n\n return new Promise((resolve) => {\n const off = this.on('idle', () => {\n off();\n resolve();\n });\n\n this.frames.requestIdle();\n });\n }\n\n /** Lines from GeoJSON (line strings, and polygon outlines), styled per feature */\n addLines<P = Record<string, unknown>>(options: LineOptions<P>): LineLayer<P> {\n return this.place(\n new LineLayer<P>(this, options.data, lineStyle(options), options.altitudeReference),\n options.before,\n );\n }\n\n /** Discs from GeoJSON points, styled per feature */\n addCircles<P = Record<string, unknown>>(options: CircleOptions<P>): CircleLayer<P> {\n return this.place(new CircleLayer<P>(this, options.data, circleStyle(options)), options.before);\n }\n\n /** Filled polygons from GeoJSON (holes included), styled per feature; over the relief they lie on the ground */\n addFills<P = Record<string, unknown>>(options: FillOptions<P>): FillLayer<P> {\n return this.place(new FillLayer<P>(this, options.data, fillStyle(options)), options.before);\n }\n\n /** The application's fragment shader over the ground (see `GroundOptions`); under `before` if given */\n addGround(options: GroundOptions): GroundLayer {\n return this.place(new GroundLayer(this, options), options.before);\n }\n\n /** Polygons raised into blocks with depth (buildings), styled per feature; tiles of them come with `setTile` */\n addExtrusions<P = Record<string, unknown>>(options: ExtrusionOptions<P> = {}): ExtrusionLayer<P> {\n return this.place(\n new ExtrusionLayer<P>(this, options.data, extrusionStyle(options), options.drape),\n options.before,\n );\n }\n\n /** Text labels from GeoJSON (points, the middle of lines, the center of polygons), placed without overlaps */\n addSymbols<P = Record<string, unknown>>(options: SymbolOptions<P>): SymbolLayer<P> {\n return this.place(new SymbolLayer<P>(this, options.data, symbolStyle(options)), options.before);\n }\n\n /** @internal The glyphs of the symbol layers, loaded on first use */\n get glyphs(): Glyphs {\n return this.atlases.glyphs;\n }\n\n /** @internal The icons of the symbol layers: the application's images and the vector basemaps' sprites */\n get icons(): Icons {\n return this.atlases.icons;\n }\n\n /**\n * An image for the symbol layers' icons (`icon: name`), as MapLibre's `addImage`: its pixels (an image, a canvas,\n * `ImageData`, or RGBA bytes with their size), `pixelRatio` 2 for an image drawn at twice its CSS size; `sdf` for a\n * signed distance field drawn in the `iconColor`; `stretchX`, `stretchY` and `content` for an icon stretched around its\n * text. An image of the same name is replaced\n */\n addImage(\n name: string,\n image: Pixels | (CanvasImageSource & { width: number; height: number }),\n options: ImageOptions = {},\n ): void {\n this.atlases.addImage(name, image, options);\n }\n\n hasImage(name: string): boolean {\n return this.atlases.hasImage(name);\n }\n\n removeImage(name: string): void {\n this.atlases.removeImage(name);\n }\n\n /**\n * Vector tiles with a MapLibre style (OpenFreeMap's Positron by default): `tiles.raster(…)` draws its fills and lines\n * (or a subset) as a raster layer, `tiles.vectors(…)` as geometry, `tiles.labels(…)` its labels.\n * `setBasemap('osm-positron')` draws the basemap with a raster layer and the labels.\n */\n vectorTiles(options: VectorTilesOptions = {}): VectorTiles {\n const tiles = new VectorTiles(this, {\n ...(this.workers.url ? { workerUrl: this.workers.url } : {}),\n ...options,\n });\n\n // Its workers stop with the map\n this.vectorSets.add(tiles);\n\n return tiles;\n }\n\n /** @internal The geometry of a `VectorTiles` (`vectors`), under `before` if given */\n addVectorLayer(before?: Layer): VectorLayer {\n return this.place(new VectorLayer(this), before);\n }\n\n /** @internal Forgets a destroyed `VectorTiles` */\n dropVectorTiles(tiles: VectorTiles): void {\n this.vectorSets.delete(tiles);\n }\n\n /**\n * @internal The workers for a `VectorTiles`: the map's shared pool, or a pool of its own (`own`, to stop with it)\n * when it asks for another count or URL\n */\n basemapWorkers(count?: number, url?: string | URL): { pool: BasemapWorkers; own: boolean } {\n return this.workers.pool(count, url);\n }\n\n /** Adds a layer, under `before` if given */\n private place<L extends Layer>(layer: L, before: Layer | undefined): L {\n this.addLayer(layer);\n if (before) this.moveLayer(layer, before);\n\n return layer;\n }\n\n /** Textured meshes in 3D Tiles (photogrammetry, buildings), drawn with depth over the basemap */\n addTiles3d(options: Tiles3dOptions): Tiles3dLayer {\n const {\n url,\n maxScreenSpaceError = 16,\n opacity = 1,\n pointSize,\n color,\n geoid = false,\n facades = false,\n drape,\n } = options;\n\n return this.place(\n new Tiles3dLayer(\n this,\n url,\n geoid,\n {\n maxScreenSpaceError,\n opacity,\n ...(pointSize !== undefined ? { pointSize } : {}),\n ...(color !== undefined ? { color } : {}),\n },\n facades,\n drape,\n ),\n options.before,\n );\n }\n\n /**\n * A point cloud (see `PointCloudOptions`): a COPC file read by range requests (IGN's LiDAR HD…), or 3D Tiles\n * points; with depth; under `before` if given\n */\n addPointCloud(options: PointCloudOptions): PointCloudLayer {\n return this.place(new PointCloudLayer(this, options), options.before);\n }\n\n /**\n * The grids of a GRIB2 or classic NetCDF file (its URL, or its bytes): a weather or ocean model's fields on grids of\n * longitudes and latitudes, read in a worker by the grid module (loaded with the first file). GRIB2 on a regular\n * latitude/longitude grid, packed simply, in groups or in groups of spatial differences (NOAA's GFS); NetCDF-3 with\n * the CF conventions. `windFields` pairs a wind's components into the fields of `addFlow`\n */\n readGrids(source: string | URL | ArrayBuffer | Uint8Array, options: { signal?: AbortSignal } = {}): Promise<Grid[]> {\n return this.workers.readGrids(source, this.gridUrl, options.signal);\n }\n\n /** Particles carried by a field of velocities (a wind, a current), their trails animated and colored by speed on\n * the globe and the relief (see `FlowOptions`) */\n addFlow(options: FlowOptions): FlowLayer {\n return this.place(new FlowLayer(this, options), options.before);\n }\n\n /** A glTF model drawn at positions (see `ModelOptions`), with depth */\n addModels(options: ModelOptions): ModelLayer {\n return this.place(new ModelLayer(this, options), options.before);\n }\n\n /** Trees at the points of a source that has them (a city's street trees), broadleaved or conifers by their data,\n * scaled to their height (see `TreeOptions`); the conifers on a layer that goes with the one returned */\n addTrees<P = Record<string, unknown>>(options: TreeOptions<P>): ModelLayer {\n return addTrees((o) => this.addModels(o), options);\n }\n\n /** A photo standing where it was taken, facing its way (see `PhotoOptions`): flat on a frame across its field of\n * view, a 360° one on a band round its camera; resolves once its image is read */\n addPhoto(options: PhotoOptions): Promise<ModelLayer> {\n return addPhoto((o) => this.addModels(o), options);\n }\n\n /**\n * The page's own WebGPU drawing at its place among the layers, in every frame (see `CustomLayerInterface`): raw\n * WebGPU, three.js's WebGPU renderer… with the map's device and the matrices of the frame (`frame.matrixAt`); under\n * `before` if given. Not drawn on the WebGL2 fallback\n */\n addCustomLayer(layer: CustomLayerInterface, options: { before?: Layer } = {}): CustomLayer {\n const custom = new CustomLayer(\n this,\n layer,\n this,\n (lon, lat, altitude) => this.engines.customMatrix(lon, lat, altitude),\n () => this.getCamera(),\n );\n\n return this.place(custom, options.before);\n }\n\n // ── Frames ──\n\n /** Asks for a frame; several calls before the next frame draw it once */\n requestRender(): void {\n this.frames.request();\n }\n\n /** @internal Runs `step` every frame until it returns false; replaces the running animation */\n animate(step: Step | undefined): void {\n this.frames.animate(step);\n }\n\n /** @internal The pointer moved over the map (undefined: it left). Without 'hover' and 'hoverfeature' listeners,\n * nothing is drawn: a still map stays idle under a moving mouse */\n hover(point: Point | undefined): void {\n if (!point) {\n this.frames.hover(undefined);\n this.hoverPick.cancel();\n\n return;\n }\n if (!this.listeners.has('hover') && !this.listeners.has('hoverfeature')) return;\n this.frames.hover(point);\n this.requestRender();\n }\n\n private resize(): void {\n if (this.lost) return;\n\n const { clientWidth: width, clientHeight: height } = this.canvas;\n const ratio = Math.min(window.devicePixelRatio || 1, this.quality.pixelRatio);\n\n this.canvas.width = Math.round(width * ratio);\n this.canvas.height = Math.round(height * ratio);\n this.engine.resize(width, height, ratio);\n this.overlays.size = [width, height];\n this.emit('resize', { width, height });\n // Draw at once: a resized canvas is cleared, waiting one frame would flash\n this.frames.drawNow();\n }\n\n destroy(): void {\n if (this.gone) return;\n this.gone = true;\n // A context restored later rebuilds nothing\n this.unwatchContext();\n\n const camera = this.getCamera();\n\n this.frames.stop();\n this.hoverPick.cancel();\n this.basemaps.destroy();\n [...this.vectorSets].forEach((tiles) => {\n tiles.remove();\n });\n this.vectorSets.clear();\n this.workers.terminate();\n this.unwatchRatio();\n this.unwatchHeaders();\n this.resizeObserver.disconnect();\n this.interaction?.destroy();\n this.engines.destroy();\n // Custom layers free their GPU objects, models their data, while the device is there\n this.stack.dispose();\n this.engine.free();\n // Work still under way (labels being shaped, tiles arriving, timers) may call the engine after this: it finds one\n // that does nothing, and nothing is drawn again\n this.#engine = destroyedEngine(camera);\n // Glyph ranges still arriving upload to it, not to the freed engine\n this.atlases.attach(this.#engine);\n this.lost = true;\n this.overlays.destroy();\n this.listeners.clear();\n }\n}\n"]}
1
+ {"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAuB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,WAAW,EAA2B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAuB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EACL,eAAe,EAGf,SAAS,EACT,OAAO,EACP,UAAU,EACV,YAAY,EACZ,OAAO,GACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAA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AAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACvB,qFAAqF;QACrF,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACnB,kHAAkH;QAClH,gDAAgD;QAChD,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACvC,oEAAoE;QACpE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["/**\n * The map: canvas, camera, layers, events, overlays, credits and the frame loop. Frames are drawn on demand only: an\n * idle map costs nothing. Hover events are coalesced to one per frame, so the values computed for a mouse position are\n * drawn in the same frame. The engine's loading is in engine-loader.ts, its settings from the options in settings.ts,\n * the camera animations in animation.ts; the parts of the map with a state of their own (the drawing order of the\n * layers, the overlays and controls, the frame loop, the hover picking, the workers…) in map/.\n */\n\nimport { SEA } from './basemap/basemaps.ts';\nimport { type PmtilesOptions, pmtilesLayer } from './basemap/pmtileslayer.ts';\nimport { VectorTiles, type VectorTilesOptions } from './basemap/vectortiles.ts';\nimport { type BasemapWorkers, defaultWorkerUrl } from './basemap/workerpool.ts';\nimport {\n destroyedEngine,\n type EngineClass,\n type EngineKind,\n engineUrl,\n gridUrl,\n loadEngine,\n rendererKind,\n tessUrl,\n} from './engine-loader.ts';\nimport { IGN_PRESETS } from './geoplateforme.ts';\nimport type { Grid } from './grids.ts';\nimport { CustomLayer, type CustomLayerInterface } from './layers/custom.ts';\nimport { ExtrusionLayer, type ExtrusionOptions, extrusionStyle } from './layers/extrusions.ts';\nimport {\n CircleLayer,\n type CircleOptions,\n circleStyle,\n type Feature,\n FillLayer,\n type FillOptions,\n fillStyle,\n LineLayer,\n type LineOptions,\n lineStyle,\n} from './layers/features.ts';\nimport { FlowLayer, type FlowOptions } from './layers/flow.ts';\nimport type { Glyphs } from './layers/glyphs.ts';\nimport { GroundLayer, type GroundOptions } from './layers/ground.ts';\nimport type { Icons, ImageOptions, Pixels } from './layers/icons.ts';\nimport type { Layer } from './layers/layers.ts';\nimport { ModelLayer, type ModelOptions } from './layers/models.ts';\nimport { NetworkLayer } from './layers/network.ts';\nimport { loadPanoramas, type PanoramaOptions, type Panoramas } from './layers/panoramas.ts';\nimport { addPhoto, type PhotoOptions } from './layers/photos.ts';\nimport { PointCloudLayer, type PointCloudOptions } from './layers/pointclouds.ts';\nimport { RasterLayer } from './layers/raster.ts';\nimport { SymbolLayer, type SymbolOptions, symbolStyle } from './layers/symbols.ts';\nimport { Tiles3dLayer } from './layers/tiles3d.ts';\nimport { addTrees, type TreeOptions } from './layers/trees.ts';\nimport { VectorLayer } from './layers/vectors.ts';\nimport { BasemapLayers } from './map/basemap-layers.ts';\nimport { createCanvas, labelCanvas, watchContext, watchPixelRatio } from './map/canvas.ts';\nimport { checkBasemap, report, validateNetwork } from './map/checks.ts';\nimport { applyClipVolume, ClipVolumeHandles } from './map/clip-volume.ts';\nimport { Credits } from './map/credits.ts';\nimport { mapSettings, sendHeaders } from './map/engine-settings.ts';\nimport { MapEngines } from './map/engines.ts';\nimport { MapListeners } from './map/events.ts';\nimport { FrameLoop } from './map/frame-loop.ts';\nimport { HoverPick, type HoverPicking, pickOnce } from './map/hover-pick.ts';\nimport { addSpec, type LayerSpec } from './map/layer-spec.ts';\nimport { LayerStack } from './map/layer-stack.ts';\nimport { OverlayHost } from './map/overlay-host.ts';\nimport { panoramaHost } from './map/panorama-host.ts';\nimport { QUALITY, type QualitySettings, QualityWatch, startLevel } from './map/quality.ts';\nimport { rasterSource } from './map/raster-source.ts';\nimport { SymbolAtlases } from './map/symbol-atlases.ts';\nimport { applyViewshed } from './map/viewshed.ts';\nimport { MapWorkers } from './map/workers.ts';\nimport { atmosphereSettings, rgb, type Settings, terrainSettings } from './settings.ts';\nimport type {\n AnimationOptions,\n AtmosphereOptions,\n Basemap,\n CelestialBody,\n ClipVolume,\n FeatureHit,\n FirstPersonView,\n FitBoundsOptions,\n FitBox,\n FlyToOptions,\n GeoMapOptions,\n LoadingMode,\n LonLat,\n MapEvents,\n MapGpuTimings,\n MapMemory,\n NetworkOptions,\n PickOptions,\n Point,\n Projection,\n Quality,\n RasterOptions,\n SunOptions,\n SwipeOptions,\n TerrainModel,\n TerrainOptions,\n Tiles3dOptions,\n ViewshedOptions,\n} from './types.ts';\nimport { AttributionControl, type Control, type ControlPosition } from './ui/controls.ts';\nimport { Interaction } from './ui/interaction.ts';\nimport type { Positioned } from './ui/overlay.ts';\nimport { easeTo, flyTo, type Step } from './util/animation.ts';\nimport { RAD } from './util/geo.ts';\nimport { clamp } from './util/math.ts';\nimport { onHeaderRules } from './util/requests.ts';\nimport { sunPosition } from './util/sun.ts';\nimport type { Camera, Engine, PickHit, RasterLayerStats } from './wasm/isard_webgpu.js';\n\nexport type { LayerSpec } from './map/layer-spec.ts';\n\n/** Where a map of the Earth opens without a camera given: Saint-Mandé, the IGN's home, its streets in view; of another\n * body, all of it */\nconst EARTH_START: Camera = { center: [2.4246, 48.8457], zoom: 13, pitch: 0, bearing: 0 };\nconst BODY_START: Camera = { center: [0, 0], zoom: 2, pitch: 0, bearing: 0 };\n\n/** The eye's pitch at street level (degrees from straight down): off the vertical, where its heading means nothing */\nconst FIRST_PERSON_PITCH: [min: number, max: number] = [1, 179];\n\n/** The eye's field of view at street level (degrees): from a telephoto to a wide angle, the projection still sane */\nconst FIRST_PERSON_FOV: [min: number, max: number] = [10, 140];\n\n/** The least GPU memory budget a lost device leaves the map (bytes, `lighten`) */\nconst MIN_MEMORY = 64 * 2 ** 20;\n\n/** A network's defaults: the values past which it is unreached (half an hour of travel, in seconds), its halo's\n * opacity at the middle of a line (a glow, not a second line) */\nconst NETWORK_MAX = 1800;\nconst NETWORK_HALO_OPACITY = 0.11;\n\n/** A layer whose picked features come back with their properties (lines, circles, fills, extrusions, 3D Tiles…) */\nconst hasFeatures = (layer: Layer): layer is Layer & { featureAt(index: number): Feature | undefined } =>\n 'featureAt' in layer && typeof layer.featureAt === 'function';\n\n/** A map (see `GeoMap.create`); layers take it as their host */\n/** The parts of a frame by their code in the engine's GPU timings (`Engine.gpuTimings`) */\nconst GPU_PARTS = ['backdrop', 'ground', 'layer', 'shadows', 'panorama', 'viewshed'] as const;\n\n/** Turns the GPU timing of an engine on or off: whether it times, false for an engine built without it (only a build to\n * profile has `setGpuTiming`) */\nconst engineGpuTiming = (engine: Engine, on: boolean): boolean => {\n const set: unknown = Reflect.get(engine, 'setGpuTiming');\n\n return typeof set === 'function' && Reflect.apply(set, engine, [on]) === true;\n};\n\nexport class GeoMap {\n readonly canvas: HTMLCanvasElement;\n #engine: Engine;\n /** The frames' parts timed on the GPU (`setGpuTiming`), again on a new engine */\n private gpuTiming = false;\n /** The work the map waits on before it is idle (`track`) */\n #working = 0;\n /** The engine, made asynchronously, and the workers decoding its 3D Tiles */\n private readonly engines: MapEngines;\n /** The layers in drawing order and those kept on top */\n private readonly stack = new LayerStack(() => this.#engine);\n /** The basemap and the hillshade */\n private readonly basemaps: BasemapLayers;\n /** The glyphs and icons of the symbol layers */\n private readonly atlases: SymbolAtlases;\n /** The workers of the vector tiles, the relief and the reprojected rasters */\n private readonly workers: MapWorkers;\n private readonly container: HTMLElement;\n /** The canvas in the container, the markers and popups over it, the controls in its corners */\n private readonly overlays: OverlayHost;\n private readonly settings: Settings;\n /** @internal Where the basemap workers load the tessellation module from (`isard_tess_bg.wasm`) */\n readonly tessUrl: string;\n /** @internal Where the workers load the grid module from (`isard_grid_bg.wasm`) */\n readonly gridUrl: string;\n /** The GPU is lost (the WebGL context, the WebGPU device): nothing is drawn until a new engine is there */\n private lost = false;\n private gone = false;\n private readonly listeners = new MapListeners();\n /** Frames drawn on demand, with their events */\n private readonly frames: FrameLoop;\n private readonly resizeObserver: ResizeObserver;\n private readonly interaction: Interaction | undefined;\n /** The map is of the Earth: a basemap by default */\n private readonly earth: boolean;\n /** The body, as the option named it */\n private readonly body: CelestialBody | undefined;\n /** Credits of the raster layers that have some, and the attribution controls told when they change */\n private readonly credits = new Credits();\n /** The picking for 'hoverfeature', its answer emitted on a later frame */\n private readonly hoverPick = new HoverPick(\n () => this.engine,\n () => this.lost,\n (result) =>\n this.emit('hoverfeature', {\n point: [result.x, result.y],\n lonLat: result.lonLat,\n hit: result.hit && this.featureHit(result.hit),\n }),\n );\n /** What 'hoverfeature' looks for: within `radius` CSS pixels, in `layers` only if given */\n hoverPicking: HoverPicking = {};\n /** Vector tiles made by `vectorTiles()`, destroyed with the map */\n private readonly vectorSets = new Set<VectorTiles>();\n /** Stops watching the device pixel ratio */\n private readonly unwatchRatio: () => void;\n /** Stops following the page's request headers (`setRequestHeaders`) */\n private unwatchHeaders: () => void = () => undefined;\n /** Stops listening to the canvas's context loss and restoration */\n private readonly unwatchContext: () => void;\n\n /** Loads the engine (once per page) and creates a map filling `container` */\n static async create(container: HTMLElement, given: GeoMapOptions = {}): Promise<GeoMap> {\n // A preset under the options given\n const options: GeoMapOptions = given.preset ? { ...IGN_PRESETS[given.preset], ...given } : given;\n // Before anything is created\n if (options.basemap !== undefined) checkBasemap(options.basemap);\n\n // The engine on wgpu (#146): WebGPU, else wgpu's WebGL2 fallback\n const kind = await rendererKind(options.renderer);\n const bindings = await loadEngine(kind, engineUrl(kind, options));\n const map = new GeoMap(container, options, bindings.Engine, kind);\n\n // Its device asked for: the map started on a placeholder meanwhile, its layers created on the engine once it is\n // there (as after a context loss)\n map.adopt(await map.engines.create(map.canvas, () => map.requestRender(), map.settings));\n\n // A profiling script's page (`window.__isardProfile` set before isard loads): its maps, to time\n if (Reflect.get(globalThis, '__isardProfile')) {\n const maps: unknown = Reflect.get(globalThis, '__isardMaps');\n\n Reflect.set(globalThis, '__isardMaps', [...(Array.isArray(maps) ? maps : []), map]);\n }\n\n return map;\n }\n\n private constructor(container: HTMLElement, options: GeoMapOptions, engineClass: EngineClass, renderer: EngineKind) {\n this.engines = new MapEngines(engineClass, renderer, options);\n\n const workerUrl = options.basemapWorkerUrl ?? defaultWorkerUrl(options.assetsUrl);\n\n this.tessUrl = tessUrl(options);\n this.gridUrl = gridUrl(options);\n\n this.workers = new MapWorkers(\n workerUrl,\n options.workers,\n () => this.gone,\n this,\n () => this.quality.workers,\n );\n this.basemaps = new BasemapLayers(this, this.stack, workerUrl, options.basemapTileSize);\n this.container = container;\n this.canvas = createCanvas();\n // The engine takes the canvas for itself: it says how large a texture its device takes\n this.atlases = new SymbolAtlases(\n () => this.#engine.maxTextureSize(),\n options.glyphs,\n () => this.#engine,\n );\n this.overlays = new OverlayHost(container, this.canvas, this);\n this.earth = (options.body ?? 'earth') === 'earth';\n this.body = options.body;\n this.settings = mapSettings(options, this.earth, this.workers.terrainLoader);\n this.frames = new FrameLoop(\n {\n engine: () => this.engine,\n camera: () => this.getCamera(),\n lost: () => this.lost,\n interacting: () => this.interaction?.active === true,\n customLayers: () => this.layers.some((layer) => layer instanceof CustomLayer),\n working: () => this.#working > 0,\n drawn: (hovered) => {\n this.qualityWatch?.frame(performance.now(), this.movingNow);\n // The picking pass sees the frame just drawn; its answer comes on a later frame\n if (hovered && this.listeners.has('hoverfeature')) this.hoverPick.request(hovered, this.hoverPicking);\n // Overlays follow the frame just drawn\n this.overlays.positionAll();\n },\n },\n this.listeners,\n );\n // The engine is made asynchronously (`GeoMap.create` adopts it): a placeholder meanwhile\n this.#engine = destroyedEngine(EARTH_START);\n // Once it has an engine: a map whose creation failed before is not left following them\n this.unwatchHeaders = onHeaderRules((rules) => sendHeaders(this.#engine, rules));\n // The browser may take the GPU away (driver reset, background tab on mobile): the map waits, then rebuilds. A\n // WebGPU device lost is watched with each engine (`adopt`)\n this.unwatchContext = watchContext(\n this.canvas,\n () => this.gpuLost(),\n () => this.restore(),\n );\n\n const start = this.earth ? EARTH_START : BODY_START;\n\n this.setCamera({ ...start, ...options });\n this.setBasemap(options.basemap ?? (this.earth ? 'osm-positron' : 'none'), options.hillshade ?? 0);\n if (options.sun) this.setSun(options.sun);\n this.resizeObserver = new ResizeObserver(() => this.resize());\n this.resizeObserver.observe(container);\n this.#quality = startLevel(options.quality);\n if (options.quality === 'auto') {\n this.qualityWatch = new QualityWatch('high', (level) => this.applyQuality(level));\n // The frames measured are those of a move\n this.on('movestart', () => {\n this.movingNow = true;\n });\n this.on('moveend', () => {\n this.movingNow = false;\n });\n }\n this.unwatchRatio = watchPixelRatio(() => this.resize());\n this.resize();\n\n const interactive = options.interactive ?? true;\n const keyboard = interactive && (options.keyboard ?? true);\n\n this.interaction = interactive ? new Interaction(this, { keyboard }) : undefined;\n labelCanvas(this.canvas, keyboard, options.ariaLabel ?? 'Map');\n\n const attribution = options.attributionControl ?? true;\n\n if (attribution !== false) {\n this.addControl(new AttributionControl(attribution === true ? {} : attribution), 'bottom-right');\n }\n }\n\n /** The element the map was created in */\n getContainer(): HTMLElement {\n return this.container;\n }\n\n getCanvas(): HTMLCanvasElement {\n return this.canvas;\n }\n\n /** @internal The engine (replaced after a context loss) */\n get engine(): Engine {\n return this.#engine;\n }\n\n /** Layers in drawing order (bottom first) */\n private get layers(): readonly Layer[] {\n return this.stack.layers;\n }\n\n /** Layers new layers go under */\n private get onTop(): Set<Layer> {\n return this.stack.onTop;\n }\n\n /** WebGPU devices lost so far: each one makes the next engine lighter (`lighten`) */\n #losses = 0;\n\n /** What the map draws through: `'webgpu'`, or `'webgl2'` (the fallback of a browser without WebGPU, or of a device\n * WebGPU kept losing) */\n get renderer(): 'webgpu' | 'webgl2' {\n return this.engines.renderer;\n }\n\n /** The GPU is lost: nothing drawn, the engine dropped (`dropLostEngine`) */\n private gpuLost(): void {\n this.lost = true;\n this.frames.cancel();\n this.dropLostEngine();\n }\n\n /**\n * Follows the loss of `engine`'s WebGPU device (a phone taking its memory back, a driver reset, the GPU process\n * gone): while it is the map's, the map drops it and makes a new one at once, WebGPU having no event for the GPU\n * given back, lighter so as not to lose it again (`lighten`). The device of an engine the map freed itself\n * (replaced, the map destroyed) is lost too: not the map's any more, left be\n */\n private watchDevice(engine: Engine): void {\n void engine\n .gpuDevice()\n ?.lost.then(async (info) => {\n if (this.gone || this.#engine !== engine) return;\n this.gpuLost();\n\n const recovery = await this.lighten();\n\n console.warn(\n `isard: the GPU device was lost (${info.reason}: ${info.message}), the map made again (${recovery})`,\n );\n this.emit('gpulost', { reason: info.reason, message: info.message, losses: this.#losses, recovery });\n this.restore();\n })\n // The fallback's module not loaded: told, as a failed restore is\n .catch(report);\n }\n\n /**\n * After a device lost, the next engine lighter, the same scene then holding less: at the first loss the low quality\n * (one pixel a CSS pixel, no sun's shadows, one worker, fewer tiles far away) and half the GPU memory budget; at the\n * next one, the WebGL2 fallback (a phone whose WebGPU keeps losing its device: Safari's GPU process taking its\n * memory back) and half the budget again. What it did: `'lighter'` or `'webgl2'`\n */\n private async lighten(): Promise<'lighter' | 'webgl2'> {\n this.#losses += 1;\n this.settings.memory = Math.max(MIN_MEMORY, this.settings.memory / 2);\n if (this.#losses === 1 || this.engines.renderer === 'webgl2') {\n this.qualityWatch = undefined;\n this.applyQuality('low');\n\n return 'lighter';\n }\n await this.engines.fallBack();\n\n return 'webgl2';\n }\n\n /**\n * The context is lost: its engine freed at once, the map's calls going to one that does nothing until `restore`\n * builds the next. The old engine's GPU objects went with the context: deleted now, it is silent (on the context\n * restored, each one warns); its 3D Tiles downloads stop. Its layers' updates meanwhile (a tile uploaded, labels)\n * would fail on the lost context, whose limits read 0\n */\n private dropLostEngine(): void {\n this.hoverPick.cancel();\n\n const camera = this.getCamera();\n\n this.#engine.free();\n this.#engine = destroyedEngine(camera);\n // Glyph ranges and icons arriving meanwhile upload to it, not to the freed engine\n this.atlases.attach(this.#engine);\n }\n\n /** After the GPU lost: a new engine with the same camera, settings and layers (same handles, same order); the engine\n * made asynchronously, adopted once there */\n private restore(): void {\n if (this.gone) return;\n\n const make = () => this.engines.create(this.canvas, () => this.requestRender(), this.settings);\n\n make()\n .catch(async (error: unknown) => {\n // WebGPU giving no new device after a loss (an adapter refused): the WebGL2 fallback\n if (this.engines.renderer === 'webgl2') throw error;\n console.warn(`isard: no new WebGPU device (${String(error)}), the map made again through WebGL2`);\n await this.engines.fallBack();\n this.emit('gpulost', { reason: 'unknown', message: String(error), losses: this.#losses, recovery: 'webgl2' });\n\n return make();\n })\n .then((engine) => this.adopt(engine))\n .catch(report);\n }\n\n /** A new engine in place of the map's (a placeholder, or a lost one): the same camera, settings and layers (same\n * handles, same order) */\n private adopt(engine: Engine): void {\n if (this.gone) {\n engine.free();\n\n return;\n }\n this.hoverPick.cancel();\n\n const camera = this.getCamera();\n\n this.#engine.free();\n this.#engine = engine;\n this.lost = false;\n this.watchDevice(engine);\n // Still timed (profiling)\n if (this.gpuTiming) engineGpuTiming(engine, true);\n this.setCamera(camera);\n this.atlases.attach(this.#engine);\n this.stack.reattach(this.#engine);\n this.applySwipe();\n // A street-level eye stays one in the new engine\n if (this.#firstPerson) this.setFirstPerson(this.#firstPerson);\n // What the old engine drew over the scene: the viewshed, the sun's shadows, the panoramas shown\n if (this.viewshed) this.setViewshed(this.viewshed);\n applyClipVolume(this.engine, this.clipVolume, this.settings.body.radius);\n if (this.sun) this.setSun(this.sun);\n this.panoramaSets.forEach((set) => {\n if (set.current) void set.show(set.current.index).catch(report);\n });\n this.resize();\n this.requestRender();\n }\n\n /** The street-level eye, while there is one (`setFirstPerson`) */\n #firstPerson: Required<FirstPersonView> | undefined;\n\n /** The street-level eye, if the camera is one */\n get firstPerson(): Readonly<Required<FirstPersonView>> | undefined {\n return this.#firstPerson;\n }\n\n /**\n * Puts the camera at street level: an eye `height` metres above the ground, looking `bearing` and `pitch`, the\n * drag turning it around (the wheel narrows or widens its field of view); undefined gives back the camera turning\n * around a point, above where the eye stood, facing the same way\n */\n setFirstPerson(view: FirstPersonView | undefined): void {\n if (!view) {\n const was = this.#firstPerson;\n\n this.#firstPerson = undefined;\n if (was) this.setCamera({ center: was.lonLat, zoom: 18, pitch: 60, bearing: was.bearing });\n\n return;\n }\n\n const lonLat: LonLat = [view.lonLat[0], view.lonLat[1]];\n const eye = { height: 1.7, pitch: 90, fov: 75, ...view, lonLat };\n\n eye.pitch = clamp(eye.pitch, ...FIRST_PERSON_PITCH);\n eye.fov = clamp(eye.fov, ...FIRST_PERSON_FOV);\n eye.bearing = ((eye.bearing % 360) + 360) % 360;\n this.#firstPerson = eye;\n this.engine.setFirstPerson(eye.lonLat[0], eye.lonLat[1], eye.height, eye.bearing, eye.pitch, eye.fov);\n this.requestRender();\n }\n\n /** The swipe set (`setSwipe`), applied again with the layers' ids of a new engine */\n private swipe: SwipeOptions | undefined;\n\n /**\n * Compares two states of a place: `layers` shown on one side of a vertical line only, at `position` CSS pixels\n * from the left of the map (left of it by default, `side: 'right'` for the other), the layers beneath them on the\n * other side; `other`: layers shown on the other side only (two meshes of a place, each on its side). Set again as\n * the line moves (a slider, a drag); undefined stops\n */\n setSwipe(options: SwipeOptions | undefined): void {\n const used = options && (options.layers.length > 0 || (options.other?.length ?? 0) > 0);\n\n this.swipe = used ? { ...options, layers: [...options.layers], other: [...(options.other ?? [])] } : undefined;\n this.applySwipe();\n this.requestRender();\n }\n\n private applySwipe(): void {\n const s = this.swipe;\n const idsOf = (layers: readonly Layer[] | undefined) =>\n Uint32Array.from(\n (layers ?? []).filter((l) => l.id >= 0),\n (l) => l.id,\n );\n const ids = idsOf(s?.layers);\n const others = idsOf(s?.other);\n const shown = ids.length > 0 || others.length > 0;\n\n this.engine.setSwipe(s && shown ? s.position : Number.NaN, s?.side === 'right', ids, others);\n }\n\n /** @internal Forgets a removed layer */\n detach(layer: Layer): void {\n this.stack.forget(layer);\n this.credits.forget(layer);\n }\n\n /** @internal The layer is on the map */\n hasLayer(layer: Layer): boolean {\n return !this.gone && this.stack.has(layer);\n }\n\n private addLayer<L extends Layer>(layer: L): L {\n try {\n layer.attach(this.engine);\n } catch (error) {\n // A context lost before the browser says so (its event comes later): nothing could be made on it, the layer is\n // made with the others on the next engine (`restore`). Any other failure is the caller's\n if (!this.contextLost()) throw error;\n }\n // Under the layers kept on top (the basemap's labels)\n this.stack.add(layer);\n this.requestRender();\n\n return layer;\n }\n\n /** Whether the canvas's WebGL context is lost, its event come or not */\n private contextLost(): boolean {\n // On a WebGPU canvas, no WebGL context: null, nothing taken\n return this.lost || this.canvas.getContext('webgl2')?.isContextLost() === true;\n }\n\n /** @internal Keeps a layer above the layers added after it (they go under it), as the labels of a basemap */\n keepOnTop(layer: Layer): void {\n this.onTop.add(layer);\n }\n\n /** @internal Moves a layer under `before`, or on top of all */\n moveLayer(layer: Layer, before: Layer | undefined): void {\n this.stack.move(layer, before);\n this.requestRender();\n }\n\n /** @internal See `LayerHost.replaceLayer` */\n replaceLayer(layer: Layer, old: number): void {\n this.stack.replace(layer, old);\n }\n\n // ── Events ──\n\n /** Listens to an event; returns the function that stops listening */\n on<K extends keyof MapEvents>(type: K, listener: (event: MapEvents[K]) => void): () => void {\n return this.listeners.on(type, listener);\n }\n\n /** @internal Calls the listeners; one that throws is reported and does not stop the others nor the frame */\n emit<K extends keyof MapEvents>(type: K, event: MapEvents[K]): void {\n this.listeners.emit(type, event);\n }\n\n // ── Camera ──\n\n #quality: Quality = 'high';\n /** 'auto': the frames watched, the map stepped down while they stay slow */\n private qualityWatch: QualityWatch | undefined;\n private movingNow = false;\n\n /** The map's quality: `'high'`, `'medium'` or `'low'` (as `GeoMapOptions.quality` says; `'auto'` the level it\n * stepped down to) */\n getQuality(): Quality {\n return this.#quality;\n }\n\n /** @internal What its quality draws */\n get quality(): QualitySettings {\n return QUALITY[this.#quality];\n }\n\n /** Sets the map's quality (`GeoMapOptions.quality`); `'auto'` starts again from `'high'` */\n setQuality(quality: Quality | 'auto'): void {\n this.qualityWatch = quality === 'auto' ? new QualityWatch('high', (level) => this.applyQuality(level)) : undefined;\n this.applyQuality(quality === 'auto' ? 'high' : quality);\n }\n\n private applyQuality(quality: Quality): void {\n if (quality === this.#quality) return;\n this.#quality = quality;\n // The canvas at its pixel ratio, the sun's shadows, the layers' detail\n this.resize();\n if (this.sun) this.setSun(this.sun);\n this.layers.forEach((layer) => {\n layer.qualityChanged();\n });\n this.emit('quality', { quality });\n this.requestRender();\n }\n\n getCamera(): Camera {\n return this.frames.camera ?? this.engine.camera();\n }\n\n setCamera(camera: Partial<Camera>): void {\n const c = { ...this.getCamera(), ...camera };\n\n this.engine.setCamera(c.center[0], c.center[1], c.zoom, c.pitch, c.bearing);\n this.requestRender();\n }\n\n /** Animated move to a camera: over `duration` milliseconds (or the options), ease-out by default */\n easeTo(camera: Partial<Camera>, options: number | AnimationOptions = 600): void {\n const from = this.getCamera();\n const to = { ...from, ...camera };\n\n this.animate(easeTo(() => this.engine, from, to, options));\n // The destination's tiles load during the flight (as Cesium does)\n this.engine.preload(to.center[0], to.center[1], to.zoom, to.pitch, to.bearing);\n }\n\n /**\n * Flight to a camera that zooms out on its way and back in (van Wijk and Nuij's optimal path, as MapLibre's\n * `flyTo`): long moves stay readable. Pitch and bearing follow the progress.\n */\n flyTo(camera: Partial<Camera>, options: FlyToOptions = {}): void {\n const from = this.getCamera();\n const to = { ...from, ...camera };\n const viewport = Math.max(this.canvas.clientWidth, this.canvas.clientHeight);\n\n this.animate(flyTo(() => this.engine, from, to, viewport, options));\n this.engine.preload(to.center[0], to.center[1], to.zoom, to.pitch, to.bearing);\n }\n\n /**\n * Moves the camera to frame a box: a ground box (`[west, south, east, north]`), or a box in space (a building, a\n * pipe underground: `{ bounds, bottom, top }`, altitudes in metres), all its corners within the canvas less the\n * padding, at the pitch and bearing given (default the current ones); an ease, a flight with `fly`, a jump with\n * `duration: 0`\n */\n fitBounds(box: FitBox | FitBox['bounds'], options: FitBoundsOptions = {}): void {\n const { bounds, bottom = 0, top = bottom } = Array.isArray(box) ? { bounds: box } : box;\n const current = this.getCamera();\n const room = options.padding ?? 40;\n const padding =\n typeof room === 'number'\n ? [room, room, room, room]\n : [room.top ?? 0, room.right ?? 0, room.bottom ?? 0, room.left ?? 0];\n const camera = this.engine.fitCamera(\n Float64Array.from(bounds),\n bottom,\n top,\n Float64Array.from(padding),\n options.pitch ?? current.pitch,\n options.bearing ?? current.bearing,\n );\n\n if (!camera) throw new Error('isard: fitBounds needs a box, west not past east nor south past north');\n\n const to = { ...camera, zoom: Math.min(camera.zoom, options.maxZoom ?? Number.POSITIVE_INFINITY) };\n\n if (options.duration === 0) this.setCamera(to);\n else if (options.fly) this.flyTo(to, options);\n else this.easeTo(to, { duration: 600, ...options });\n }\n\n /** Height of the RAF20 geoid above the ellipsoid at a position (metres; 0 away from mainland France): what turns an\n * altitude (NGF-IGN69: the BD TOPO's, the RGE ALTI's) into a height above the ellipsoid (`fitBounds`, `refine`) */\n geoidHeight([lon, lat]: LonLat): number {\n return this.engines.geoidHeight(lon, lat);\n }\n\n /** Longitudes and latitudes the view covers on the ground: `[west, south, east, north]` */\n getBounds(): [west: number, south: number, east: number, north: number] {\n const [west = -180, south = -85, east = 180, north = 85] = this.engine.bounds();\n\n return [west, south, east, north];\n }\n\n /** Lowest zoom the camera accepts (the widest view) */\n setMinZoom(zoom: number): void {\n this.settings.zoomRange[0] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n setMaxZoom(zoom: number): void {\n this.settings.zoomRange[1] = zoom;\n this.engine.setZoomRange(...this.settings.zoomRange);\n this.requestRender();\n }\n\n /** Highest pitch, degrees, up to 85 */\n setMaxPitch(pitch: number): void {\n this.settings.maxPitch = pitch;\n this.engine.setMaxPitch(pitch);\n this.requestRender();\n }\n\n /** Sky over the plane and the fog of the ground (see `GeoMapOptions.atmosphere`); undefined to remove them */\n setAtmosphere(options: AtmosphereOptions | undefined): void {\n this.settings.atmosphere = atmosphereSettings(options);\n this.engine.setAtmosphere(this.settings.atmosphere);\n this.requestRender();\n }\n\n setProjection(projection: Projection): void {\n this.settings.globe = projection === 'globe';\n this.engine.setGlobe(this.settings.globe);\n this.requestRender();\n }\n\n /** How tiles load and show (see `LoadingMode`) */\n setLoading(mode: LoadingMode): void {\n this.settings.loading = mode;\n this.engine.setImmediateLoading(mode === 'immediate');\n this.requestRender();\n }\n\n /** Space behind the globe (stars, atmosphere halo) */\n setSky(enabled: boolean): void {\n this.settings.sky = enabled;\n this.engine.setSky(enabled);\n this.requestRender();\n }\n\n /** The viewshed set, set again in a new engine */\n private viewshed: ViewshedOptions | readonly ViewshedOptions[] | undefined;\n\n /** The sun set, set again in a new engine */\n private sun: SunOptions | undefined;\n\n /**\n * The sun casting shadows: the buildings, trees, models, 3D Tiles and the relief shade the ground and one another,\n * the walls turned away from it are in their own shade; the labels stay over them. The sun stands where it is at\n * `date` over the map's center (now by default), or at `azimuth` and `altitude`. As it sets the night falls (`night`\n * to set it by hand): the scene tinted in its blue, the windows of the buildings and the streets of `vectors()` lit,\n * the labels light on dark.\n * The shadows cover the ground around the view's center, fading out away from it, and cost two more depth passes\n * of the solid scene each frame. Undefined removes them\n */\n setSun(options: SunOptions | undefined): void {\n this.sun = options;\n if (!options) {\n this.engine.setSun(Number.NaN, Number.NaN, 0, 0);\n this.requestRender();\n\n return;\n }\n\n const { azimuth, altitude } =\n options.azimuth !== undefined && options.altitude !== undefined\n ? { azimuth: options.azimuth, altitude: options.altitude }\n : sunPosition(options.date ?? new Date(), this.getCamera().center);\n // The twilight: from 6° above the horizon to 6° under it, smoothly\n const dusk = Math.min(1, Math.max(0, (6 - altitude) / 12));\n const night = Math.min(1, Math.max(0, options.night ?? dusk * dusk * (3 - 2 * dusk)));\n // The shadows fade with the sun's light; none at a low quality (its light and the night stay)\n const opacity = this.quality.shadows ? Math.min(1, Math.max(0, options.opacity ?? 0.35)) * (1 - night) : 0;\n\n this.engine.setSun(azimuth, altitude, opacity, night);\n this.requestRender();\n }\n\n /** Tints what can be seen from a point and what is hidden from it, within a range, all around or within a cone\n * (`direction`): the relief, extrusions, 3D Tiles and models hide what lies behind them (only what the map has\n * loaded for its view). Several observers (16 at most): what any of them sees is seen, what is hidden from all those\n * that reach it is hidden, in the colors and opacity of the first. Undefined or none removes it */\n setViewshed(options: ViewshedOptions | readonly ViewshedOptions[] | undefined): void {\n this.viewshed = options;\n if (applyViewshed(this.engine, options)) this.requestRender();\n }\n\n private clipVolume: ClipVolume | undefined;\n /** The clipping volume's handles over the map, while it has them */\n private clipHandles: ClipVolumeHandles | undefined;\n\n /** Cuts the 3D layers (models, 3D Tiles, extrusions, point clouds) by a volume, a box, a cylinder or a prism on a\n * polygon: what lies inside it, or outside it (`cut`), the faces the cut opens filled; with `handles`, sized and\n * moved with the pointer (`'clipvolume'` tells each change). Undefined removes it */\n setClipVolume(volume: ClipVolume | undefined): void {\n this.clipVolume = volume;\n applyClipVolume(this.engine, volume, this.settings.body.radius);\n if (volume?.handles) {\n this.clipHandles ??= this.addClipHandles(volume);\n this.clipHandles.set(volume);\n this.overlays.position(this.clipHandles);\n } else if (this.clipHandles) {\n this.overlays.detach(this.clipHandles, this.clipHandles.element);\n this.clipHandles = undefined;\n }\n this.requestRender();\n }\n\n /** The clipping volume set (`setClipVolume`), as its handles left it */\n getClipVolume(): ClipVolume | undefined {\n return this.clipVolume;\n }\n\n private addClipHandles(volume: ClipVolume): ClipVolumeHandles {\n const handles = new ClipVolumeHandles(\n {\n project: (lonLat, height) => this.project(lonLat, height),\n unproject: (point) => this.unproject(point),\n elevationAt: (lonLat) => this.elevationAt(lonLat),\n getCanvas: () => this.canvas,\n moved: (moved) => {\n this.setClipVolume(moved);\n this.emit('clipvolume', moved);\n },\n },\n volume,\n this.settings.body.radius,\n );\n\n this.overlays.attach(handles, handles.element);\n\n return handles;\n }\n\n /** Relief under the basemap: true for the body's terrain model (on the Earth the worldwide Terrain Tiles, NASA's\n * on the Moon and Mars), one of the Earth's models by name (`'ign'`), its options, or false; on another body, its\n * options with a `url` */\n setTerrain(terrain: boolean | TerrainModel | TerrainOptions): void {\n this.settings.terrain = terrainSettings(terrain, this.body, this.settings.body.radius, this.workers.terrainLoader);\n\n const t = this.settings.terrain;\n\n this.engine.setTerrain(t?.url, t?.exaggeration ?? 1, t?.maxZoom, t?.geoid, t?.loader);\n this.credits.changed();\n this.requestRender();\n }\n\n /** @internal Whether a relief is under the basemap: the fills of vector tiles drawn as geometry need their prisms */\n get hasRelief(): boolean {\n return this.settings.terrain !== undefined;\n }\n\n /** @internal The credits of the raster layers (the basemap first) and of the relief in use, each once */\n attributions(): string[] {\n return this.credits.of(this.layers, this.settings.terrain?.attribution);\n }\n\n /** @internal Calls `listener` when the credits change; returns what stops it */\n onAttributionChange(listener: () => void): () => void {\n return this.credits.onChange(listener);\n }\n\n /** Color behind the map, a CSS color (its alpha ignored) */\n setBackground(color: string): void {\n this.settings.background = rgb(color);\n this.engine.setBackground(...this.settings.background);\n this.requestRender();\n }\n\n /** The GPU memory its layers hold (bytes): the tiles of the 3D Tiles and point clouds, kept within the budget\n * (`GeoMapOptions.memory`), the rasters' pools */\n memory(): MapMemory {\n // Two numbers a layer, its id and its bytes, the relief's (id 0) last\n const pairs = this.engine.memory();\n const byId = new Map(Array.from({ length: pairs.length / 2 }, (_, i) => [pairs[2 * i], pairs[2 * i + 1] ?? 0]));\n const layers = this.layers.flatMap((layer) => {\n const bytes = layer.id >= 0 ? byId.get(layer.id) : undefined;\n\n return bytes === undefined ? [] : [{ layer, bytes }];\n });\n\n return {\n budget: this.settings.memory,\n held: [...byId.values()].reduce((sum, bytes) => sum + bytes, 0),\n layers,\n };\n }\n\n /** Tile counters of the raster layers, for diagnostics */\n stats(): RasterLayerStats[] {\n return this.engine.stats();\n }\n\n /** Times the parts of each frame on the GPU, for profiling (`gpuTimings`): timer queries, read a few frames later.\n * An engine built to profile only (`PROFILE=1 bun run build`); false without one, or if the browser cannot\n * (`EXT_disjoint_timer_query_webgl2`) */\n setGpuTiming(on: boolean): boolean {\n this.gpuTiming = engineGpuTiming(this.engine, on);\n\n return this.gpuTiming;\n }\n\n /** The GPU time of the last frame measured (`setGpuTiming`), in all and by part: the backdrop, the ground (the raster\n * layers over the relief), each layer, the shadows, the panorama, the viewshed (ms) */\n gpuTimings(): MapGpuTimings | undefined {\n // The frame's number, then each part's code, layer id (-1 for none) and milliseconds\n const read: unknown = Reflect.get(this.engine, 'gpuTimings');\n const flat: unknown = typeof read === 'function' ? Reflect.apply(read, this.engine, []) : undefined;\n\n if (!(flat instanceof Float64Array) || flat.length === 0) return undefined;\n\n const parts = Array.from({ length: (flat.length - 1) / 3 }, (_, k) => {\n const [code = 0, id = -1, ms = 0] = flat.subarray(1 + k * 3, 4 + k * 3);\n const layer = id >= 0 ? this.layers.find((l) => l.id === id) : undefined;\n\n return { part: GPU_PARTS[code] ?? 'layer', ms, ...(layer && { layer }) };\n });\n\n return { frame: flat[0] ?? 0, ms: parts.reduce((sum, p) => sum + p.ms, 0), parts };\n }\n\n /**\n * The feature under a screen point (CSS pixels), undefined if none: its layer id and index. Reads the pixels around\n * the point of an offscreen picking pass, whatever the number of features, once the GPU is done (a frame or two\n * later: the GPU is not waited for). On hover, listen to 'hoverfeature' instead.\n */\n async pick(point: Point, { radius = 0, layers }: PickOptions = {}): Promise<PickHit | undefined> {\n const only = layers && Uint32Array.from(layers.map((l) => l.id));\n\n return (await pickOnce(() => this.engine, point, radius, only))?.hit;\n }\n\n /**\n * The feature under a screen point (CSS pixels), or the nearest one within `radius` pixels: its layer handle, its\n * index there and, for line, circle and fill layers, the feature itself; undefined if none. `layers` restricts the\n * search to some layers (the others hide nothing).\n */\n async pickFeature(point: Point, options: PickOptions = {}): Promise<FeatureHit | undefined> {\n const hit = await this.pick(point, options);\n\n return hit && this.featureHit(hit);\n }\n\n /** A hit with its layer handle and feature; undefined if the layer is gone */\n private featureHit(hit: PickHit): FeatureHit | undefined {\n const layer = this.layers.find((l) => l.id === hit.layer);\n\n if (!layer) return undefined;\n\n const feature = hasFeatures(layer) ? layer.featureAt(hit.index) : undefined;\n\n return { layer, index: hit.index, feature };\n }\n\n /** Screen point (CSS pixels) of a position on the ground (the relief), or `height` metres above it, undefined\n * behind the camera */\n project(lonLat: LonLat, height = 0): Point | undefined {\n return this.engine.project(lonLat[0], lonLat[1], height);\n }\n\n /** Position under a screen point (CSS pixels), undefined above the horizon */\n unproject(point: Point): LonLat | undefined {\n return this.engine.ground(point[0], point[1]);\n }\n\n /**\n * Street-level panoramas (oriented images of a vehicle's cameras, the iTowns immersive format): their positions\n * and calibrations loaded, none shown until `show`, which projects one onto the scene around it\n */\n async addPanoramas(options: PanoramaOptions): Promise<Panoramas> {\n const host = panoramaHost(this, (lon, lat) => this.engines.geoidHeight(lon, lat));\n const panoramas = await loadPanoramas(host, options);\n\n this.panoramaSets.add(panoramas);\n panoramas.whenRemoved.push(() => {\n this.panoramaSets.delete(panoramas);\n });\n\n return panoramas;\n }\n\n /** The panorama sets, their panorama shown again in a new engine */\n private readonly panoramaSets = new Set<Panoramas>();\n\n /** Altitude of the relief at a position, in metres (exaggeration included): from the copy of its tiles the map\n * keeps, as fine as the tiles loaded there; undefined without relief or where none is loaded yet */\n elevationAt(lonLat: LonLat): number | undefined {\n return this.engine.elevationAt(lonLat[0], lonLat[1]);\n }\n\n /** Metres on the ground per CSS pixel at a screen point (default the center of the map), across the screen: for a\n * scale bar; undefined above the horizon */\n metersPerPixel(point?: Point): number | undefined {\n const [x, y] = point ?? [this.canvas.clientWidth / 2, this.canvas.clientHeight / 2];\n const a = this.unproject([x - 0.5, y]);\n const b = this.unproject([x + 0.5, y]);\n\n if (!a || !b) return undefined;\n\n // Haversine, on the mean radius of the body\n const [dLat, dLon] = [(b[1] - a[1]) * RAD, (b[0] - a[0]) * RAD];\n const h = Math.sin(dLat / 2) ** 2 + Math.cos(a[1] * RAD) * Math.cos(b[1] * RAD) * Math.sin(dLon / 2) ** 2;\n\n return 2 * this.settings.body.radius * Math.asin(Math.min(1, Math.sqrt(h)));\n }\n\n /** Whether a double click zooms in (Shift: out), on by default: off while a drawing takes double clicks */\n setDoubleClickZoom(enabled: boolean): void {\n if (this.interaction) this.interaction.doubleClickZoom = enabled;\n }\n\n /** Whether a drag that turns and tilts the map (right button, Ctrl or Shift) goes around what is under the pointer\n * where it starts, a roof or a mesh as the relief (on by default), or around the screen center */\n setRotateAroundPointer(enabled: boolean): void {\n if (this.interaction) this.interaction.rotateAroundPointer = enabled;\n }\n\n /** What is drawn under a screen point (CSS pixels), on the relief or standing on it (a roof, a wall, a mesh): its\n * position and its height above the relief, in metres; undefined where nothing was drawn. Read from the last copy of\n * the scene's depth (taken once the camera stops, a pixel every 4 CSS pixels): at once, without waiting for the GPU */\n pickSurface(point: Point): { lonLat: LonLat; height: number } | undefined {\n const hit = this.engine.surface(point[0], point[1]);\n\n return hit && { lonLat: [hit[0], hit[1]], height: hit[2] };\n }\n\n /** The height above the relief, in metres, of the top of what stands at a position: a roof, a mesh, 0 on the bare\n * ground; undefined where nothing of the last frame is there, or until measured: the scene is drawn looking down at\n * it after a frame and read back a frame or two later, the answer kept and measured again every 250 ms at most (ask\n * again on the next `render` event) */\n surfaceAt(lonLat: LonLat): number | undefined {\n return this.engine.surfaceAt(lonLat[0], lonLat[1]);\n }\n\n // ── Overlays and controls ──\n\n /** Adds a control in a corner of the map; controls stack from the corner inward */\n addControl(control: Control, position: ControlPosition = 'top-right'): this {\n this.overlays.addControl(control, position);\n\n return this;\n }\n\n removeControl(control: Control): this {\n this.overlays.removeControl(control);\n\n return this;\n }\n\n /** @internal Shows a marker or popup, placed after every frame from now on */\n attachOverlay(item: Positioned, element: HTMLElement): void {\n this.overlays.attach(item, element);\n }\n\n /** @internal */\n detachOverlay(item: Positioned, element: HTMLElement): void {\n this.overlays.detach(item, element);\n }\n\n /** @internal Places one overlay now (it moved), without drawing a frame */\n positionOverlay(item: Positioned): void {\n this.overlays.position(item);\n }\n\n // ── Layers ──\n\n /** Replaces the basemap and the IGN hillshade, under the other layers (hillshade by default: 0, none). The former\n * names of the Géoplateforme basemaps throw, naming the new ones */\n setBasemap(basemap: Basemap, hillshade = 0): void {\n const name = checkBasemap(basemap);\n\n this.basemaps.replace(name);\n // Off the Earth, the body's own color\n if (this.earth) this.settings.globeColor = SEA[name];\n this.engine.setGlobeColor(...this.settings.globeColor);\n this.basemaps.addHillshade(hillshade);\n this.credits.changed();\n }\n\n /** Raster tiles ({z}, {x}, {y} URL; Web Mercator, or reprojected from another `grid`: longitudes and latitudes,\n * Lambert-93, UTM…), over the layers already added */\n addRaster(options: RasterOptions): RasterLayer {\n const { url, opacity = 1, saturation = 1, size, before, ground = true } = options;\n const { loader, minZoom, maxZoom } = rasterSource(options, this.workers.remoteReprojection);\n const layer = new RasterLayer(this, { url, minZoom, maxZoom, opacity, saturation, size, loader, ground });\n\n this.place(layer, before);\n if (options.attribution) this.credits.set(layer, options.attribution);\n\n return layer;\n }\n\n /**\n * A PMTiles archive (v3) read by range requests: a raster layer of its images, or vector tiles drawn with `style` (by\n * default a plain style of the archive's layers) with their labels. Its header decides which unless `kind` says;\n * `url` with or without `pmtiles://`, relative to the page, or a `blob:` URL. `addRaster({ url: 'pmtiles://…' })` and\n * a style source `pmtiles://…` in `vectorTiles` read archives too\n */\n addPmtiles(options: PmtilesOptions): Promise<RasterLayer | VectorTiles> {\n return pmtilesLayer(this, options);\n }\n\n /** Line network colored by a value per node; `layer.setValues` recolors it in one texture upload */\n addNetwork(options: NetworkOptions): NetworkLayer {\n const { nodes, edges, lines, costs, edgeWidths, width = 2, max = NETWORK_MAX, contour = 0, opacity = 1 } = options;\n const {\n halo = 0,\n haloOpacity = NETWORK_HALO_OPACITY,\n ramp,\n unreachedColor = 'rgba(140, 140, 140, 0.25)',\n fade = 0,\n } = options;\n const style = { width, max, contour, opacity, halo, haloOpacity, ramp, unreachedColor, fade };\n\n validateNetwork(nodes, edges);\n\n return this.place(new NetworkLayer(this, { nodes, edges, lines }, costs, style, edgeWidths), options.before);\n }\n\n /**\n * A layer from its description, as an application's configuration gives it: `{ type, ...options }`, the options of\n * the `add…` method of that type (`'lines'` for `addLines`, `'tiles3d'` for `addTiles3d`…); `before` to go under\n * another layer. The layer's `ready` resolves once the map has drawn it\n */\n add<P = Record<string, unknown>>(spec: LayerSpec<P>): Layer {\n return addSpec<P>(this, spec);\n }\n\n /** @internal A layer made anew from its description, in the place of `old` in the drawing order (old removed) */\n rebuildLayer<P = Record<string, unknown>>(old: Layer, spec: LayerSpec<P>): Layer {\n const index = this.layers.indexOf(old);\n // The first layer above that goes not with it: its companions are removed with it\n const above = index >= 0 ? this.layers.slice(index + 1).find((l) => !old.companions.includes(l)) : undefined;\n const layer = this.add(spec);\n\n if (!('before' in spec && spec.before) && index >= 0) layer.moveBefore(above);\n old.remove();\n\n return layer;\n }\n\n /**\n * @internal Work the map waits on before it is idle (the vector tiles cut in the workers, uploaded over frames): the\n * engine knows only the tiles it holds, not those coming (an engine made anew holds none until the workers cut them\n * again from their cache, no request on the network meanwhile); a frame once it is done, to tell\n */\n track<T>(work: Promise<T>): Promise<T> {\n this.#working += 1;\n\n const done = () => {\n this.#working -= 1;\n this.requestRender();\n };\n\n work.then(done, done);\n\n return work;\n }\n\n /** @internal Resolves once the map is idle (everything in view loaded and drawn) */\n whenIdle(): Promise<void> {\n if (this.gone) return Promise.resolve();\n\n return new Promise((resolve) => {\n const off = this.on('idle', () => {\n off();\n resolve();\n });\n\n this.frames.requestIdle();\n });\n }\n\n /** Lines from GeoJSON (line strings, and polygon outlines), styled per feature */\n addLines<P = Record<string, unknown>>(options: LineOptions<P>): LineLayer<P> {\n return this.place(\n new LineLayer<P>(this, options.data, lineStyle(options), options.altitudeReference),\n options.before,\n );\n }\n\n /** Discs from GeoJSON points, styled per feature */\n addCircles<P = Record<string, unknown>>(options: CircleOptions<P>): CircleLayer<P> {\n return this.place(new CircleLayer<P>(this, options.data, circleStyle(options)), options.before);\n }\n\n /** Filled polygons from GeoJSON (holes included), styled per feature; over the relief they lie on the ground */\n addFills<P = Record<string, unknown>>(options: FillOptions<P>): FillLayer<P> {\n return this.place(new FillLayer<P>(this, options.data, fillStyle(options)), options.before);\n }\n\n /** The application's fragment shader over the ground (see `GroundOptions`); under `before` if given */\n addGround(options: GroundOptions): GroundLayer {\n return this.place(new GroundLayer(this, options), options.before);\n }\n\n /** Polygons raised into blocks with depth (buildings), styled per feature; tiles of them come with `setTile` */\n addExtrusions<P = Record<string, unknown>>(options: ExtrusionOptions<P> = {}): ExtrusionLayer<P> {\n return this.place(\n new ExtrusionLayer<P>(this, options.data, extrusionStyle(options), options.drape),\n options.before,\n );\n }\n\n /** Text labels from GeoJSON (points, the middle of lines, the center of polygons), placed without overlaps */\n addSymbols<P = Record<string, unknown>>(options: SymbolOptions<P>): SymbolLayer<P> {\n return this.place(new SymbolLayer<P>(this, options.data, symbolStyle(options)), options.before);\n }\n\n /** @internal The glyphs of the symbol layers, loaded on first use */\n get glyphs(): Glyphs {\n return this.atlases.glyphs;\n }\n\n /** @internal The icons of the symbol layers: the application's images and the vector basemaps' sprites */\n get icons(): Icons {\n return this.atlases.icons;\n }\n\n /**\n * An image for the symbol layers' icons (`icon: name`), as MapLibre's `addImage`: its pixels (an image, a canvas,\n * `ImageData`, or RGBA bytes with their size), `pixelRatio` 2 for an image drawn at twice its CSS size; `sdf` for a\n * signed distance field drawn in the `iconColor`; `stretchX`, `stretchY` and `content` for an icon stretched around its\n * text. An image of the same name is replaced\n */\n addImage(\n name: string,\n image: Pixels | (CanvasImageSource & { width: number; height: number }),\n options: ImageOptions = {},\n ): void {\n this.atlases.addImage(name, image, options);\n }\n\n hasImage(name: string): boolean {\n return this.atlases.hasImage(name);\n }\n\n removeImage(name: string): void {\n this.atlases.removeImage(name);\n }\n\n /**\n * Vector tiles with a MapLibre style (OpenFreeMap's Positron by default): `tiles.raster(…)` draws its fills and lines\n * (or a subset) as a raster layer, `tiles.vectors(…)` as geometry, `tiles.labels(…)` its labels.\n * `setBasemap('osm-positron')` draws the basemap with a raster layer and the labels.\n */\n vectorTiles(options: VectorTilesOptions = {}): VectorTiles {\n const tiles = new VectorTiles(this, {\n ...(this.workers.url ? { workerUrl: this.workers.url } : {}),\n ...options,\n });\n\n // Its workers stop with the map\n this.vectorSets.add(tiles);\n\n return tiles;\n }\n\n /** @internal The geometry of a `VectorTiles` (`vectors`), under `before` if given */\n addVectorLayer(before?: Layer): VectorLayer {\n return this.place(new VectorLayer(this), before);\n }\n\n /** @internal Forgets a destroyed `VectorTiles` */\n dropVectorTiles(tiles: VectorTiles): void {\n this.vectorSets.delete(tiles);\n }\n\n /**\n * @internal The workers for a `VectorTiles`: the map's shared pool, or a pool of its own (`own`, to stop with it)\n * when it asks for another count or URL\n */\n basemapWorkers(count?: number, url?: string | URL): { pool: BasemapWorkers; own: boolean } {\n return this.workers.pool(count, url);\n }\n\n /** Adds a layer, under `before` if given */\n private place<L extends Layer>(layer: L, before: Layer | undefined): L {\n this.addLayer(layer);\n if (before) this.moveLayer(layer, before);\n\n return layer;\n }\n\n /** Textured meshes in 3D Tiles (photogrammetry, buildings), drawn with depth over the basemap */\n addTiles3d(options: Tiles3dOptions): Tiles3dLayer {\n const {\n url,\n maxScreenSpaceError = 16,\n opacity = 1,\n pointSize,\n color,\n geoid = false,\n facades = false,\n drape,\n } = options;\n\n return this.place(\n new Tiles3dLayer(\n this,\n url,\n geoid,\n {\n maxScreenSpaceError,\n opacity,\n ...(pointSize !== undefined ? { pointSize } : {}),\n ...(color !== undefined ? { color } : {}),\n },\n facades,\n drape,\n ),\n options.before,\n );\n }\n\n /**\n * A point cloud (see `PointCloudOptions`): a COPC file read by range requests (IGN's LiDAR HD…), or 3D Tiles\n * points; with depth; under `before` if given\n */\n addPointCloud(options: PointCloudOptions): PointCloudLayer {\n return this.place(new PointCloudLayer(this, options), options.before);\n }\n\n /**\n * The grids of a GRIB2 or classic NetCDF file (its URL, or its bytes): a weather or ocean model's fields on grids of\n * longitudes and latitudes, read in a worker by the grid module (loaded with the first file). GRIB2 on a regular\n * latitude/longitude grid, packed simply, in groups or in groups of spatial differences (NOAA's GFS); NetCDF-3 with\n * the CF conventions. `windFields` pairs a wind's components into the fields of `addFlow`\n */\n readGrids(source: string | URL | ArrayBuffer | Uint8Array, options: { signal?: AbortSignal } = {}): Promise<Grid[]> {\n return this.workers.readGrids(source, this.gridUrl, options.signal);\n }\n\n /** Particles carried by a field of velocities (a wind, a current), their trails animated and colored by speed on\n * the globe and the relief (see `FlowOptions`) */\n addFlow(options: FlowOptions): FlowLayer {\n return this.place(new FlowLayer(this, options), options.before);\n }\n\n /** A glTF model drawn at positions (see `ModelOptions`), with depth */\n addModels(options: ModelOptions): ModelLayer {\n return this.place(new ModelLayer(this, options), options.before);\n }\n\n /** Trees at the points of a source that has them (a city's street trees), broadleaved or conifers by their data,\n * scaled to their height (see `TreeOptions`); the conifers on a layer that goes with the one returned */\n addTrees<P = Record<string, unknown>>(options: TreeOptions<P>): ModelLayer {\n return addTrees((o) => this.addModels(o), options);\n }\n\n /** A photo standing where it was taken, facing its way (see `PhotoOptions`): flat on a frame across its field of\n * view, a 360° one on a band round its camera; resolves once its image is read */\n addPhoto(options: PhotoOptions): Promise<ModelLayer> {\n return addPhoto((o) => this.addModels(o), options);\n }\n\n /**\n * The page's own WebGPU drawing at its place among the layers, in every frame (see `CustomLayerInterface`): raw\n * WebGPU, three.js's WebGPU renderer… with the map's device and the matrices of the frame (`frame.matrixAt`); under\n * `before` if given. Not drawn on the WebGL2 fallback\n */\n addCustomLayer(layer: CustomLayerInterface, options: { before?: Layer } = {}): CustomLayer {\n const custom = new CustomLayer(\n this,\n layer,\n this,\n (lon, lat, altitude) => this.engines.customMatrix(lon, lat, altitude),\n () => this.getCamera(),\n );\n\n return this.place(custom, options.before);\n }\n\n // ── Frames ──\n\n /** Asks for a frame; several calls before the next frame draw it once */\n requestRender(): void {\n this.frames.request();\n }\n\n /** @internal Runs `step` every frame until it returns false; replaces the running animation */\n animate(step: Step | undefined): void {\n this.frames.animate(step);\n }\n\n /** @internal The pointer moved over the map (undefined: it left). Without 'hover' and 'hoverfeature' listeners,\n * nothing is drawn: a still map stays idle under a moving mouse */\n hover(point: Point | undefined): void {\n if (!point) {\n this.frames.hover(undefined);\n this.hoverPick.cancel();\n\n return;\n }\n if (!this.listeners.has('hover') && !this.listeners.has('hoverfeature')) return;\n this.frames.hover(point);\n this.requestRender();\n }\n\n private resize(): void {\n if (this.lost) return;\n\n const { clientWidth: width, clientHeight: height } = this.canvas;\n const ratio = Math.min(window.devicePixelRatio || 1, this.quality.pixelRatio);\n\n this.canvas.width = Math.round(width * ratio);\n this.canvas.height = Math.round(height * ratio);\n this.engine.resize(width, height, ratio);\n this.overlays.size = [width, height];\n this.emit('resize', { width, height });\n // Draw at once: a resized canvas is cleared, waiting one frame would flash\n this.frames.drawNow();\n }\n\n destroy(): void {\n if (this.gone) return;\n this.gone = true;\n // A context restored later rebuilds nothing\n this.unwatchContext();\n\n const camera = this.getCamera();\n\n this.frames.stop();\n this.hoverPick.cancel();\n this.basemaps.destroy();\n [...this.vectorSets].forEach((tiles) => {\n tiles.remove();\n });\n this.vectorSets.clear();\n this.workers.terminate();\n this.unwatchRatio();\n this.unwatchHeaders();\n this.resizeObserver.disconnect();\n this.interaction?.destroy();\n this.engines.destroy();\n // Custom layers free their GPU objects, models their data, while the device is there\n this.stack.dispose();\n this.engine.free();\n // Work still under way (labels being shaped, tiles arriving, timers) may call the engine after this: it finds one\n // that does nothing, and nothing is drawn again\n this.#engine = destroyedEngine(camera);\n // Glyph ranges still arriving upload to it, not to the freed engine\n this.atlases.attach(this.#engine);\n this.lost = true;\n this.overlays.destroy();\n this.listeners.clear();\n }\n}\n"]}
@@ -4413,27 +4413,27 @@ function __wbg_get_imports() {
4413
4413
  arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
4414
4414
  }, arguments); },
4415
4415
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
4416
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2403, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4416
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2404, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4417
4417
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wasm_bindgen_4346cdda5a9d72ac___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_4346cdda5a9d72ac___JsError___true_);
4418
4418
  return ret;
4419
4419
  },
4420
4420
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
4421
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 336, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4421
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 337, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4422
4422
  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_);
4423
4423
  return ret;
4424
4424
  },
4425
4425
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
4426
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 340, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4426
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 341, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4427
4427
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_4346cdda5a9d72ac___convert__closures_____invoke___wgpu_ce7204c20056c03e___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_);
4428
4428
  return ret;
4429
4429
  },
4430
4430
  __wbindgen_generic_0000000000000004: function(arg0, arg1) {
4431
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 336, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4431
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 337, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4432
4432
  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__139);
4433
4433
  return ret;
4434
4434
  },
4435
4435
  __wbindgen_generic_0000000000000005: function(arg0, arg1) {
4436
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 336, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4436
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 337, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4437
4437
  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__140);
4438
4438
  return ret;
4439
4439
  },
@@ -3528,27 +3528,27 @@ function __wbg_get_imports() {
3528
3528
  arg0.writeTexture(arg1, getArrayU8FromWasm0(arg2, arg3), arg4, arg5);
3529
3529
  }, arguments); },
3530
3530
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
3531
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 332, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3531
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 333, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3532
3532
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wasm_bindgen_2e566c63402fe7fa___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_2e566c63402fe7fa___JsError___true_);
3533
3533
  return ret;
3534
3534
  },
3535
3535
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
3536
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 275, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3536
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUDevice")], shim_idx: 276, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3537
3537
  const ret = makeMutClosure(arg0, arg1, 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_);
3538
3538
  return ret;
3539
3539
  },
3540
3540
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
3541
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 279, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3541
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 280, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3542
3542
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_2e566c63402fe7fa___convert__closures_____invoke___wgpu_79b597b3111bcbe9___backend__webgpu__webgpu_sys__gen_GpuDeviceLostInfo__GpuDeviceLostInfo______true_);
3543
3543
  return ret;
3544
3544
  },
3545
3545
  __wbindgen_generic_0000000000000004: function(arg0, arg1) {
3546
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 275, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3546
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("any")], shim_idx: 276, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3547
3547
  const ret = makeMutClosure(arg0, arg1, 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__139);
3548
3548
  return ret;
3549
3549
  },
3550
3550
  __wbindgen_generic_0000000000000005: function(arg0, arg1) {
3551
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 275, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3551
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 276, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3552
3552
  const ret = makeMutClosure(arg0, arg1, 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__140);
3553
3553
  return ret;
3554
3554
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isard",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "A WebGL2 map engine for large, interactive data layers, labels and 3D Tiles over raster or vector basemaps (Rust core in WebAssembly)",
5
5
  "license": "MIT",
6
6
  "author": "Kevin Graff",