@sjvair/map-sdk 0.0.0-stage → 0.1.0-beta.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.
Files changed (130) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +487 -2
  3. package/dist/core/basemap.svelte.d.ts +38 -0
  4. package/dist/core/basemap.svelte.js +163 -0
  5. package/dist/core/context.d.ts +5 -0
  6. package/dist/core/context.js +13 -0
  7. package/dist/core/create-map.svelte.d.ts +207 -0
  8. package/dist/core/create-map.svelte.js +376 -0
  9. package/dist/core/gl.d.ts +92 -0
  10. package/dist/core/gl.js +1 -0
  11. package/dist/core/interactions.svelte.d.ts +42 -0
  12. package/dist/core/interactions.svelte.js +213 -0
  13. package/dist/core/plugin-host.svelte.d.ts +46 -0
  14. package/dist/core/plugin-host.svelte.js +366 -0
  15. package/dist/core/plugin.d.ts +148 -0
  16. package/dist/core/plugin.js +1 -0
  17. package/dist/core/scoped-context.d.ts +7 -0
  18. package/dist/core/scoped-context.js +34 -0
  19. package/dist/data/format.d.ts +10 -0
  20. package/dist/data/format.js +24 -0
  21. package/dist/data/index.d.ts +9 -0
  22. package/dist/data/index.js +9 -0
  23. package/dist/data/messages/en.json +51 -0
  24. package/dist/data/messages.d.ts +10 -0
  25. package/dist/data/messages.js +17 -0
  26. package/dist/data/metadata.d.ts +22 -0
  27. package/dist/data/metadata.js +110 -0
  28. package/dist/data/refs.d.ts +18 -0
  29. package/dist/data/refs.js +61 -0
  30. package/dist/data/scale-types.d.ts +7 -0
  31. package/dist/data/scale-types.js +1 -0
  32. package/dist/data/scale.d.ts +13 -0
  33. package/dist/data/scale.js +27 -0
  34. package/dist/data/selection.d.ts +7 -0
  35. package/dist/data/selection.js +31 -0
  36. package/dist/data/static-source.d.ts +4 -0
  37. package/dist/data/static-source.js +3 -0
  38. package/dist/data/types.d.ts +69 -0
  39. package/dist/data/types.js +1 -0
  40. package/dist/index.d.ts +56 -0
  41. package/dist/index.js +41 -0
  42. package/dist/plugins/icons.d.ts +21 -0
  43. package/dist/plugins/icons.js +73 -0
  44. package/dist/plugins/points-clusters.d.ts +60 -0
  45. package/dist/plugins/points-clusters.js +93 -0
  46. package/dist/plugins/points.svelte.d.ts +93 -0
  47. package/dist/plugins/points.svelte.js +473 -0
  48. package/dist/plugins/scale-resolution.svelte.d.ts +27 -0
  49. package/dist/plugins/scale-resolution.svelte.js +111 -0
  50. package/dist/plugins/shapes.svelte.d.ts +29 -0
  51. package/dist/plugins/shapes.svelte.js +307 -0
  52. package/dist/plugins/shared.d.ts +6 -0
  53. package/dist/plugins/shared.js +18 -0
  54. package/dist/plugins/style.d.ts +57 -0
  55. package/dist/plugins/style.js +193 -0
  56. package/dist/presets/CollocationTooltip.svelte +132 -0
  57. package/dist/presets/CollocationTooltip.svelte.d.ts +16 -0
  58. package/dist/presets/MonitorClusterTooltip.svelte +149 -0
  59. package/dist/presets/MonitorClusterTooltip.svelte.d.ts +16 -0
  60. package/dist/presets/MonitorReadingBox.svelte +58 -0
  61. package/dist/presets/MonitorReadingBox.svelte.d.ts +12 -0
  62. package/dist/presets/MonitorTooltip.svelte +88 -0
  63. package/dist/presets/MonitorTooltip.svelte.d.ts +20 -0
  64. package/dist/presets/calheatscore.d.ts +24 -0
  65. package/dist/presets/calheatscore.js +22 -0
  66. package/dist/presets/collocation-sites.d.ts +18 -0
  67. package/dist/presets/collocation-sites.js +67 -0
  68. package/dist/presets/fire-groups.d.ts +26 -0
  69. package/dist/presets/fire-groups.js +51 -0
  70. package/dist/presets/forecast-zones.d.ts +25 -0
  71. package/dist/presets/forecast-zones.js +23 -0
  72. package/dist/presets/hms-fire.d.ts +26 -0
  73. package/dist/presets/hms-fire.js +87 -0
  74. package/dist/presets/hms-smoke.d.ts +19 -0
  75. package/dist/presets/hms-smoke.js +20 -0
  76. package/dist/presets/monitors.d.ts +48 -0
  77. package/dist/presets/monitors.js +243 -0
  78. package/dist/presets/reactive-props.svelte.d.ts +4 -0
  79. package/dist/presets/reactive-props.svelte.js +7 -0
  80. package/dist/presets/regions.d.ts +24 -0
  81. package/dist/presets/regions.js +22 -0
  82. package/dist/stores/abort.d.ts +16 -0
  83. package/dist/stores/abort.js +52 -0
  84. package/dist/stores/collocation-store.svelte.d.ts +25 -0
  85. package/dist/stores/collocation-store.svelte.js +72 -0
  86. package/dist/stores/hms-stores.svelte.d.ts +35 -0
  87. package/dist/stores/hms-stores.svelte.js +97 -0
  88. package/dist/stores/index.d.ts +4 -0
  89. package/dist/stores/index.js +4 -0
  90. package/dist/stores/load-once.svelte.d.ts +25 -0
  91. package/dist/stores/load-once.svelte.js +93 -0
  92. package/dist/stores/monitors-store.svelte.d.ts +85 -0
  93. package/dist/stores/monitors-store.svelte.js +340 -0
  94. package/dist/theme.css +34 -0
  95. package/dist/ui/FeatureList.svelte +501 -0
  96. package/dist/ui/FeatureList.svelte.d.ts +14 -0
  97. package/dist/ui/Legend.svelte +172 -0
  98. package/dist/ui/Legend.svelte.d.ts +13 -0
  99. package/dist/ui/LegendBar.svelte +161 -0
  100. package/dist/ui/LegendBar.svelte.d.ts +11 -0
  101. package/dist/ui/MapControls.svelte +135 -0
  102. package/dist/ui/MapControls.svelte.d.ts +11 -0
  103. package/dist/ui/MapTooltip.svelte +158 -0
  104. package/dist/ui/MapTooltip.svelte.d.ts +28 -0
  105. package/dist/ui/SelectionBar.svelte +123 -0
  106. package/dist/ui/SelectionBar.svelte.d.ts +10 -0
  107. package/dist/ui/TooltipItem.svelte +66 -0
  108. package/dist/ui/TooltipItem.svelte.d.ts +11 -0
  109. package/dist/ui/ViewSummary.svelte +97 -0
  110. package/dist/ui/ViewSummary.svelte.d.ts +7 -0
  111. package/dist/ui/controls.css +45 -0
  112. package/dist/ui/data-credits.svelte.d.ts +9 -0
  113. package/dist/ui/data-credits.svelte.js +52 -0
  114. package/dist/ui/feature-list.d.ts +31 -0
  115. package/dist/ui/feature-list.js +80 -0
  116. package/dist/ui/legend-data.d.ts +41 -0
  117. package/dist/ui/legend-data.js +40 -0
  118. package/dist/ui/level-chip.d.ts +11 -0
  119. package/dist/ui/level-chip.js +15 -0
  120. package/dist/ui/value-format.d.ts +7 -0
  121. package/dist/ui/value-format.js +13 -0
  122. package/dist/ui/view-summary.d.ts +11 -0
  123. package/dist/ui/view-summary.js +33 -0
  124. package/dist/view/MapView.svelte +373 -0
  125. package/dist/view/MapView.svelte.d.ts +43 -0
  126. package/dist/view/create-gl-map.d.ts +34 -0
  127. package/dist/view/create-gl-map.js +182 -0
  128. package/dist/view/list-placement.d.ts +21 -0
  129. package/dist/view/list-placement.js +13 -0
  130. package/package.json +103 -5
@@ -0,0 +1,163 @@
1
+ import { untrack } from "svelte";
2
+ /** The first of these means the style of a map just created is ready. */
3
+ const STYLE_READY_EVENTS = ["style.load", "idle"];
4
+ /**
5
+ * The map's current basemap, and switching it on a GL map.
6
+ *
7
+ * The GL map is created with the style of `current` (the map's creator does that), so `attach`
8
+ * calls `setStyle` for nothing. Later `select` calls load the new style. A newer `select`
9
+ * supersedes one still loading. If the style document fails, the map goes back to the last style
10
+ * that loaded and `current` reverts; if that fails too, the map stays unstyled until the next
11
+ * `select`. Right before each `setStyle`, `onStyleChange` is called (it tears the plugins down,
12
+ * so nothing touches the old style while the new one loads). After each successful load,
13
+ * `excludedLayers` are removed and `onStyleReady` is called (it sets the plugins up again). The
14
+ * map's first style is not announced: the plugin host already waits for it.
15
+ */
16
+ export class BasemapState {
17
+ #current = $state("");
18
+ #config;
19
+ #gl = null;
20
+ #onStyleReady = null;
21
+ #onStyleChange = null;
22
+ /** The id last handed to `setStyle` (loaded or loading); null once a load failed with no fallback. */
23
+ #applied = null;
24
+ /** The id the map last finished loading, which a failed change falls back to. */
25
+ #loaded = "";
26
+ #stopWaiting = null;
27
+ constructor(config) {
28
+ this.#config = config;
29
+ this.#current = config?.defaultId ?? "";
30
+ }
31
+ /** The selected basemap id. Reactive. */
32
+ get current() {
33
+ return this.#current;
34
+ }
35
+ /** Unknown ids are ignored. While no map is attached, only `current` changes. */
36
+ select(id) {
37
+ if (!this.#entry(id))
38
+ return;
39
+ this.#current = id;
40
+ if (!this.#gl || id === this.#applied)
41
+ return;
42
+ this.#load(id);
43
+ }
44
+ /**
45
+ * For MapView only (through the map context's `attach`): uses `gl` from now on, which must
46
+ * already show (or be loading) the style of `current`. `onStyleChange` runs right before each
47
+ * `setStyle`, `onStyleReady` once that style has loaded. Reads `current` untracked, so calling
48
+ * this in an effect doesn't make it depend on it.
49
+ */
50
+ attach(gl, onStyleReady, onStyleChange) {
51
+ if (this.#gl === gl)
52
+ return;
53
+ if (this.#gl)
54
+ this.detach();
55
+ this.#gl = gl;
56
+ this.#onStyleReady = onStyleReady;
57
+ this.#onStyleChange = onStyleChange ?? null;
58
+ const id = untrack(() => this.#current);
59
+ this.#applied = id;
60
+ this.#loaded = id;
61
+ // The first style: drop the excluded layers, but leave the plugin host to set itself up.
62
+ this.#whenReady(gl, () => this.#removeExcluded(gl));
63
+ }
64
+ /** For MapView only (through the map context's `detach`): stops using the GL map. */
65
+ detach() {
66
+ this.#stopWaiting?.();
67
+ this.#gl = null;
68
+ this.#onStyleReady = null;
69
+ this.#onStyleChange = null;
70
+ }
71
+ #entry(id) {
72
+ return this.#config?.styles.find((s) => s.id === id);
73
+ }
74
+ /** Runs `fn` once `gl`'s style is ready, at once if it is. Cancelled by `#stopWaiting`. */
75
+ #whenReady(gl, fn) {
76
+ this.#stopWaiting?.();
77
+ if (gl.isStyleLoaded()) {
78
+ fn();
79
+ return;
80
+ }
81
+ const listener = () => {
82
+ stop();
83
+ fn();
84
+ };
85
+ const stop = () => {
86
+ for (const type of STYLE_READY_EVENTS)
87
+ gl.off(type, listener);
88
+ if (this.#stopWaiting === stop)
89
+ this.#stopWaiting = null;
90
+ };
91
+ this.#stopWaiting = stop;
92
+ for (const type of STYLE_READY_EVENTS)
93
+ gl.on(type, listener);
94
+ }
95
+ #removeExcluded(gl) {
96
+ for (const layerId of this.#config?.excludedLayers ?? []) {
97
+ try {
98
+ if (gl.getLayer(layerId))
99
+ gl.removeLayer(layerId);
100
+ }
101
+ catch (error) {
102
+ console.error(`map-sdk: removing basemap layer "${layerId}" failed`, error);
103
+ }
104
+ }
105
+ }
106
+ #load(id) {
107
+ const gl = this.#gl;
108
+ const entry = this.#entry(id);
109
+ if (!gl || !entry)
110
+ return;
111
+ // A newer change supersedes one still in flight.
112
+ this.#stopWaiting?.();
113
+ this.#applied = id;
114
+ const onLoad = () => {
115
+ stop();
116
+ this.#loaded = id;
117
+ this.#removeExcluded(gl);
118
+ this.#onStyleReady?.();
119
+ };
120
+ // "error" also fires for tiles, sprites and glyphs; only the style document failing means
121
+ // the change failed. That is matched by URL, so a style given as an object (not a URL
122
+ // string) can't be told apart and is never treated as failed.
123
+ const url = typeof entry.style === "string" ? entry.style : null;
124
+ const onError = (event) => {
125
+ if (url === null || !isRequestFor(event.error, url))
126
+ return;
127
+ stop();
128
+ this.#recover(id);
129
+ };
130
+ const stop = () => {
131
+ gl.off("style.load", onLoad);
132
+ gl.off("error", onError);
133
+ if (this.#stopWaiting === stop)
134
+ this.#stopWaiting = null;
135
+ };
136
+ this.#stopWaiting = stop;
137
+ gl.on("style.load", onLoad);
138
+ gl.on("error", onError);
139
+ this.#onStyleChange?.();
140
+ // No diffing: a diff keeps the plugins' sources and layers in some cases and not others.
141
+ gl.setStyle(entry.style, { diff: false });
142
+ }
143
+ /**
144
+ * A style that fails to load leaves the map with no style, so go back to the last one that
145
+ * loaded and make `current` say so. When that one fails too there is nothing to draw on, and
146
+ * the next `select` starts a fresh attempt.
147
+ */
148
+ #recover(failed) {
149
+ if (failed === this.#loaded) {
150
+ this.#applied = null;
151
+ return;
152
+ }
153
+ this.#current = this.#loaded;
154
+ this.#load(this.#loaded);
155
+ }
156
+ }
157
+ /** Whether a map "error" event's error is a failed request for `url`, ignoring the query. */
158
+ function isRequestFor(error, url) {
159
+ const failed = error?.url;
160
+ if (typeof failed !== "string")
161
+ return false;
162
+ return failed.split("?")[0] === url.split("?")[0];
163
+ }
@@ -0,0 +1,5 @@
1
+ import type { MapContext } from "./create-map.svelte.js";
2
+ /** Provides `ctx` to this component's descendants (MapView does this). */
3
+ export declare function setMapContext(ctx: MapContext): void;
4
+ /** The nearest `MapView`'s map. Throws outside one. */
5
+ export declare function getMapContext(): MapContext;
@@ -0,0 +1,13 @@
1
+ import { getContext, setContext } from "svelte";
2
+ const KEY = Symbol("map-sdk:map");
3
+ /** Provides `ctx` to this component's descendants (MapView does this). */
4
+ export function setMapContext(ctx) {
5
+ setContext(KEY, ctx);
6
+ }
7
+ /** The nearest `MapView`'s map. Throws outside one. */
8
+ export function getMapContext() {
9
+ const ctx = getContext(KEY);
10
+ if (!ctx)
11
+ throw new Error("map-sdk: no map context; use this inside a MapView");
12
+ return ctx;
13
+ }
@@ -0,0 +1,207 @@
1
+ import { type FormatProvider } from "../data/format.js";
2
+ import { type MessageProvider } from "../data/messages.js";
3
+ import { type MetadataProvider } from "../data/metadata.js";
4
+ import type { FeatureRef, SelectionMode, SpatialSelection } from "../data/types.js";
5
+ import { BasemapState, type BasemapConfig } from "./basemap.svelte.js";
6
+ import type { GlMapLike } from "./gl.js";
7
+ import { type Hovered } from "./interactions.svelte.js";
8
+ import type { FeatureHit, MapPlugin } from "./plugin.js";
9
+ export interface CameraState {
10
+ center: [number, number];
11
+ zoom: number;
12
+ bearing: number;
13
+ pitch: number;
14
+ }
15
+ export interface Bounds {
16
+ west: number;
17
+ south: number;
18
+ east: number;
19
+ north: number;
20
+ }
21
+ export interface MapConfig {
22
+ maptilerKey: string;
23
+ basemaps?: BasemapConfig;
24
+ initialView?: CameraState;
25
+ cooperativeGestures?: boolean;
26
+ /** Default `"mercator"`. `"globe"` draws the map on a globe when zoomed out. */
27
+ projection?: "mercator" | "globe";
28
+ /**
29
+ * Default `false`. A preset (monitor-map uses `{ preset: "milkyway" }`) draws space behind a
30
+ * globe.
31
+ */
32
+ space?: false | {
33
+ preset: string;
34
+ };
35
+ }
36
+ export interface CreateMapOptions {
37
+ config: MapConfig;
38
+ metadata?: MetadataProvider;
39
+ messages?: MessageProvider;
40
+ format?: FormatProvider;
41
+ }
42
+ export interface PluginOptions {
43
+ /**
44
+ * Draw the plugin just below the plugin with this id (which must be added already). Without
45
+ * it the plugin goes on top.
46
+ */
47
+ before?: string;
48
+ selectionMode?: SelectionMode;
49
+ selection?: SpatialSelection | null;
50
+ onselectionchange?(sel: SpatialSelection | null): void;
51
+ }
52
+ export type FeatureClickHandler = (e: {
53
+ pluginId: string;
54
+ ref: FeatureRef;
55
+ /** The click point; for a pick in the feature list, the item's position. */
56
+ lngLat: [number, number];
57
+ }) => void;
58
+ /** Where a camera move ends up. `zoom` wins over `minZoom`. */
59
+ export interface CameraTarget {
60
+ center: [number, number];
61
+ zoom?: number;
62
+ /** Zoom to at least this: the move's zoom is `max(current zoom, minZoom)`. */
63
+ minZoom?: number;
64
+ }
65
+ /** A map's state and services, independent of whether a GL map currently exists. */
66
+ export interface MapContext {
67
+ readonly uid: string;
68
+ readonly config: Readonly<MapConfig>;
69
+ readonly metadata: MetadataProvider;
70
+ readonly messages: MessageProvider;
71
+ readonly format: FormatProvider;
72
+ /** Reactive; updated by MapView on moveend. */
73
+ readonly camera: CameraState;
74
+ /** Reactive; `null` until a map reports its bounds. */
75
+ readonly bounds: Bounds | null;
76
+ readonly basemap: BasemapState;
77
+ /**
78
+ * In draw order, bottom first: later plugins draw above earlier ones, and each plugin's layers
79
+ * stay together. Reactive.
80
+ */
81
+ readonly plugins: readonly MapPlugin[];
82
+ /** Reactive. */
83
+ readonly attached: boolean;
84
+ /**
85
+ * Reactive. True once the attached map's style has loaded and the map has gone idle for the
86
+ * first time; false again on `detach()` and while a basemap switch reloads the style. A load
87
+ * screen can wait for it.
88
+ */
89
+ readonly ready: boolean;
90
+ /**
91
+ * Reactive. The attached GL map, or `null`. For markers and popups only (see `maptilerMap`);
92
+ * never add sources or layers through it.
93
+ */
94
+ readonly gl: GlMapLike | null;
95
+ /**
96
+ * @internal For `MapView` only; hosts never call it. Marks the attached map ready. Does
97
+ * nothing while detached.
98
+ */
99
+ markReady(): void;
100
+ /**
101
+ * Adds a plugin on top, or below `options.before`. Throws if a plugin with the same id is
102
+ * already added, if `before` names no added plugin, if the same plugin object is set up on
103
+ * another map (create one plugin per map), or after `destroy()`.
104
+ */
105
+ addPlugin(plugin: MapPlugin, options?: PluginOptions): void;
106
+ /**
107
+ * Moves a plugin and its layers to the top, or just below `options.before`. Does nothing for
108
+ * an unknown `id`; throws if `before` names no added plugin.
109
+ */
110
+ movePlugin(id: string, options?: {
111
+ before?: string;
112
+ }): void;
113
+ /** Tears the plugin down and forgets its selection, mode, and `onselectionchange`. */
114
+ removePlugin(id: string): void;
115
+ /**
116
+ * Host → map. Kept as given, including ids not in any data. Does not call
117
+ * `onselectionchange`.
118
+ */
119
+ setSelection(pluginId: string, selection: SpatialSelection | null): void;
120
+ /** Reactive. */
121
+ getSelection(pluginId: string): SpatialSelection | null;
122
+ setSelectionMode(pluginId: string, mode: SelectionMode): void;
123
+ /** Reactive. `"none"` for an unknown plugin. */
124
+ getSelectionMode(pluginId: string): SelectionMode;
125
+ /**
126
+ * Internal, for FeatureList: picks a listed feature exactly like a map click on it. Fires
127
+ * `featureclick`, then applies the same selection rules (`additive` adds or toggles in
128
+ * `multiple` mode), calling `onselectionchange` if the selection changes. An item that isn't
129
+ * selectable is still clicked but not selected. Does nothing for a refKey the plugin doesn't list.
130
+ */
131
+ pickFromList(pluginId: string, refKey: string, additive: boolean): void;
132
+ /**
133
+ * Internal, for the selection bar: the user clears a plugin's selection. Calls the plugin's
134
+ * `onselectionchange(null)` when it had a selection; does nothing otherwise.
135
+ */
136
+ clearSelection(pluginId: string): void;
137
+ /**
138
+ * Called for every feature click (the top hit), whatever the selection mode, before the
139
+ * selection changes. Returns an unsubscribe function.
140
+ */
141
+ on(event: "featureclick", handler: FeatureClickHandler): () => void;
142
+ /** Hits under a canvas point, topmost first. `[]` while detached. */
143
+ featuresAt(point: {
144
+ x: number;
145
+ y: number;
146
+ }): FeatureHit[];
147
+ /**
148
+ * The hit for a feature-list element: the nearest `[data-mapsdk-ref]` ancestor (or the element
149
+ * itself), looked up in the plugins' `features()`: in the row's `data-mapsdk-plugin` plugin when
150
+ * it names one, else the first plugin listing the refKey. Only rows inside this map's own root count:
151
+ * the row's nearest `[data-mapsdk-map]` ancestor must carry this map's `uid`, which MapView
152
+ * sets on its container and FeatureList on its root. `null` otherwise.
153
+ */
154
+ featureForElement(element: Element): FeatureHit | null;
155
+ /**
156
+ * The top feature under the pointer and where it is. Reactive, for the tooltip. Over a cluster
157
+ * bubble it is the bubble's own hit: a `{ kind: "feature", id: "cluster:…" }` ref no plugin
158
+ * lists, with the bubble's `properties`, never a feature beneath it.
159
+ */
160
+ readonly hovered: Hovered | null;
161
+ /**
162
+ * Marks the feature focused and pans to it (no animation under reduced motion): the item in
163
+ * `pluginId`'s features when given, else the first plugin listing `refKey`. `null` clears the
164
+ * focus without moving the camera. Sets `focusedPluginId` to `pluginId` (or `null`). The pan
165
+ * centers the feature in the part of the map the feature list panel leaves clear.
166
+ */
167
+ focusFeature(refKey: string | null, pluginId?: string): void;
168
+ /**
169
+ * Eases the camera to `target` (no animation under reduced motion). Does nothing while
170
+ * detached.
171
+ */
172
+ easeTo(target: CameraTarget): void;
173
+ /** Like `easeTo`, with a flying animation. */
174
+ flyTo(target: CameraTarget): void;
175
+ /**
176
+ * Fits the camera to `bounds` (no animation under reduced motion). Does nothing while
177
+ * detached.
178
+ */
179
+ fitBounds(bounds: Bounds, options?: {
180
+ padding?: number;
181
+ maxZoom?: number;
182
+ }): void;
183
+ /** Reactive. */
184
+ readonly focusedKey: string | null;
185
+ /** Reactive. The plugin `focusFeature` was given with `focusedKey`, or `null`. */
186
+ readonly focusedPluginId: string | null;
187
+ /** For MapView only: uses `gl` from now on. */
188
+ attach(gl: GlMapLike): void;
189
+ /** For MapView only: stops using the current GL map. */
190
+ detach(): void;
191
+ /**
192
+ * For MapView only: how many pixels at the map's left or right edge (`side`, default left)
193
+ * the open feature list panel covers (0 when closed), which `focusFeature` pans clear of.
194
+ */
195
+ setListInset(width: number, side?: "left" | "right"): void;
196
+ /** For MapView only: records the camera and bounds after a move. */
197
+ updateView(camera: CameraState, bounds: Bounds): void;
198
+ /**
199
+ * For MapView only: the host's theme changed, so plugins set up again and re-read the theme
200
+ * colors they bake into paint and images. Does nothing while detached.
201
+ */
202
+ themeChanged(): void;
203
+ /** Detaches, removes every plugin, and drops handlers. The context can't be used after. */
204
+ destroy(): void;
205
+ }
206
+ /** Creates a map's state and services. `MapView` attaches a GL map to it. */
207
+ export declare function createMap(options: CreateMapOptions): MapContext;