isard 1.1.0 → 1.3.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 +121 -0
- package/README.md +44 -39
- package/dist/basemap/basemaps.d.ts +1 -1
- package/dist/basemap/basemaps.js +2 -2
- package/dist/basemap/basemaps.js.map +1 -1
- package/dist/basemap/grid.d.ts +5 -5
- package/dist/basemap/grid.js +59 -65
- package/dist/basemap/grid.js.map +1 -1
- package/dist/basemap/mvt.d.ts +1 -1
- package/dist/basemap/mvt.js +6 -6
- package/dist/basemap/mvt.js.map +1 -1
- package/dist/basemap/pmtiles.d.ts +10 -10
- package/dist/basemap/pmtiles.js +39 -31
- package/dist/basemap/pmtiles.js.map +1 -1
- package/dist/basemap/pmtileslayer.d.ts +33 -0
- package/dist/basemap/pmtileslayer.js +97 -0
- package/dist/basemap/pmtileslayer.js.map +1 -0
- package/dist/basemap/resample.d.ts +2 -2
- package/dist/basemap/resample.js +16 -14
- package/dist/basemap/resample.js.map +1 -1
- package/dist/basemap/terrain.d.ts +3 -3
- package/dist/basemap/terrain.js +6 -6
- package/dist/basemap/terrain.js.map +1 -1
- package/dist/basemap/trees.d.ts +26 -0
- package/dist/basemap/trees.js +141 -0
- package/dist/basemap/trees.js.map +1 -0
- package/dist/basemap/vectorstyle.d.ts +22 -10
- package/dist/basemap/vectorstyle.js +163 -110
- package/dist/basemap/vectorstyle.js.map +1 -1
- package/dist/basemap/vectortiles.d.ts +70 -47
- package/dist/basemap/vectortiles.js +480 -358
- package/dist/basemap/vectortiles.js.map +1 -1
- package/dist/basemap/wmts.d.ts +3 -3
- package/dist/basemap/wmts.js +16 -11
- package/dist/basemap/wmts.js.map +1 -1
- package/dist/basemap/workerpool.d.ts +17 -0
- package/dist/basemap/workerpool.js +194 -0
- package/dist/basemap/workerpool.js.map +1 -0
- package/dist/basemap.worker.js +2 -2
- package/dist/basemap.worker.js.map +21 -13
- package/dist/bind/layers.d.ts +13 -4
- package/dist/bind/layers.js +64 -40
- package/dist/bind/layers.js.map +1 -1
- package/dist/data/crs.d.ts +10 -10
- package/dist/data/crs.js +38 -34
- package/dist/data/crs.js.map +1 -1
- package/dist/data/gpx.d.ts +1 -1
- package/dist/data/gpx.js +20 -20
- package/dist/data/gpx.js.map +1 -1
- package/dist/data/kml.d.ts +1 -1
- package/dist/data/kml.js +42 -39
- package/dist/data/kml.js.map +1 -1
- package/dist/data/topojson.d.ts +1 -1
- package/dist/data/topojson.js +15 -10
- package/dist/data/topojson.js.map +1 -1
- package/dist/data/xml.d.ts +5 -5
- package/dist/data/xml.js +19 -18
- package/dist/data/xml.js.map +1 -1
- package/dist/decoder.worker.js +4 -4
- package/dist/decoder.worker.js.map +6 -6
- package/dist/engine/decoders.d.ts +2 -2
- package/dist/engine/decoders.js +28 -25
- package/dist/engine/decoders.js.map +1 -1
- package/dist/engine/loader.js +13 -14
- package/dist/engine/loader.js.map +1 -1
- package/dist/engine/requests.d.ts +1 -1
- package/dist/engine/requests.js +19 -16
- package/dist/engine/requests.js.map +1 -1
- package/dist/engine-loader.d.ts +13 -9
- package/dist/engine-loader.js +38 -28
- package/dist/engine-loader.js.map +1 -1
- package/dist/geoplateforme.d.ts +26 -10
- package/dist/geoplateforme.js +45 -20
- package/dist/geoplateforme.js.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +9 -2
- 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_points_bg.wasm +0 -0
- package/dist/isard_tess_bg.wasm +0 -0
- package/dist/layers/extrusions.d.ts +1 -1
- package/dist/layers/extrusions.js +10 -5
- package/dist/layers/extrusions.js.map +1 -1
- package/dist/layers/features.d.ts +10 -10
- package/dist/layers/features.js +41 -42
- package/dist/layers/features.js.map +1 -1
- package/dist/layers/glyphs.d.ts +3 -3
- package/dist/layers/glyphs.js +34 -40
- package/dist/layers/glyphs.js.map +1 -1
- package/dist/layers/icons.d.ts +8 -8
- package/dist/layers/icons.js +76 -68
- package/dist/layers/icons.js.map +1 -1
- package/dist/layers/layers.d.ts +1 -1
- package/dist/layers/layers.js +42 -29
- package/dist/layers/layers.js.map +1 -1
- package/dist/layers/panoramas.d.ts +2 -2
- package/dist/layers/panoramas.js +52 -41
- package/dist/layers/panoramas.js.map +1 -1
- package/dist/layers/pointclouds.d.ts +3 -3
- package/dist/layers/pointclouds.js +25 -33
- package/dist/layers/pointclouds.js.map +1 -1
- package/dist/layers/symbols.d.ts +1 -1
- package/dist/layers/symbols.js +68 -71
- package/dist/layers/symbols.js.map +1 -1
- package/dist/layers/vectors.d.ts +60 -0
- package/dist/layers/vectors.js +130 -0
- package/dist/layers/vectors.js.map +1 -0
- package/dist/map/basemap-layers.d.ts +26 -0
- package/dist/map/basemap-layers.js +61 -0
- package/dist/map/basemap-layers.js.map +1 -0
- package/dist/map/canvas.d.ts +17 -0
- package/dist/map/canvas.js +56 -0
- package/dist/map/canvas.js.map +1 -0
- package/dist/map/checks.d.ts +11 -0
- package/dist/map/checks.js +39 -0
- package/dist/map/checks.js.map +1 -0
- package/dist/map/credits.d.ts +17 -0
- package/dist/map/credits.js +34 -0
- package/dist/map/credits.js.map +1 -0
- package/dist/map/engine-settings.d.ts +15 -0
- package/dist/map/engine-settings.js +45 -0
- package/dist/map/engine-settings.js.map +1 -0
- package/dist/map/engines.d.ts +41 -0
- package/dist/map/engines.js +77 -0
- package/dist/map/engines.js.map +1 -0
- package/dist/map/events.d.ts +14 -0
- package/dist/map/events.js +46 -0
- package/dist/map/events.js.map +1 -0
- package/dist/map/frame-loop.d.ts +64 -0
- package/dist/map/frame-loop.js +145 -0
- package/dist/map/frame-loop.js.map +1 -0
- package/dist/map/hover-pick.d.ts +30 -0
- package/dist/map/hover-pick.js +56 -0
- package/dist/map/hover-pick.js.map +1 -0
- package/dist/map/layer-spec.d.ts +42 -0
- package/dist/map/layer-spec.js +34 -0
- package/dist/map/layer-spec.js.map +1 -0
- package/dist/map/layer-stack.d.ts +36 -0
- package/dist/map/layer-stack.js +101 -0
- package/dist/map/layer-stack.js.map +1 -0
- package/dist/map/overlay-host.d.ts +36 -0
- package/dist/map/overlay-host.js +101 -0
- package/dist/map/overlay-host.js.map +1 -0
- package/dist/map/panorama-host.d.ts +5 -0
- package/dist/map/panorama-host.js +32 -0
- package/dist/map/panorama-host.js.map +1 -0
- package/dist/map/raster-source.d.ts +11 -0
- package/dist/map/raster-source.js +26 -0
- package/dist/map/raster-source.js.map +1 -0
- package/dist/map/symbol-atlases.d.ts +26 -0
- package/dist/map/symbol-atlases.js +59 -0
- package/dist/map/symbol-atlases.js.map +1 -0
- package/dist/map/viewshed.d.ts +5 -0
- package/dist/map/viewshed.js +28 -0
- package/dist/map/viewshed.js.map +1 -0
- package/dist/map/workers.d.ts +46 -0
- package/dist/map/workers.js +73 -0
- package/dist/map/workers.js.map +1 -0
- package/dist/map.d.ts +54 -126
- package/dist/map.js +227 -698
- package/dist/map.js.map +1 -1
- package/dist/react/Control.d.ts +11 -0
- package/dist/react/Control.js +18 -0
- package/dist/react/Control.js.map +1 -0
- package/dist/react/CustomLayer.d.ts +11 -0
- package/dist/react/CustomLayer.js +30 -0
- package/dist/react/CustomLayer.js.map +1 -0
- package/dist/react/IsardMap.d.ts +43 -0
- package/dist/react/IsardMap.js +147 -0
- package/dist/react/IsardMap.js.map +1 -0
- package/dist/react/Layer.d.ts +42 -0
- package/dist/react/Layer.js +74 -0
- package/dist/react/Layer.js.map +1 -0
- package/dist/react/Marker.d.ts +24 -0
- package/dist/react/Marker.js +53 -0
- package/dist/react/Marker.js.map +1 -0
- package/dist/react/Panel.d.ts +11 -0
- package/dist/react/Panel.js +37 -0
- package/dist/react/Panel.js.map +1 -0
- package/dist/react/Popup.d.ts +18 -0
- package/dist/react/Popup.js +60 -0
- package/dist/react/Popup.js.map +1 -0
- package/dist/react/Swipe.d.ts +16 -0
- package/dist/react/Swipe.js +52 -0
- package/dist/react/Swipe.js.map +1 -0
- package/dist/react/VectorGeometry.d.ts +35 -0
- package/dist/react/VectorGeometry.js +82 -0
- package/dist/react/VectorGeometry.js.map +1 -0
- package/dist/react/Viewshed.d.ts +5 -0
- package/dist/react/Viewshed.js +28 -0
- package/dist/react/Viewshed.js.map +1 -0
- package/dist/react/context.d.ts +33 -0
- package/dist/react/context.js +20 -0
- package/dist/react/context.js.map +1 -0
- package/dist/react/index.d.ts +16 -108
- package/dist/react/index.js +11 -397
- package/dist/react/index.js.map +1 -1
- package/dist/settings.d.ts +5 -9
- package/dist/settings.js +17 -15
- package/dist/settings.js.map +1 -1
- package/dist/types.d.ts +27 -4
- package/dist/types.js.map +1 -1
- package/dist/ui/controls.js +6 -4
- package/dist/ui/controls.js.map +1 -1
- package/dist/ui/interaction.d.ts +2 -2
- package/dist/ui/interaction.js +8 -7
- package/dist/ui/interaction.js.map +1 -1
- package/dist/ui/minimap.d.ts +25 -0
- package/dist/ui/minimap.js +90 -0
- package/dist/ui/minimap.js.map +1 -0
- package/dist/ui/overlay.js +18 -20
- package/dist/ui/overlay.js.map +1 -1
- package/dist/ui/scale.d.ts +19 -0
- package/dist/ui/scale.js +44 -0
- package/dist/ui/scale.js.map +1 -0
- package/dist/ui/search.d.ts +25 -0
- package/dist/ui/search.js +119 -0
- package/dist/ui/search.js.map +1 -0
- package/dist/ui/style.d.ts +1 -1
- package/dist/ui/style.js +19 -2
- package/dist/ui/style.js.map +1 -1
- package/dist/util/animation.d.ts +3 -3
- package/dist/util/animation.js +6 -6
- package/dist/util/animation.js.map +1 -1
- package/dist/util/color.d.ts +1 -1
- package/dist/util/color.js +14 -16
- package/dist/util/color.js.map +1 -1
- package/dist/util/geo.d.ts +6 -6
- package/dist/util/geo.js +12 -12
- package/dist/util/geo.js.map +1 -1
- package/dist/util/guards.d.ts +7 -0
- package/dist/util/guards.js +8 -0
- package/dist/util/guards.js.map +1 -0
- package/dist/util/lru.js.map +1 -1
- package/dist/util/sun.d.ts +11 -0
- package/dist/util/sun.js +26 -0
- package/dist/util/sun.js.map +1 -0
- package/dist/wasm/isard.d.ts +250 -7
- package/dist/wasm/isard.js +375 -8
- package/dist/wasm/isard_core.d.ts +226 -7
- package/dist/wasm/isard_core.js +351 -8
- package/dist/wasm/isard_tess.d.ts +109 -0
- package/dist/wasm/isard_tess.js +398 -0
- package/dist/workers/basemap/geometry.d.ts +72 -0
- package/dist/workers/basemap/labels.d.ts +8 -0
- package/dist/workers/basemap/raster.d.ts +10 -0
- package/dist/workers/basemap/tiles.d.ts +65 -0
- package/dist/workers/basemap/trees.d.ts +19 -0
- package/dist/workers/basemap.worker.d.ts +126 -22
- package/dist/workers/basemap.worker.js +76 -544
- package/dist/workers/basemap.worker.js.map +1 -1
- package/package.json +5 -4
- package/vite.js +10 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workers.js","sourceRoot":"","sources":["../../src/map/workers.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * A map's workers: the pool drawing vector tiles, shared by the map's `VectorTiles`, which also decodes the relief and\n * reprojects rasters off the page; and the loaders of the relief, one per tile source.\n */\n\nimport type { RemoteReprojection } from '../basemap/grid.ts';\nimport { encodedTerrainLoader, type PngEncoding, type RemoteHeights } from '../basemap/terrain.ts';\nimport { BasemapWorkers, defaultWorkerCount } from '../basemap/workerpool.ts';\nimport type { TerrainLoader } from '../settings.ts';\nimport type { GeoMapOptions } from '../types.ts';\n\n/** The workers of a map, created on first use */\nexport class MapWorkers {\n /** URL of the workers' script */\n readonly url: string | URL;\n private readonly workers: GeoMapOptions['workers'];\n /** The map is destroyed: nothing more is sent to the workers */\n private readonly gone: () => boolean;\n /** Whose requests the workers' answer (cancelled together) */\n private readonly owner: object;\n /** The shared pool, created on first use */\n private shared: BasemapWorkers | undefined;\n /** The loaders of the relief by encoding, URL and floor: the same loader for the same tiles (the engine keeps its\n * tiles when only the exaggeration changes) */\n private readonly terrainLoaders = new Map<string, TerrainLoader>();\n\n /** `workers`: the map's option (false or 0, no worker); `owner`: the map */\n constructor(url: string | URL, workers: GeoMapOptions['workers'], gone: () => boolean, owner: object) {\n this.url = url;\n this.workers = workers;\n this.gone = gone;\n this.owner = owner;\n }\n\n /**\n * The workers for a `VectorTiles`: the shared pool, or a pool of its own (`own`, to stop with it) when it asks for\n * another count or URL\n */\n pool(count?: number, url?: string | URL): { pool: BasemapWorkers; own: boolean } {\n const shared = defaultWorkerCount();\n const workers = Math.max(1, count ?? shared);\n const workerUrl = url ?? this.url;\n\n if (workers === shared && String(workerUrl) === String(this.url)) {\n this.shared ??= new BasemapWorkers(shared, this.url);\n\n return { pool: this.shared, own: false };\n }\n\n return { pool: new BasemapWorkers(workers, workerUrl), own: true };\n }\n\n /** Stops the shared pool */\n terminate(): void {\n this.shared?.terminate();\n this.shared = undefined;\n }\n\n /** Rasters reprojected by the workers (in the page without them) */\n readonly remoteReprojection: RemoteReprojection = (job, tile, signal) =>\n this.decodingPool()?.reproject(job, tile, signal, this.owner);\n\n /** The loader of the relief tiles of `url` in a PNG encoding (one per URL, encoding and floor) */\n readonly terrainLoader = (url: string, encoding: PngEncoding, floor?: number): TerrainLoader => {\n const key = `${encoding} ${floor ?? ''} ${url}`;\n const cached = this.terrainLoaders.get(key);\n\n if (cached) return cached;\n\n const loader = encodedTerrainLoader(url, encoding, floor, this.remoteHeights);\n\n this.terrainLoaders.set(key, loader);\n\n return loader;\n };\n\n private readonly remoteHeights: RemoteHeights = (url, encoding, floor, tile, signal) =>\n this.decodingPool()?.heights(url, encoding, floor, tile, signal, this.owner);\n\n /**\n * The workers decoding the relief and reprojecting rasters: the shared pool, unless the map has no workers\n * (`workers: false` or 0, or none in this browser): that is done in the page then\n */\n private decodingPool(): BasemapWorkers | undefined {\n const workers = this.workers;\n\n if (this.gone() || workers === false || (workers !== undefined && workers <= 0)) return undefined;\n if (typeof Worker === 'undefined' || typeof OffscreenCanvas === 'undefined') return undefined;\n\n return this.pool().pool;\n }\n}\n"]}
|
package/dist/map.d.ts
CHANGED
|
@@ -2,109 +2,79 @@
|
|
|
2
2
|
* The map: canvas, camera, layers, events, overlays, credits and the frame loop. Frames are drawn on demand only: an
|
|
3
3
|
* idle map costs nothing. Hover events are coalesced to one per frame, so the values computed for a mouse position are
|
|
4
4
|
* drawn in the same frame. The engine's loading is in engine-loader.ts, its settings from the options in settings.ts,
|
|
5
|
-
* the camera animations in animation.ts
|
|
5
|
+
* the camera animations in animation.ts; the parts of the map with a state of their own (the drawing order of the
|
|
6
|
+
* layers, the overlays and controls, the frame loop, the hover picking, the workers…) in map/.
|
|
6
7
|
*/
|
|
7
|
-
import { type PmtilesOptions
|
|
8
|
+
import { type PmtilesOptions } from './basemap/pmtileslayer.ts';
|
|
9
|
+
import { VectorTiles, type VectorTilesOptions } from './basemap/vectortiles.ts';
|
|
8
10
|
import { ExtrusionLayer, type ExtrusionOptions } from './layers/extrusions.ts';
|
|
9
11
|
import { CircleLayer, type CircleOptions, FillLayer, type FillOptions, LineLayer, type LineOptions } from './layers/features.ts';
|
|
10
|
-
import {
|
|
12
|
+
import type { ImageOptions, Pixels } from './layers/icons.ts';
|
|
11
13
|
import { CustomLayer, type CustomLayerInterface, GroundLayer, type GroundOptions, type Layer, ModelLayer, type ModelOptions, NetworkLayer, RasterLayer, Tiles3dLayer } from './layers/layers.ts';
|
|
12
14
|
import { type PanoramaOptions, type Panoramas } from './layers/panoramas.ts';
|
|
13
15
|
import { PointCloudLayer, type PointCloudOptions } from './layers/pointclouds.ts';
|
|
14
16
|
import { SymbolLayer, type SymbolOptions } from './layers/symbols.ts';
|
|
15
|
-
import
|
|
17
|
+
import { type HoverPicking } from './map/hover-pick.ts';
|
|
18
|
+
import { type LayerSpec } from './map/layer-spec.ts';
|
|
19
|
+
import type { AnimationOptions, AtmosphereOptions, Basemap, FeatureHit, FirstPersonView, FlyToOptions, GeoMapOptions, LoadingMode, LonLat, MapEvents, NetworkOptions, Point, Projection, RasterOptions, SunOptions, SwipeOptions, TerrainModel, TerrainOptions, Tiles3dOptions, ViewshedOptions } from './types.ts';
|
|
16
20
|
import { type Control, type ControlPosition } from './ui/controls.ts';
|
|
17
21
|
import type { Camera, PickHit, RasterLayerStats } from './wasm/isard.js';
|
|
22
|
+
export type { LayerSpec } from './map/layer-spec.ts';
|
|
18
23
|
/** A map (see `GeoMap.create`); layers take it as their host */
|
|
19
24
|
export declare class GeoMap {
|
|
20
25
|
#private;
|
|
21
26
|
readonly canvas: HTMLCanvasElement;
|
|
22
|
-
/**
|
|
23
|
-
private readonly
|
|
24
|
-
/** The
|
|
25
|
-
private
|
|
26
|
-
|
|
27
|
-
private readonly
|
|
28
|
-
/**
|
|
29
|
-
private readonly
|
|
27
|
+
/** The engine class (core, or with 3D Tiles) and the engine with 3D Tiles loaded when needed */
|
|
28
|
+
private readonly engines;
|
|
29
|
+
/** The layers in drawing order and those kept on top */
|
|
30
|
+
private readonly stack;
|
|
31
|
+
/** The basemap and the hillshade */
|
|
32
|
+
private readonly basemaps;
|
|
33
|
+
/** The glyphs and icons of the symbol layers */
|
|
34
|
+
private readonly atlases;
|
|
35
|
+
/** The workers of the vector tiles, the relief and the reprojected rasters */
|
|
36
|
+
private readonly workers;
|
|
30
37
|
private readonly container;
|
|
31
|
-
/**
|
|
32
|
-
private readonly
|
|
33
|
-
private readonly corners;
|
|
34
|
-
private readonly controls;
|
|
35
|
-
private readonly positioned;
|
|
36
|
-
/** Canvas size in CSS pixels, kept on resize so placing overlays never reads the layout */
|
|
37
|
-
private size;
|
|
38
|
-
/** Layers in drawing order (bottom first), to recreate them after a context loss */
|
|
39
|
-
private readonly layers;
|
|
38
|
+
/** The canvas in the container, the markers and popups over it, the controls in its corners */
|
|
39
|
+
private readonly overlays;
|
|
40
40
|
private readonly settings;
|
|
41
41
|
/** The WebGL context is lost: nothing is drawn until it is restored */
|
|
42
42
|
private lost;
|
|
43
|
+
private gone;
|
|
43
44
|
private readonly listeners;
|
|
45
|
+
/** Frames drawn on demand, with their events */
|
|
46
|
+
private readonly frames;
|
|
44
47
|
private readonly resizeObserver;
|
|
45
48
|
private readonly interaction;
|
|
46
|
-
private loader;
|
|
47
|
-
/** The class of the engine: without 3D Tiles until a 3D Tiles layer is added, unless asked for from the start */
|
|
48
|
-
private engineClass;
|
|
49
|
-
/** The module of the engine with 3D Tiles once it runs this map (the decoding workers run it too) */
|
|
50
|
-
private tiles3dModule;
|
|
51
|
-
/** The engine with 3D Tiles is loading, for the 3D Tiles layers added on the core engine */
|
|
52
|
-
private upgrading;
|
|
53
|
-
/** What loading the engine with 3D Tiles and its workers needs */
|
|
54
|
-
private readonly tiles3dOptions;
|
|
55
|
-
private gone;
|
|
56
49
|
/** The map is of the Earth: a basemap by default */
|
|
57
50
|
private readonly earth;
|
|
58
51
|
/** The body, as the option named it */
|
|
59
52
|
private readonly body;
|
|
60
|
-
|
|
61
|
-
private
|
|
62
|
-
/**
|
|
63
|
-
private readonly
|
|
64
|
-
/** Credits of the raster layers that have some (basemaps, hillshade, the Géoplateforme's rasters…) */
|
|
65
|
-
private readonly rasterCredits;
|
|
66
|
-
private animation;
|
|
67
|
-
private hoverPoint;
|
|
68
|
-
/** Frame polling the engine for the answer of the hover picking, 0 if none */
|
|
69
|
-
private hoverPoll;
|
|
70
|
-
/** Polls of the hover picking under way: given up after `MAX_POLLS` (an answer that never comes) */
|
|
71
|
-
private hoverPolls;
|
|
53
|
+
/** Credits of the raster layers that have some, and the attribution controls told when they change */
|
|
54
|
+
private readonly credits;
|
|
55
|
+
/** The picking for 'hoverfeature', its answer emitted on a later frame */
|
|
56
|
+
private readonly hoverPick;
|
|
72
57
|
/** What 'hoverfeature' looks for: within `radius` CSS pixels, in `layers` only if given */
|
|
73
|
-
hoverPicking:
|
|
74
|
-
radius?: number;
|
|
75
|
-
layers?: readonly Layer[];
|
|
76
|
-
};
|
|
77
|
-
private frameRequest;
|
|
78
|
-
private lastCamera;
|
|
79
|
-
/** The camera moved since the last 'moveend' */
|
|
80
|
-
private moving;
|
|
81
|
-
/** The last frame found everything loaded ('idle' sent) */
|
|
82
|
-
private settled;
|
|
83
|
-
private inFrame;
|
|
84
|
-
/** The camera of the frame being drawn: what `getCamera` gives the custom layers while the engine is busy */
|
|
85
|
-
private frameCamera;
|
|
58
|
+
hoverPicking: HoverPicking;
|
|
86
59
|
/** Vector tiles made by `vectorTiles()`, destroyed with the map */
|
|
87
60
|
private readonly vectorSets;
|
|
88
|
-
/** The workers drawing vector tiles, shared by every `VectorTiles` of the map; created on first use */
|
|
89
|
-
private basemapPool;
|
|
90
61
|
/** Stops watching the device pixel ratio */
|
|
91
|
-
private unwatchRatio;
|
|
62
|
+
private readonly unwatchRatio;
|
|
92
63
|
/** Stops following the page's request headers (`setRequestHeaders`) */
|
|
93
64
|
private unwatchHeaders;
|
|
94
65
|
/** Stops listening to the canvas's context loss and restoration */
|
|
95
66
|
private readonly unwatchContext;
|
|
96
|
-
/** The loaders of the relief by encoding, URL and floor: the same loader for the same tiles (the engine keeps its
|
|
97
|
-
* tiles when only the exaggeration changes) */
|
|
98
|
-
private readonly terrainLoaders;
|
|
99
67
|
/** Loads the engine (once per page) and creates a map filling `container` */
|
|
100
68
|
static create(container: HTMLElement, given?: GeoMapOptions): Promise<GeoMap>;
|
|
101
69
|
private constructor();
|
|
102
70
|
/** The element the map was created in */
|
|
103
71
|
getContainer(): HTMLElement;
|
|
104
72
|
getCanvas(): HTMLCanvasElement;
|
|
73
|
+
/** Layers in drawing order (bottom first) */
|
|
74
|
+
private get layers();
|
|
75
|
+
/** Layers new layers go under */
|
|
76
|
+
private get onTop();
|
|
105
77
|
private createEngine;
|
|
106
|
-
/** The decoding workers of 3D Tiles, with the engine that has them (they run its module) and unless turned off */
|
|
107
|
-
private startLoader;
|
|
108
78
|
/** A 3D Tiles layer or a model on the core engine: loads the engine with 3D Tiles, then rebuilds the map on it
|
|
109
79
|
* (camera, settings and layers kept, as after a context loss); the layer is created then */
|
|
110
80
|
private upgrade;
|
|
@@ -126,17 +96,12 @@ export declare class GeoMap {
|
|
|
126
96
|
/**
|
|
127
97
|
* Compares two states of a place: `layers` shown on one side of a vertical line only, at `position` CSS pixels
|
|
128
98
|
* from the left of the map (left of it by default, `side: 'right'` for the other), the layers beneath them on the
|
|
129
|
-
* other side
|
|
99
|
+
* other side; `other`: layers shown on the other side only (two meshes of a place, each on its side). Set again as
|
|
100
|
+
* the line moves (a slider, a drag); undefined stops
|
|
130
101
|
*/
|
|
131
102
|
setSwipe(options: SwipeOptions | undefined): void;
|
|
132
103
|
private applySwipe;
|
|
133
|
-
/** Takes a layer out of the drawing order (to put it back elsewhere, or for good) */
|
|
134
|
-
private unlist;
|
|
135
104
|
private addLayer;
|
|
136
|
-
/** Index in the engine of the layer at `index`: the layers waiting for the engine with 3D Tiles are not in it yet */
|
|
137
|
-
private engineIndex;
|
|
138
|
-
/** Moves a layer under all the others */
|
|
139
|
-
private toBottom;
|
|
140
105
|
/** Listens to an event; returns the function that stops listening */
|
|
141
106
|
on<K extends keyof MapEvents>(type: K, listener: (event: MapEvents[K]) => void): () => void;
|
|
142
107
|
/**
|
|
@@ -171,9 +136,10 @@ export declare class GeoMap {
|
|
|
171
136
|
readonly elevationAt: (lonLat: LonLat) => number | undefined;
|
|
172
137
|
readonly metersPerPixel: (point?: Point) => number | undefined;
|
|
173
138
|
};
|
|
174
|
-
/** What is drawn over the scene, together: `viewshed` (`setViewshed`), `swipe` (`setSwipe`) */
|
|
139
|
+
/** What is drawn over the scene, together: `viewshed` (`setViewshed`), `sun` (`setSun`), `swipe` (`setSwipe`) */
|
|
175
140
|
readonly effects: {
|
|
176
141
|
readonly viewshed: (options: ViewshedOptions | readonly ViewshedOptions[] | undefined) => void;
|
|
142
|
+
readonly sun: (options: SunOptions | undefined) => void;
|
|
177
143
|
readonly swipe: (options: SwipeOptions | undefined) => void;
|
|
178
144
|
};
|
|
179
145
|
getCamera(): Camera;
|
|
@@ -199,18 +165,29 @@ export declare class GeoMap {
|
|
|
199
165
|
setLoading(mode: LoadingMode): void;
|
|
200
166
|
/** Space behind the globe (stars, atmosphere halo) */
|
|
201
167
|
setSky(enabled: boolean): void;
|
|
168
|
+
/** The viewshed set, set again in a new engine */
|
|
169
|
+
private viewshed;
|
|
170
|
+
/** The sun set, set again in a new engine */
|
|
171
|
+
private sun;
|
|
172
|
+
/**
|
|
173
|
+
* The sun casting shadows: the buildings, trees, models, 3D Tiles and the relief shade the ground and one another,
|
|
174
|
+
* the walls turned away from it are in their own shade; the labels stay over them. The sun stands where it is at
|
|
175
|
+
* `date` over the map's center (now by default), or at `azimuth` and `altitude`. As it sets the night falls (`night`
|
|
176
|
+
* to set it by hand): the scene tinted in its blue, the windows of the buildings and the streets of `vectors()` lit,
|
|
177
|
+
* the labels light on dark.
|
|
178
|
+
* The shadows cover the ground around the view's center, fading out away from it, and cost two more depth passes
|
|
179
|
+
* of the solid scene each frame. Undefined removes them
|
|
180
|
+
*/
|
|
181
|
+
setSun(options: SunOptions | undefined): void;
|
|
202
182
|
/** Tints what can be seen from a point and what is hidden from it, within a range, all around or within a cone
|
|
203
183
|
* (`direction`): the relief, extrusions, 3D Tiles and models hide what lies behind them (only what the map has
|
|
204
184
|
* loaded for its view). Several observers (16 at most): what any of them sees is seen, what is hidden from all those
|
|
205
185
|
* that reach it is hidden, in the colors and opacity of the first. Undefined or none removes it */
|
|
206
|
-
/** The viewshed set, set again in a new engine */
|
|
207
|
-
private viewshed;
|
|
208
186
|
setViewshed(options: ViewshedOptions | readonly ViewshedOptions[] | undefined): void;
|
|
209
187
|
/** Relief under the basemap: true for the body's terrain model (on the Earth the worldwide Terrain Tiles, NASA's
|
|
210
188
|
* on the Moon and Mars), one of the Earth's models by name (`'ign'`), its options, or false; on another body, its
|
|
211
189
|
* options with a `url` */
|
|
212
190
|
setTerrain(terrain: boolean | TerrainModel | TerrainOptions): void;
|
|
213
|
-
private attributionChanged;
|
|
214
191
|
/** Color behind the map, a CSS color (its alpha ignored) */
|
|
215
192
|
setBackground(color: string): void;
|
|
216
193
|
/** Tile counters of the raster layers, for diagnostics */
|
|
@@ -232,10 +209,6 @@ export declare class GeoMap {
|
|
|
232
209
|
}): FeatureHit | undefined;
|
|
233
210
|
/** A hit with its layer handle and feature; undefined if the layer is gone */
|
|
234
211
|
private featureHit;
|
|
235
|
-
/** Asks the engine what is under the pointer; its answer, read without waiting for the GPU, comes on a later frame */
|
|
236
|
-
private requestHoverPick;
|
|
237
|
-
private readonly pollHoverPick;
|
|
238
|
-
private cancelHoverPick;
|
|
239
212
|
/** Screen point (CSS pixels) of a position on the ground (the relief), or `height` metres above it, undefined
|
|
240
213
|
* behind the camera */
|
|
241
214
|
project(lonLat: LonLat, height?: number): Point | undefined;
|
|
@@ -321,19 +294,10 @@ export declare class GeoMap {
|
|
|
321
294
|
removeImage(name: string): void;
|
|
322
295
|
/**
|
|
323
296
|
* Vector tiles with a MapLibre style (OpenFreeMap's Positron by default): `tiles.raster(…)` draws its fills and lines
|
|
324
|
-
* (or a subset) as a raster layer, `tiles.
|
|
325
|
-
* basemap.
|
|
297
|
+
* (or a subset) as a raster layer, `tiles.vectors(…)` as geometry, `tiles.labels(…)` its labels.
|
|
298
|
+
* `setBasemap('osm-positron')` draws the basemap with a raster layer and the labels.
|
|
326
299
|
*/
|
|
327
300
|
vectorTiles(options?: VectorTilesOptions): VectorTiles;
|
|
328
|
-
/**
|
|
329
|
-
* The workers decoding the relief and reprojecting rasters: the map's pool, unless the map has no workers
|
|
330
|
-
* (`workers: false` or 0, or none in this browser): that is done in the page then
|
|
331
|
-
*/
|
|
332
|
-
private decodingPool;
|
|
333
|
-
private readonly remoteHeights;
|
|
334
|
-
private readonly remoteReprojection;
|
|
335
|
-
/** The loader of the relief tiles of `url` in a PNG encoding (one per URL, encoding and floor) */
|
|
336
|
-
private readonly terrainLoader;
|
|
337
301
|
/** Adds a layer, under `before` if given */
|
|
338
302
|
private place;
|
|
339
303
|
/** Textured meshes in 3D Tiles (photogrammetry, buildings), drawn with depth over the basemap */
|
|
@@ -358,42 +322,6 @@ export declare class GeoMap {
|
|
|
358
322
|
}): CustomLayer;
|
|
359
323
|
/** Asks for a frame; several calls before the next frame draw it once */
|
|
360
324
|
requestRender(): void;
|
|
361
|
-
private frame;
|
|
362
|
-
private drawFrame;
|
|
363
|
-
/** Resizes when the device pixel ratio changes (browser zoom, a window moved to another screen) */
|
|
364
|
-
private watchRatio;
|
|
365
325
|
private resize;
|
|
366
326
|
destroy(): void;
|
|
367
327
|
}
|
|
368
|
-
/** A layer by its type and the options of its `add…` method (`GeoMap.add`) */
|
|
369
|
-
export type LayerSpec<P = Record<string, unknown>> = ({
|
|
370
|
-
type: 'lines';
|
|
371
|
-
} & LineOptions<P>) | ({
|
|
372
|
-
type: 'circles';
|
|
373
|
-
} & CircleOptions<P>) | ({
|
|
374
|
-
type: 'fills';
|
|
375
|
-
} & FillOptions<P>) | ({
|
|
376
|
-
type: 'symbols';
|
|
377
|
-
} & SymbolOptions<P>) | ({
|
|
378
|
-
type: 'extrusions';
|
|
379
|
-
} & ExtrusionOptions<P>) | ({
|
|
380
|
-
type: 'raster';
|
|
381
|
-
} & RasterOptions & {
|
|
382
|
-
before?: Layer;
|
|
383
|
-
}) | ({
|
|
384
|
-
type: 'ground';
|
|
385
|
-
} & GroundOptions & {
|
|
386
|
-
before?: Layer;
|
|
387
|
-
}) | ({
|
|
388
|
-
type: 'network';
|
|
389
|
-
} & NetworkOptions) | ({
|
|
390
|
-
type: 'tiles3d';
|
|
391
|
-
} & Tiles3dOptions) | ({
|
|
392
|
-
type: 'pointcloud';
|
|
393
|
-
} & PointCloudOptions & {
|
|
394
|
-
before?: Layer;
|
|
395
|
-
}) | ({
|
|
396
|
-
type: 'models';
|
|
397
|
-
} & ModelOptions & {
|
|
398
|
-
before?: Layer;
|
|
399
|
-
});
|