isard 2.6.1 → 2.7.1
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 +29 -0
- package/dist/data/ogcapi.d.ts +21 -7
- package/dist/data/ogcapi.js +13 -14
- package/dist/data/ogcapi.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/isard_webgl2_bg.wasm +0 -0
- package/dist/isard_webgpu_bg.wasm +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@ versions [Semantic Versioning](https://semver.org) (before 1.0.0, a minor versio
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [2.7.1] - 2026-11-02
|
|
9
|
+
|
|
10
|
+
With `isard-react-native` and `isard-map` (Python) 2.7.1.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- The example Private sources: a private stream of the Géoplateforme read with an account, its `Authorization`
|
|
15
|
+
header on every request to the private streams (`setRequestHeaders`), the communes of the Métropole Nice Côte
|
|
16
|
+
d'Azur colored by their forest; in its four versions. The examples' section Search and the OGC APIs is Services and
|
|
17
|
+
access. The guide says the Géoplateforme's private streams take the account or the token in `Authorization` (Basic
|
|
18
|
+
or Bearer), the header a page of another origin may send.
|
|
19
|
+
|
|
20
|
+
## [2.7.0] - 2026-11-02
|
|
21
|
+
|
|
22
|
+
With `isard-react-native` and `isard-map` (Python) 2.7.0.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- `ogcSource(url)`: an OGC API - Tiles tileset as a MapLibre style's source of the kind its metadata says, vector
|
|
27
|
+
or raster (a map tileset: `{ type: 'raster', tileSize, … }`, drawn under the vector layers by `tiles.raster()`):
|
|
28
|
+
images and vector tiles of OGC APIs in one style.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- `ogcVectorSource` is `ogcSource`, which gives a raster source too (a map tileset): rename the calls.
|
|
33
|
+
- The computers are expected to have WebGPU: the guide's page Weaker GPUs and phones says which browsers give it and
|
|
34
|
+
how to turn Vulkan on in Chrome on Linux (without it, Chrome offers no WebGPU device and the map draws through its
|
|
35
|
+
WebGL2 fallback).
|
|
36
|
+
|
|
8
37
|
## [2.6.1] - 2026-11-02
|
|
9
38
|
|
|
10
39
|
With `isard-react-native` and `isard-map` (Python) 2.6.1.
|
package/dist/data/ogcapi.d.ts
CHANGED
|
@@ -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
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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>;
|
package/dist/data/ogcapi.js
CHANGED
|
@@ -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
|
-
/**
|
|
117
|
-
*
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
package/dist/data/ogcapi.js.map
CHANGED
|
@@ -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,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,G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AC,CAAC,CAAC,EAAE,CAAC,CAAC;IAE9D,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,UAAU,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAE5G,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;QACpB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE,CAAC;AACJ,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`);\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,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CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,GAAG,MAAM;KACV,CAAC;AACJ,CAAC,CAAC;AAOF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAC5B,GAAiB,EACjB,EAAE,MAAM,EAAE,QAAQ,GAAG,GAAG,KAAkD,EAAE,EACxD,EAAE;IACtB,MAAM,EACJ,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EACR,WAAW,GACZ,GAAG,MAAM,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClD,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,
|
|
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,
|
|
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,EAAuB,MAAM,2BAA2B,CAAC;AAiB5E,OAAO,EAAE,QAAQ,EAAuB,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAsB,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAGL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAOL,OAAO,EACP,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAGL,WAAW,EACX,WAAW,EACX,QAAQ,EACR,eAAe,GAChB,MAAM,kBAAkB,CA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M,mBAAmB,CAAC;AAC9E,OAAO,EAAsB,WAAW,EAAuB,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EAAE,MAAM,EAAkB,MAAM,UAAU,CAAC;AAClD,OAAO,EACL,aAAa,EAGb,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,gBAAgB,CAAC;AA8CxB,OAAO,EACL,kBAAkB,EAIlB,iBAAiB,GAElB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAuB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAEL,MAAM,EAIN,KAAK,EAEL,KAAK,GAGN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAqB,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAsB,MAAM,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 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,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAuB,MAAM,2BAA2B,CAAC;AAiB5E,OAAO,EAAE,QAAQ,EAAuB,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAsB,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAGL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,SAAS,EACT,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAOL,OAAO,EACP,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAIL,W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AE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAmC,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAsB,WAAW,EAAuB,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EAAE,MAAM,EAAkB,MAAM,UAAU,CAAC;AAClD,OAAO,EACL,aAAa,EAGb,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,gBAAgB,CAAC;AA8CxB,OAAO,EACL,kBAAkB,EAIlB,iBAAiB,GAElB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAuB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAEL,MAAM,EAIN,KAAK,EAEL,KAAK,GAGN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAqB,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAsB,MAAM,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
|
package/package.json
CHANGED