isard 1.5.0 → 1.6.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 +165 -1
- package/README.md +3 -2
- package/dist/basemap/furniture.d.ts +8 -0
- package/dist/basemap/furniture.js +26 -0
- package/dist/basemap/furniture.js.map +1 -0
- package/dist/basemap/trees.d.ts +35 -8
- package/dist/basemap/trees.js +105 -52
- package/dist/basemap/trees.js.map +1 -1
- package/dist/basemap/vectorstyle.d.ts +9 -3
- package/dist/basemap/vectorstyle.js +5 -6
- package/dist/basemap/vectorstyle.js.map +1 -1
- package/dist/basemap/vectortiles/context.d.ts +3 -0
- package/dist/basemap/vectortiles/context.js.map +1 -1
- package/dist/basemap/vectortiles/extrusions.d.ts +4 -0
- package/dist/basemap/vectortiles/extrusions.js +17 -2
- package/dist/basemap/vectortiles/extrusions.js.map +1 -1
- package/dist/basemap/vectortiles/labels.d.ts +3 -0
- package/dist/basemap/vectortiles/labels.js +42 -17
- package/dist/basemap/vectortiles/labels.js.map +1 -1
- package/dist/basemap/vectortiles/lamps.d.ts +23 -0
- package/dist/basemap/vectortiles/lamps.js +90 -0
- package/dist/basemap/vectortiles/lamps.js.map +1 -0
- package/dist/basemap/vectortiles/requests.d.ts +4 -0
- package/dist/basemap/vectortiles/requests.js +15 -2
- package/dist/basemap/vectortiles/requests.js.map +1 -1
- package/dist/basemap/vectortiles/trees.d.ts +9 -0
- package/dist/basemap/vectortiles/trees.js +114 -29
- package/dist/basemap/vectortiles/trees.js.map +1 -1
- package/dist/basemap/vectortiles/vectors.d.ts +17 -0
- package/dist/basemap/vectortiles/vectors.js +72 -8
- package/dist/basemap/vectortiles/vectors.js.map +1 -1
- package/dist/basemap/vectortiles.d.ts +26 -6
- package/dist/basemap/vectortiles.js +43 -10
- package/dist/basemap/vectortiles.js.map +1 -1
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +12 -10
- package/dist/bind/layers.js +1 -0
- package/dist/bind/layers.js.map +1 -1
- package/dist/data/collada.d.ts +19 -0
- package/dist/data/collada.js +319 -0
- package/dist/data/collada.js.map +1 -0
- package/dist/data/ifc.d.ts +100 -0
- package/dist/data/ifc.js +372 -0
- package/dist/data/ifc.js.map +1 -0
- package/dist/decoder.worker.js +5 -5
- package/dist/decoder.worker.js.map +3 -3
- package/dist/formats.d.ts +7 -2
- package/dist/formats.js +7 -2
- package/dist/formats.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/isard_bg.wasm +0 -0
- package/dist/isard_core_bg.wasm +0 -0
- package/dist/isard_grid_bg.wasm +0 -0
- package/dist/isard_tess_bg.wasm +0 -0
- package/dist/layers/extrusions.d.ts +10 -0
- package/dist/layers/extrusions.js +28 -2
- package/dist/layers/extrusions.js.map +1 -1
- package/dist/layers/layers.d.ts +12 -0
- package/dist/layers/layers.js +44 -1
- package/dist/layers/layers.js.map +1 -1
- package/dist/layers/photos.d.ts +48 -0
- package/dist/layers/photos.js +140 -0
- package/dist/layers/photos.js.map +1 -0
- package/dist/layers/symbols.d.ts +5 -1
- package/dist/layers/symbols.js +111 -32
- package/dist/layers/symbols.js.map +1 -1
- package/dist/layers/trees.d.ts +28 -0
- package/dist/layers/trees.js +51 -0
- package/dist/layers/trees.js.map +1 -0
- package/dist/layers/vectors.d.ts +28 -2
- package/dist/layers/vectors.js +81 -7
- package/dist/layers/vectors.js.map +1 -1
- package/dist/map/layer-spec.d.ts +3 -0
- package/dist/map/layer-spec.js +2 -0
- package/dist/map/layer-spec.js.map +1 -1
- package/dist/map.d.ts +8 -0
- package/dist/map.js +15 -2
- package/dist/map.js.map +1 -1
- package/dist/panoramax.d.ts +49 -0
- package/dist/panoramax.js +71 -0
- package/dist/panoramax.js.map +1 -0
- package/dist/react/Layer.d.ts +1 -0
- package/dist/react/Layer.js.map +1 -1
- package/dist/react/VectorGeometry.d.ts +5 -0
- package/dist/react/VectorGeometry.js +12 -4
- package/dist/react/VectorGeometry.js.map +1 -1
- package/dist/util/gltf.d.ts +9 -0
- package/dist/util/gltf.js +27 -0
- package/dist/util/gltf.js.map +1 -0
- package/dist/util/roofs.d.ts +10 -0
- package/dist/util/roofs.js +30 -0
- package/dist/util/roofs.js.map +1 -0
- package/dist/wasm/isard.d.ts +56 -17
- package/dist/wasm/isard.js +128 -18
- package/dist/wasm/isard_core.d.ts +44 -17
- package/dist/wasm/isard_core.js +104 -18
- package/dist/wasm/isard_tess.d.ts +6 -3
- package/dist/wasm/isard_tess.js +27 -4
- package/dist/workers/basemap/geometry.d.ts +38 -22
- package/dist/workers/basemap/labels.d.ts +14 -1
- package/dist/workers/basemap/lamps.d.ts +10 -0
- package/dist/workers/basemap/trees.d.ts +3 -1
- package/dist/workers/basemap.worker.d.ts +43 -3
- package/dist/workers/basemap.worker.js +14 -2
- package/dist/workers/basemap.worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { type ReactNode, type Ref } from 'react';
|
|
4
4
|
import type { Style, StyleLayer } from '../basemap/vectorstyle.ts';
|
|
5
5
|
import type { VectorLayer, VectorSublayer } from '../layers/vectors.ts';
|
|
6
|
+
import type { RoofMode } from '../workers/basemap/geometry.ts';
|
|
6
7
|
export interface VectorGeometryProps {
|
|
7
8
|
/** A style URL or object (default OpenFreeMap's Positron); another one makes the layer anew */
|
|
8
9
|
style?: string | Style;
|
|
@@ -12,6 +13,10 @@ export interface VectorGeometryProps {
|
|
|
12
13
|
/** The line layers that glow at night (default those whose id names a road); another function makes the layer anew,
|
|
13
14
|
* as `layers` */
|
|
14
15
|
streets?: (layer: StyleLayer) => boolean;
|
|
16
|
+
/** The buildings' roofs (as `vectors({ roofs })`: `'data'` by default); another one makes the layer anew */
|
|
17
|
+
roofs?: RoofMode;
|
|
18
|
+
/** The buildings' walls show their windows (default false: `setFacades`, the tiles not cut again) */
|
|
19
|
+
facades?: boolean;
|
|
15
20
|
/** Paint properties over the style's (`setPaintProperty`), by style layer id, or by style layer drawn once the style
|
|
16
21
|
* is loaded (a function of its id, kind, source layer): compared by value, only those changed sent; one taken out
|
|
17
22
|
* keeps its last value */
|
|
@@ -6,7 +6,7 @@ import { MapContext, SwipeContext } from "./context.js";
|
|
|
6
6
|
const changed = (sent, next) => Object.entries(next ?? {}).flatMap(([layer, properties]) => Object.entries(properties)
|
|
7
7
|
.filter(([name, value]) => JSON.stringify(sent?.[layer]?.[name]) !== JSON.stringify(value))
|
|
8
8
|
.map(([name, value]) => [layer, name, value]));
|
|
9
|
-
const VectorGeometryComponent = forwardRef(function VectorGeometry({ style, layers, streets, paint, visible = true, order = 0, onLayer }, ref) {
|
|
9
|
+
const VectorGeometryComponent = forwardRef(function VectorGeometry({ style, layers, streets, roofs, facades = false, paint, visible = true, order = 0, onLayer }, ref) {
|
|
10
10
|
const binding = useContext(MapContext);
|
|
11
11
|
const swipe = useContext(SwipeContext);
|
|
12
12
|
const latest = useRef({ order, onLayer });
|
|
@@ -16,12 +16,16 @@ const VectorGeometryComponent = forwardRef(function VectorGeometry({ style, laye
|
|
|
16
16
|
latest.current = { order, onLayer };
|
|
17
17
|
useImperativeHandle(ref, () => layer, [layer]);
|
|
18
18
|
// The tiles and their geometry layer created once the map is there, in the declared order; made anew when the
|
|
19
|
-
// style, the layers kept or the
|
|
19
|
+
// style, the layers kept, the streets or the roofs change; the tiles (and their layer) destroyed when unmounted
|
|
20
20
|
useEffect(() => {
|
|
21
21
|
if (!binding)
|
|
22
22
|
return;
|
|
23
23
|
const tiles = binding.map.vectorTiles(style === undefined ? {} : { style });
|
|
24
|
-
const created = tiles.vectors({
|
|
24
|
+
const created = tiles.vectors({
|
|
25
|
+
...(layers && { layers }),
|
|
26
|
+
...(streets && { streets }),
|
|
27
|
+
...(roofs && { roofs }),
|
|
28
|
+
});
|
|
25
29
|
binding.order.place(created, latest.current.order);
|
|
26
30
|
swipe?.set(created);
|
|
27
31
|
sent.current = undefined;
|
|
@@ -33,7 +37,7 @@ const VectorGeometryComponent = forwardRef(function VectorGeometry({ style, laye
|
|
|
33
37
|
tiles.destroy();
|
|
34
38
|
setLayer(undefined);
|
|
35
39
|
};
|
|
36
|
-
}, [binding, swipe, style, layers, streets]);
|
|
40
|
+
}, [binding, swipe, style, layers, streets, roofs]);
|
|
37
41
|
// The paint properties changed since the last ones sent (all of them to a layer made anew), those of a function
|
|
38
42
|
// once the style is loaded; a later render or layer drops the wait
|
|
39
43
|
useEffect(() => {
|
|
@@ -62,6 +66,10 @@ const VectorGeometryComponent = forwardRef(function VectorGeometry({ style, laye
|
|
|
62
66
|
wait.live = false;
|
|
63
67
|
};
|
|
64
68
|
}, [layer, paint]);
|
|
69
|
+
// The walls' windows shown or not
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
layer?.setFacades(facades);
|
|
72
|
+
}, [layer, facades]);
|
|
65
73
|
// Shown or hidden
|
|
66
74
|
useEffect(() => {
|
|
67
75
|
layer?.setVisible(visible);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorGeometry.js","sourceRoot":"","sources":["../../src/react/VectorGeometry.tsx"],"names":[],"mappings":"AAAA;8BAC8B;AAE9B,OAAO,EACL,UAAU,EAGV,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA2BxD,iGAAiG;AACjG,MAAM,OAAO,GAAG,CAAC,IAAuB,EAAE,IAAuB,EAAmD,EAAE,CACpH,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,EAAE,CACzD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;KACvB,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,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: the fills and lines of a MapLibre style drawn as geometry (`vectorTiles().vectors()`), among the\n * layers of the components */\n\nimport {\n forwardRef,\n type ReactNode,\n type Ref,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport type { Style, StyleLayer } from '../basemap/vectorstyle.ts';\nimport type { VectorLayer, VectorSublayer } from '../layers/vectors.ts';\nimport { MapContext, SwipeContext } from './context.ts';\n\nexport interface VectorGeometryProps {\n /** A style URL or object (default OpenFreeMap's Positron); another one makes the layer anew */\n style?: string | Style;\n /** The style layers drawn (default all its fills and lines); another function makes the layer anew, so keep it in a\n * memo or at the module's level */\n layers?: (layer: StyleLayer) => boolean;\n /** The line layers that glow at night (default those whose id names a road); another function makes the layer anew,\n * as `layers` */\n streets?: (layer: StyleLayer) => boolean;\n /** Paint properties over the style's (`setPaintProperty`), by style layer id, or by style layer drawn once the style\n * is loaded (a function of its id, kind, source layer): compared by value, only those changed sent; one taken out\n * keeps its last value */\n paint?: Paint | ((layer: VectorSublayer) => Record<string, unknown> | undefined);\n /** Shown (default true) */\n visible?: boolean;\n /** Its place among the layers of the components (as `<Layer order>`) */\n order?: number;\n /** The layer, once created and each time it is made anew */\n onLayer?: (layer: VectorLayer) => void;\n ref?: Ref<VectorLayer | undefined>;\n}\n\n/** Paint properties by style layer id */\ntype Paint = Record<string, Record<string, unknown>>;\n\n/** The paint properties of `next` that differ from those of `sent`, as `[layer, name, value]` */\nconst changed = (sent: Paint | undefined, next: Paint | undefined): [layer: string, name: string, value: unknown][] =>\n Object.entries(next ?? {}).flatMap(([layer, properties]) =>\n Object.entries(properties)\n .filter(([name, value]) => JSON.stringify(sent?.[layer]?.[name]) !== JSON.stringify(value))\n .map(([name, value]): [string, string, unknown] => [layer, name, value]),\n );\n\nconst VectorGeometryComponent = forwardRef<VectorLayer | undefined, Omit<VectorGeometryProps, 'ref'>>(\n function VectorGeometry({ style, layers, streets, paint, visible = true, order = 0, onLayer }, ref) {\n const binding = useContext(MapContext);\n const swipe = useContext(SwipeContext);\n const latest = useRef({ order, onLayer });\n /** The paint properties sent to the current layer */\n const sent = useRef<Paint>(undefined);\n const [layer, setLayer] = useState<VectorLayer>();\n\n latest.current = { order, onLayer };\n useImperativeHandle(ref, () => layer, [layer]);\n\n // The tiles and their geometry layer created once the map is there, in the declared order; made anew when the\n // style, the layers kept or the streets change; the tiles (and their layer) destroyed when unmounted\n useEffect(() => {\n if (!binding) return;\n\n const tiles = binding.map.vectorTiles(style === undefined ? {} : { style });\n const created = tiles.vectors({ ...(layers && { layers }), ...(streets && { streets }) });\n\n binding.order.place(created, latest.current.order);\n swipe?.set(created);\n sent.current = undefined;\n setLayer(created);\n latest.current.onLayer?.(created);\n\n return () => {\n binding.order.remove(created);\n swipe?.unset(created);\n tiles.destroy();\n setLayer(undefined);\n };\n }, [binding, swipe, style, layers, streets]);\n\n // The paint properties changed since the last ones sent (all of them to a layer made anew), those of a function\n // once the style is loaded; a later render or layer drops the wait\n useEffect(() => {\n if (!layer) return;\n\n const apply = (next: Paint | undefined) => {\n changed(sent.current, next).forEach(([id, name, value]) => {\n layer.setPaintProperty(id, name, value);\n });\n sent.current = next;\n };\n\n if (typeof paint !== 'function') {\n apply(paint);\n\n return;\n }\n\n const wait = { live: true };\n\n layer.ready.then(\n () => {\n if (!wait.live) return;\n apply(\n Object.fromEntries(\n layer.layers.flatMap((l) => {\n const properties = paint(l);\n\n return properties ? [[l.id, properties]] : [];\n }),\n ),\n );\n },\n () => undefined,\n );\n\n return () => {\n wait.live = false;\n };\n }, [layer, paint]);\n\n // Shown or hidden\n useEffect(() => {\n layer?.setVisible(visible);\n }, [layer, visible]);\n\n // A new `order`: moved to its new place among the layers of the components\n useEffect(() => {\n if (binding && layer) binding.order.place(layer, order, layer);\n }, [binding, layer, order]);\n\n return null;\n },\n);\n\n/**\n * The fills and lines of a MapLibre style drawn as geometry on the globe and the relief (`vectorTiles().vectors()`):\n * sharp at any zoom and pitch, restyled by `paint` without cutting the tiles again, picked by feature\n * (`map.pickFeature`). The ref and `onLayer` give its handle (`VectorLayer`: `layers`, `featureAt`, `ready`)\n */\nexport const VectorGeometry = VectorGeometryComponent as (props: VectorGeometryProps) => ReactNode;\n"]}
|
|
1
|
+
{"version":3,"file":"VectorGeometry.js","sourceRoot":"","sources":["../../src/react/VectorGeometry.tsx"],"names":[],"mappings":"AAAA;8BAC8B;AAE9B,OAAO,EACL,UAAU,EAGV,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA+BxD,iGAAiG;AACjG,MAAM,OAAO,GAAG,CAAC,IAAuB,EAAE,IAAuB,EAAmD,EAAE,CACpH,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,EAAE,CACzD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;KACvB,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KAC1F,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAA6B,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAC3E,CAAC;AAEJ,MAAM,uBAAuB,GAAG,UAAU,CACxC,SAAS,cAAc,CACrB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,OAAO,EAAE,EAC7F,GAAG;IAEH,MAAM,OAAO,GAAG,UAAU,C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AC,CAAC,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,CAAC,CAAC,CACH,CACF,CAAC;QACJ,CAAC,EACD,GAAG,EAAE,CAAC,SAAS,CAChB,CAAC;QAEF,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAEnB,kCAAkC;IAClC,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAErB,kBAAkB;IAClB,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAErB,2EAA2E;IAC3E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,IAAI,KAAK;YAAE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAE5B,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAoE,CAAC","sourcesContent":["/** `<VectorGeometry>`: the fills and lines of a MapLibre style drawn as geometry (`vectorTiles().vectors()`), among the\n * layers of the components */\n\nimport {\n forwardRef,\n type ReactNode,\n type Ref,\n useContext,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\nimport type { Style, StyleLayer } from '../basemap/vectorstyle.ts';\nimport type { VectorLayer, VectorSublayer } from '../layers/vectors.ts';\nimport type { RoofMode } from '../workers/basemap/geometry.ts';\nimport { MapContext, SwipeContext } from './context.ts';\n\nexport interface VectorGeometryProps {\n /** A style URL or object (default OpenFreeMap's Positron); another one makes the layer anew */\n style?: string | Style;\n /** The style layers drawn (default all its fills and lines); another function makes the layer anew, so keep it in a\n * memo or at the module's level */\n layers?: (layer: StyleLayer) => boolean;\n /** The line layers that glow at night (default those whose id names a road); another function makes the layer anew,\n * as `layers` */\n streets?: (layer: StyleLayer) => boolean;\n /** The buildings' roofs (as `vectors({ roofs })`: `'data'` by default); another one makes the layer anew */\n roofs?: RoofMode;\n /** The buildings' walls show their windows (default false: `setFacades`, the tiles not cut again) */\n facades?: boolean;\n /** Paint properties over the style's (`setPaintProperty`), by style layer id, or by style layer drawn once the style\n * is loaded (a function of its id, kind, source layer): compared by value, only those changed sent; one taken out\n * keeps its last value */\n paint?: Paint | ((layer: VectorSublayer) => Record<string, unknown> | undefined);\n /** Shown (default true) */\n visible?: boolean;\n /** Its place among the layers of the components (as `<Layer order>`) */\n order?: number;\n /** The layer, once created and each time it is made anew */\n onLayer?: (layer: VectorLayer) => void;\n ref?: Ref<VectorLayer | undefined>;\n}\n\n/** Paint properties by style layer id */\ntype Paint = Record<string, Record<string, unknown>>;\n\n/** The paint properties of `next` that differ from those of `sent`, as `[layer, name, value]` */\nconst changed = (sent: Paint | undefined, next: Paint | undefined): [layer: string, name: string, value: unknown][] =>\n Object.entries(next ?? {}).flatMap(([layer, properties]) =>\n Object.entries(properties)\n .filter(([name, value]) => JSON.stringify(sent?.[layer]?.[name]) !== JSON.stringify(value))\n .map(([name, value]): [string, string, unknown] => [layer, name, value]),\n );\n\nconst VectorGeometryComponent = forwardRef<VectorLayer | undefined, Omit<VectorGeometryProps, 'ref'>>(\n function VectorGeometry(\n { style, layers, streets, roofs, facades = false, paint, visible = true, order = 0, onLayer },\n ref,\n ) {\n const binding = useContext(MapContext);\n const swipe = useContext(SwipeContext);\n const latest = useRef({ order, onLayer });\n /** The paint properties sent to the current layer */\n const sent = useRef<Paint>(undefined);\n const [layer, setLayer] = useState<VectorLayer>();\n\n latest.current = { order, onLayer };\n useImperativeHandle(ref, () => layer, [layer]);\n\n // The tiles and their geometry layer created once the map is there, in the declared order; made anew when the\n // style, the layers kept, the streets or the roofs change; the tiles (and their layer) destroyed when unmounted\n useEffect(() => {\n if (!binding) return;\n\n const tiles = binding.map.vectorTiles(style === undefined ? {} : { style });\n const created = tiles.vectors({\n ...(layers && { layers }),\n ...(streets && { streets }),\n ...(roofs && { roofs }),\n });\n\n binding.order.place(created, latest.current.order);\n swipe?.set(created);\n sent.current = undefined;\n setLayer(created);\n latest.current.onLayer?.(created);\n\n return () => {\n binding.order.remove(created);\n swipe?.unset(created);\n tiles.destroy();\n setLayer(undefined);\n };\n }, [binding, swipe, style, layers, streets, roofs]);\n\n // The paint properties changed since the last ones sent (all of them to a layer made anew), those of a function\n // once the style is loaded; a later render or layer drops the wait\n useEffect(() => {\n if (!layer) return;\n\n const apply = (next: Paint | undefined) => {\n changed(sent.current, next).forEach(([id, name, value]) => {\n layer.setPaintProperty(id, name, value);\n });\n sent.current = next;\n };\n\n if (typeof paint !== 'function') {\n apply(paint);\n\n return;\n }\n\n const wait = { live: true };\n\n layer.ready.then(\n () => {\n if (!wait.live) return;\n apply(\n Object.fromEntries(\n layer.layers.flatMap((l) => {\n const properties = paint(l);\n\n return properties ? [[l.id, properties]] : [];\n }),\n ),\n );\n },\n () => undefined,\n );\n\n return () => {\n wait.live = false;\n };\n }, [layer, paint]);\n\n // The walls' windows shown or not\n useEffect(() => {\n layer?.setFacades(facades);\n }, [layer, facades]);\n\n // Shown or hidden\n useEffect(() => {\n layer?.setVisible(visible);\n }, [layer, visible]);\n\n // A new `order`: moved to its new place among the layers of the components\n useEffect(() => {\n if (binding && layer) binding.order.place(layer, order, layer);\n }, [binding, layer, order]);\n\n return null;\n },\n);\n\n/**\n * The fills and lines of a MapLibre style drawn as geometry on the globe and the relief (`vectorTiles().vectors()`):\n * sharp at any zoom and pitch, restyled by `paint` without cutting the tiles again, picked by feature\n * (`map.pickFeature`). The ref and `onLayer` give its handle (`VectorLayer`: `layers`, `featureAt`, `ready`)\n */\nexport const VectorGeometry = VectorGeometryComponent as (props: VectorGeometryProps) => ReactNode;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** glTF binaries made by the page (the basemap's trees and lamps, the photos): their bounds, their chunks */
|
|
2
|
+
/** Lowest and highest of interleaved x, y, z (glTF needs them on positions) */
|
|
3
|
+
export declare const bounds: (xyz: readonly number[]) => {
|
|
4
|
+
min: number[];
|
|
5
|
+
max: number[];
|
|
6
|
+
};
|
|
7
|
+
/** A glTF binary of its JSON and its buffer, the chunks padded to 4 bytes (the JSON with spaces, the buffer with
|
|
8
|
+
* zeros) */
|
|
9
|
+
export declare const glbOf: (gltf: unknown, bin: Uint8Array) => Uint8Array<ArrayBuffer>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** glTF binaries made by the page (the basemap's trees and lamps, the photos): their bounds, their chunks */
|
|
2
|
+
/** Lowest and highest of interleaved x, y, z (glTF needs them on positions) */
|
|
3
|
+
export const bounds = (xyz) => {
|
|
4
|
+
const axes = [0, 1, 2].map((a) => xyz.filter((_, i) => i % 3 === a));
|
|
5
|
+
return { min: axes.map((v) => Math.min(...v)), max: axes.map((v) => Math.max(...v)) };
|
|
6
|
+
};
|
|
7
|
+
/** A glTF binary of its JSON and its buffer, the chunks padded to 4 bytes (the JSON with spaces, the buffer with
|
|
8
|
+
* zeros) */
|
|
9
|
+
export const glbOf = (gltf, bin) => {
|
|
10
|
+
const json = new TextEncoder().encode(JSON.stringify(gltf));
|
|
11
|
+
const jsonLength = Math.ceil(json.length / 4) * 4;
|
|
12
|
+
const binLength = Math.ceil(bin.byteLength / 4) * 4;
|
|
13
|
+
const out = new Uint8Array(12 + 8 + jsonLength + 8 + binLength);
|
|
14
|
+
const view = new DataView(out.buffer);
|
|
15
|
+
view.setUint32(0, 0x46546c67, true);
|
|
16
|
+
view.setUint32(4, 2, true);
|
|
17
|
+
view.setUint32(8, out.length, true);
|
|
18
|
+
view.setUint32(12, jsonLength, true);
|
|
19
|
+
view.setUint32(16, 0x4e4f534a, true);
|
|
20
|
+
out.fill(0x20, 20, 20 + jsonLength);
|
|
21
|
+
out.set(json, 20);
|
|
22
|
+
view.setUint32(20 + jsonLength, binLength, true);
|
|
23
|
+
view.setUint32(24 + jsonLength, 0x004e4942, true);
|
|
24
|
+
out.set(bin, 28 + jsonLength);
|
|
25
|
+
return out;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=gltf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gltf.js","sourceRoot":"","sources":["../../src/util/gltf.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAE7G,+EAA+E;AAC/E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAsB,EAAoC,EAAE;IACjF,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAErE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,CAAC,CAAC;AAEF;YACY;AACZ,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAa,EAAE,GAAe,EAA2B,EAAE;IAC/E,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAA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/** glTF binaries made by the page (the basemap's trees and lamps, the photos): their bounds, their chunks */\n\n/** Lowest and highest of interleaved x, y, z (glTF needs them on positions) */\nexport const bounds = (xyz: readonly number[]): { min: number[]; max: number[] } => {\n const axes = [0, 1, 2].map((a) => xyz.filter((_, i) => i % 3 === a));\n\n return { min: axes.map((v) => Math.min(...v)), max: axes.map((v) => Math.max(...v)) };\n};\n\n/** A glTF binary of its JSON and its buffer, the chunks padded to 4 bytes (the JSON with spaces, the buffer with\n * zeros) */\nexport const glbOf = (gltf: unknown, bin: Uint8Array): Uint8Array<ArrayBuffer> => {\n const json = new TextEncoder().encode(JSON.stringify(gltf));\n const jsonLength = Math.ceil(json.length / 4) * 4;\n const binLength = Math.ceil(bin.byteLength / 4) * 4;\n const out = new Uint8Array(12 + 8 + jsonLength + 8 + binLength);\n const view = new DataView(out.buffer);\n\n view.setUint32(0, 0x46546c67, true);\n view.setUint32(4, 2, true);\n view.setUint32(8, out.length, true);\n view.setUint32(12, jsonLength, true);\n view.setUint32(16, 0x4e4f534a, true);\n out.fill(0x20, 20, 20 + jsonLength);\n out.set(json, 20);\n view.setUint32(20 + jsonLength, binLength, true);\n view.setUint32(24 + jsonLength, 0x004e4942, true);\n out.set(bin, 28 + jsonLength);\n\n return out;\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The roofs of the buildings as the engine builds them (`RoofShape::number`): the shapes of OpenStreetMap's
|
|
3
|
+
* `roof:shape`, those it does not draw as the nearest of them, or generated from a building's outline
|
|
4
|
+
*/
|
|
5
|
+
/** A roof generated from its building's outline (`shapes::GENERATED_ROOF`) */
|
|
6
|
+
export declare const GENERATED_ROOF = 255;
|
|
7
|
+
/** The engine's number of a roof shape (`roof:shape`, or `generated`); undefined for a shape it does not know */
|
|
8
|
+
export declare const roofNumber: (shape: string) => number | undefined;
|
|
9
|
+
/** Metres per Mercator unit at a Mercator y (towards the south, [0, 1]): a roof's slopes run in metres */
|
|
10
|
+
export declare const metresAt: (y: number) => number;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The roofs of the buildings as the engine builds them (`RoofShape::number`): the shapes of OpenStreetMap's
|
|
3
|
+
* `roof:shape`, those it does not draw as the nearest of them, or generated from a building's outline
|
|
4
|
+
*/
|
|
5
|
+
/** OpenStreetMap's `roof:shape` as the engine's roofs (1 flat, 2 hipped, 3 gabled, 4 pyramidal, 5 mansard) */
|
|
6
|
+
const ROOF_SHAPES = {
|
|
7
|
+
flat: 1,
|
|
8
|
+
skillion: 1,
|
|
9
|
+
hipped: 2,
|
|
10
|
+
'half-hipped': 2,
|
|
11
|
+
side_hipped: 2,
|
|
12
|
+
dome: 2,
|
|
13
|
+
onion: 2,
|
|
14
|
+
round: 2,
|
|
15
|
+
gabled: 3,
|
|
16
|
+
saltbox: 3,
|
|
17
|
+
pyramidal: 4,
|
|
18
|
+
cone: 4,
|
|
19
|
+
mansard: 5,
|
|
20
|
+
gambrel: 5,
|
|
21
|
+
};
|
|
22
|
+
/** A roof generated from its building's outline (`shapes::GENERATED_ROOF`) */
|
|
23
|
+
export const GENERATED_ROOF = 255;
|
|
24
|
+
/** The Earth's circumference (metres) */
|
|
25
|
+
const EARTH_METRES = 40_075_016.686;
|
|
26
|
+
/** The engine's number of a roof shape (`roof:shape`, or `generated`); undefined for a shape it does not know */
|
|
27
|
+
export const roofNumber = (shape) => shape === 'generated' ? GENERATED_ROOF : ROOF_SHAPES[shape];
|
|
28
|
+
/** Metres per Mercator unit at a Mercator y (towards the south, [0, 1]): a roof's slopes run in metres */
|
|
29
|
+
export const metresAt = (y) => EARTH_METRES * Math.cos(Math.atan(Math.sinh(Math.PI * (1 - 2 * y))));
|
|
30
|
+
//# sourceMappingURL=roofs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roofs.js","sourceRoot":"","sources":["../../src/util/roofs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,8GAA8G;AAC9G,MAAM,WAAW,GAAqC;IACpD,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,CAAC;IACX,MAAM,EAAE,CAAC;IACT,aAAa,EAAE,CAAC;IAChB,WAAW,EAAE,CAAC;IACd,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,CAAC;IACZ,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;CACX,CAAC;AAEF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAElC,yCAAyC;AACzC,MAAM,YAAY,GAAG,cAAc,CAAC;AAEpC,iHAAiH;AACjH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAsB,EAAE,CAC9D,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAE9D,0GAA0G;AAC1G,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/**\n * The roofs of the buildings as the engine builds them (`RoofShape::number`): the shapes of OpenStreetMap's\n * `roof:shape`, those it does not draw as the nearest of them, or generated from a building's outline\n */\n\n/** OpenStreetMap's `roof:shape` as the engine's roofs (1 flat, 2 hipped, 3 gabled, 4 pyramidal, 5 mansard) */\nconst ROOF_SHAPES: Readonly<Record<string, number>> = {\n flat: 1,\n skillion: 1,\n hipped: 2,\n 'half-hipped': 2,\n side_hipped: 2,\n dome: 2,\n onion: 2,\n round: 2,\n gabled: 3,\n saltbox: 3,\n pyramidal: 4,\n cone: 4,\n mansard: 5,\n gambrel: 5,\n};\n\n/** A roof generated from its building's outline (`shapes::GENERATED_ROOF`) */\nexport const GENERATED_ROOF = 255;\n\n/** The Earth's circumference (metres) */\nconst EARTH_METRES = 40_075_016.686;\n\n/** The engine's number of a roof shape (`roof:shape`, or `generated`); undefined for a shape it does not know */\nexport const roofNumber = (shape: string): number | undefined =>\n shape === 'generated' ? GENERATED_ROOF : ROOF_SHAPES[shape];\n\n/** Metres per Mercator unit at a Mercator y (towards the south, [0, 1]): a roof's slopes run in metres */\nexport const metresAt = (y: number): number => EARTH_METRES * Math.cos(Math.atan(Math.sinh(Math.PI * (1 - 2 * y))));\n"]}
|
package/dist/wasm/isard.d.ts
CHANGED
|
@@ -598,14 +598,18 @@ export class Engine {
|
|
|
598
598
|
setExtrusionAnchors(id: number, key: number, anchors: Float32Array): void;
|
|
599
599
|
/**
|
|
600
600
|
* Adds or replaces batch `key` of an extrusion layer: polygons as for `addFills`, `feature_count` features (the
|
|
601
|
-
* feature style gives each its height and base height as its two sizes, metres)
|
|
601
|
+
* feature style gives each its height and base height as its two sizes, metres), each polygon's roof (`Roofs`)
|
|
602
602
|
*
|
|
603
603
|
* # Errors
|
|
604
604
|
*
|
|
605
605
|
* Throws (to JavaScript) when a WebGL buffer or vertex array of the batch cannot be created, or when
|
|
606
606
|
* `feature_count` features need a table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
607
607
|
*/
|
|
608
|
-
setExtrusionBatch(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, feature: Uint32Array, feature_count: number): void;
|
|
608
|
+
setExtrusionBatch(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, feature: Uint32Array, feature_count: number, roofs: Uint8Array, roof_heights: Float32Array, metres: number): void;
|
|
609
|
+
/**
|
|
610
|
+
* Whether the buildings of an extrusion layer, or of a vector tiles layer, show their windows on their walls
|
|
611
|
+
*/
|
|
612
|
+
setFacades(id: number, on: boolean): void;
|
|
609
613
|
/**
|
|
610
614
|
* Layer-wide style of a feature layer: opacity as zoom stops (four zooms then four values), the zoom range it
|
|
611
615
|
* shows in (`min_zoom` included, `max_zoom` excluded), whether it shows at all
|
|
@@ -755,6 +759,16 @@ export class Engine {
|
|
|
755
759
|
* Highest pitch the camera accepts, degrees (up to 85)
|
|
756
760
|
*/
|
|
757
761
|
setMaxPitch(max: number): void;
|
|
762
|
+
/**
|
|
763
|
+
* Lights at night the part of a model layer's model from `from` metres up (a street lamp's head) in `r, g, b`;
|
|
764
|
+
* `from` not a number: none
|
|
765
|
+
*/
|
|
766
|
+
setModelGlow(id: number, from: number, r: number, g: number, b: number): void;
|
|
767
|
+
/**
|
|
768
|
+
* Highlights the feature `feature` of a model layer's model (an IFC model's element) in `r, g, b`; `feature` not a
|
|
769
|
+
* number: none
|
|
770
|
+
*/
|
|
771
|
+
setModelHighlight(id: number, feature: number, r: number, g: number, b: number): void;
|
|
758
772
|
/**
|
|
759
773
|
* Replaces the instances of a model layer (as for `addModels`) and the reference of their altitudes
|
|
760
774
|
*/
|
|
@@ -838,20 +852,21 @@ export class Engine {
|
|
|
838
852
|
setSwipe(x: number, right: boolean, layers: Uint32Array, others: Uint32Array): void;
|
|
839
853
|
/**
|
|
840
854
|
* Layer-wide style of a symbol layer: size scale and opacity as zoom stops (four zooms then four values each),
|
|
841
|
-
* zoom range, visibility
|
|
855
|
+
* zoom range, visibility, hidden by the buildings
|
|
842
856
|
*/
|
|
843
|
-
setSymbolLayer(id: number, size: Float32Array, opacity: Float32Array, min_zoom: number, max_zoom: number, visible: boolean): void;
|
|
857
|
+
setSymbolLayer(id: number, size: Float32Array, opacity: Float32Array, min_zoom: number, max_zoom: number, visible: boolean, occluded: boolean): void;
|
|
844
858
|
/**
|
|
845
859
|
* Labels of a symbol layer, shaped by the page: anchors (Mercator, interleaved), their texts' boxes (min x, min y,
|
|
846
|
-
* max x, max y, CSS pixels from the anchor), styles (
|
|
847
|
-
* (11 floats each, see `QUAD_FLOATS`)
|
|
860
|
+
* max x, max y, CSS pixels from the anchor), styles (37 floats each, see `LABEL_FLOATS`), glyph and icon quads
|
|
861
|
+
* (11 floats each, see `QUAD_FLOATS`) and the lines their curved texts follow (`paths`: for each label, its number
|
|
862
|
+
* of points, the index of its anchor among them, then the points, Mercator; 0, 0 and none for the others)
|
|
848
863
|
*
|
|
849
864
|
* # Errors
|
|
850
865
|
*
|
|
851
866
|
* Throws (to JavaScript) when the labels need a table texture past the GPU's `MAX_TEXTURE_SIZE`, or
|
|
852
867
|
* when it cannot be created; the layer then keeps its labels
|
|
853
868
|
*/
|
|
854
|
-
setSymbols(id: number, anchors: Float64Array, boxes: Float32Array, styles: Float32Array, quads: Float32Array): void;
|
|
869
|
+
setSymbols(id: number, anchors: Float64Array, boxes: Float32Array, styles: Float32Array, quads: Float32Array, paths: Float64Array): void;
|
|
855
870
|
/**
|
|
856
871
|
* Relief under the raster layers, from raw altitudes (`image/x-bil;bits=32`, 256 × 256, or the same followed by
|
|
857
872
|
* the validity mask of an `ArcGIS` raw grid): `url` is a template with `{bbox}` (WMS `GetMap` in EPSG:3857, or in
|
|
@@ -879,13 +894,17 @@ export class Engine {
|
|
|
879
894
|
*/
|
|
880
895
|
setTiles3dStyle(id: number, max_error: number, opacity: number, point_size: number | null | undefined, color: Float32Array): void;
|
|
881
896
|
/**
|
|
882
|
-
* The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion
|
|
897
|
+
* The style layers of a vector tile layer, in drawing order: per layer, its kind (0 fill, 1 line, 2 extrusion, 3
|
|
898
|
+
* circle), its zoom range
|
|
883
899
|
* (two numbers: shown from the first, included, to the second, excluded), whether it shows (0 or 1), its dashes
|
|
884
900
|
* (four numbers: dash, gap, dash, gap, in line widths; 0: solid), its opacity as zoom stops (four zooms then four
|
|
885
901
|
* values; missing: opaque), the caps of its lines' ends (0 butt, 1 round, 2 square; missing: round), whether its
|
|
886
|
-
* lines glow at night (streets; 0 or 1)
|
|
902
|
+
* lines glow at night (streets; 0 or 1), the joins of its lines (two numbers: 0 round, 1 miter, 2 bevel, then the
|
|
903
|
+
* miter limit in line widths; missing: round), the translation of its fills or lines (three numbers: x and y in CSS
|
|
904
|
+
* pixels, x right and y down, then 0 if it turns with the map, 1 if it stays on the screen; missing: none), whether its
|
|
905
|
+
* fills have patterns (0 or 1)
|
|
887
906
|
*/
|
|
888
|
-
setVectorSublayers(id: number, kinds: Uint8Array, zooms: Float64Array, visible: Uint8Array, dashes: Float32Array, opacities: Float32Array, caps: Uint8Array, lit: Uint8Array): void;
|
|
907
|
+
setVectorSublayers(id: number, kinds: Uint8Array, zooms: Float64Array, visible: Uint8Array, dashes: Float32Array, opacities: Float32Array, caps: Uint8Array, lit: Uint8Array, joins: Float32Array, translates: Float32Array, patterned: Uint8Array): void;
|
|
889
908
|
/**
|
|
890
909
|
* Adds or replaces tile `key` of a vector tile layer ready for the GPU, as the basemap workers make it (the
|
|
891
910
|
* tessellation module): its polygons as for `setVectorTile` (picked here; their prisms built here if drawn in
|
|
@@ -902,20 +921,30 @@ export class Engine {
|
|
|
902
921
|
* created, or when its features or lines need a table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
903
922
|
*/
|
|
904
923
|
setVectorTileMesh(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, polygon_feature: Uint32Array, fill_start: Uint32Array, vertices: Uint8Array, indices: Uint32Array, fill_ranges: Uint32Array, prism: boolean, pieces: Uint8Array, line_table: Float32Array, line_ranges: Uint32Array, blocks: Uint8Array, block_indices: Uint32Array, block_ranges: Uint32Array, bounds: Float64Array, feature_count: number): void;
|
|
924
|
+
/**
|
|
925
|
+
* The points of tile `key` of a vector tile layer, after the tile itself (`setVectorTile`, `setVectorTileMesh`):
|
|
926
|
+
* Mercator, interleaved, each with its feature (styled as a circle's: a color, a radius and a stroke width, then the
|
|
927
|
+
* stroke's color), `start` the first point of each sublayer and the end; the circle sublayers draw theirs
|
|
928
|
+
*/
|
|
929
|
+
setVectorTilePoints(id: number, key: number, points: Float64Array, feature: Uint32Array, start: Uint32Array): void;
|
|
905
930
|
/**
|
|
906
931
|
* Adds or replaces tile `key` of a vector tile layer: its polygons as for `addFills` (`fill_start`: the first
|
|
907
932
|
* polygon of each sublayer, and the end; those of an extrusion sublayer raised into blocks), its lines as for
|
|
908
933
|
* `addLines` (`line_start`: the first line of each sublayer, and the end), `feature_count` features, styled as an
|
|
909
934
|
* extrusion layer's (`setFeatureStyle` with the key: a color, then a line's width or a block's height and base);
|
|
910
935
|
* `tile`: the corners of the tile they are cut to (west, north, east, south; empty: none), along whose edges no
|
|
911
|
-
* wall of a block rises
|
|
936
|
+
* wall of a block rises; `roofs` and `roof_heights`: per polygon, the shape and height of its block's roof
|
|
937
|
+
* (`shapes::Roofs`: 0 flat, 1 to 5 `RoofShape::number`, 255 generated from its outline; metres, not a number: as
|
|
938
|
+
* its slopes make it; empty: flat), the whole outlines of the buildings the tile cuts (`roof_outlines`, interleaved
|
|
939
|
+
* Mercator points, `roof_outline_start`: where each polygon's starts, and the end), `roof_metres` the metres per
|
|
940
|
+
* Mercator unit at the tile
|
|
912
941
|
*
|
|
913
942
|
* # Errors
|
|
914
943
|
*
|
|
915
944
|
* Throws (to JavaScript) when a WebGL object of the tile cannot be created, or when its features or lines need a
|
|
916
945
|
* table texture past the GPU's `MAX_TEXTURE_SIZE`
|
|
917
946
|
*/
|
|
918
|
-
setVectorTile(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, polygon_feature: Uint32Array, fill_start: Uint32Array, line_points: Float64Array, line_first: Uint32Array, line_feature: Uint32Array, line_start: Uint32Array, feature_count: number, tile: Float64Array): void;
|
|
947
|
+
setVectorTile(id: number, key: number, points: Float64Array, ring_start: Uint32Array, polygon_start: Uint32Array, polygon_feature: Uint32Array, fill_start: Uint32Array, line_points: Float64Array, line_first: Uint32Array, line_feature: Uint32Array, line_start: Uint32Array, feature_count: number, tile: Float64Array, roofs: Uint8Array, roof_heights: Float32Array, roof_outlines: Float64Array, roof_outline_start: Uint32Array, roof_metres: number): void;
|
|
919
948
|
/**
|
|
920
949
|
* Shows what can be seen from points, each within its range: `observers` holds 8 numbers per observer
|
|
921
950
|
* (16 at most): longitude, latitude (degrees), metres above the ground, range (metres), then to look one way
|
|
@@ -989,6 +1018,11 @@ export class Engine {
|
|
|
989
1018
|
* A region of the icon atlas: `width` × `height` RGBA texels (premultiplied) at (`x`, `y`)
|
|
990
1019
|
*/
|
|
991
1020
|
updateIconAtlas(x: number, y: number, width: number, height: number, data: Uint8Array): void;
|
|
1021
|
+
/**
|
|
1022
|
+
* Uploads a part more of the blocks of tile `key` of a vector tile layer (a large tile's, a part at a time over
|
|
1023
|
+
* several frames); whether some are left. Its blocks are drawn once they are all there
|
|
1024
|
+
*/
|
|
1025
|
+
uploadVectorTile(id: number, key: number): boolean;
|
|
992
1026
|
/**
|
|
993
1027
|
* Vector tiles (512 CSS pixels across at their level, as `MapLibre`'s) for the view of the last frame (else the
|
|
994
1028
|
* camera's), levels `min_z` to `max_z`, three numbers per tile (z, x, y), the nearest to the eye first: what a
|
|
@@ -1078,7 +1112,8 @@ export interface InitOutput {
|
|
|
1078
1112
|
readonly engine_setCircleAlignment: (a: number, b: number, c: number) => void;
|
|
1079
1113
|
readonly engine_setCircles: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1080
1114
|
readonly engine_setExtrusionAnchors: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
1081
|
-
readonly engine_setExtrusionBatch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number];
|
|
1115
|
+
readonly engine_setExtrusionBatch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => [number, number];
|
|
1116
|
+
readonly engine_setFacades: (a: number, b: number, c: number) => void;
|
|
1082
1117
|
readonly engine_setFeatureLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1083
1118
|
readonly engine_setFeatureMask: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1084
1119
|
readonly engine_setFeatureRamp: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
@@ -1104,6 +1139,8 @@ export interface InitOutput {
|
|
|
1104
1139
|
readonly engine_setLineDash: (a: number, b: number, c: number, d: number) => void;
|
|
1105
1140
|
readonly engine_setLines: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
1106
1141
|
readonly engine_setMaxPitch: (a: number, b: number) => void;
|
|
1142
|
+
readonly engine_setModelGlow: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1143
|
+
readonly engine_setModelHighlight: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1107
1144
|
readonly engine_setModelInstances: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1108
1145
|
readonly engine_setNetworkCosts: (a: number, b: number, c: number, d: number) => void;
|
|
1109
1146
|
readonly engine_setNetworkRamp: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -1118,14 +1155,15 @@ export interface InitOutput {
|
|
|
1118
1155
|
readonly engine_setSky: (a: number, b: number) => void;
|
|
1119
1156
|
readonly engine_setSun: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
1120
1157
|
readonly engine_setSwipe: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1121
|
-
readonly engine_setSymbolLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1122
|
-
readonly engine_setSymbols: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
|
|
1158
|
+
readonly engine_setSymbolLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
1159
|
+
readonly engine_setSymbols: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number];
|
|
1123
1160
|
readonly engine_setTerrain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
1124
1161
|
readonly engine_setTileLoader: (a: number, b: any) => void;
|
|
1125
1162
|
readonly engine_setTiles3dStyle: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
1126
|
-
readonly engine_setVectorSublayers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => void;
|
|
1127
|
-
readonly engine_setVectorTile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number) => [number, number];
|
|
1163
|
+
readonly engine_setVectorSublayers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number) => void;
|
|
1164
|
+
readonly engine_setVectorTile: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number) => [number, number];
|
|
1128
1165
|
readonly engine_setVectorTileMesh: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number) => [number, number];
|
|
1166
|
+
readonly engine_setVectorTilePoints: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
1129
1167
|
readonly engine_setViewshed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
|
|
1130
1168
|
readonly engine_setZoomRange: (a: number, b: number, c: number) => void;
|
|
1131
1169
|
readonly engine_stats: (a: number) => any;
|
|
@@ -1139,6 +1177,7 @@ export interface InitOutput {
|
|
|
1139
1177
|
readonly engine_updateGlyphPage: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
1140
1178
|
readonly engine_updateGroundTexture: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number];
|
|
1141
1179
|
readonly engine_updateIconAtlas: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
1180
|
+
readonly engine_uploadVectorTile: (a: number, b: number, c: number) => number;
|
|
1142
1181
|
readonly engine_vectorTilesInView: (a: number, b: number, c: number) => [number, number];
|
|
1143
1182
|
readonly engine_wantedTiles: (a: number, b: number) => [number, number];
|
|
1144
1183
|
readonly engine_zoomAt: (a: number, b: number, c: number, d: number) => void;
|