@tomtom-org/maps-sdk 0.47.5 → 0.47.7
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 +28 -0
- package/core/dist/core.es.js +1 -1
- package/core/dist/core.es.js.map +1 -1
- package/map/dist/index.d.ts +360 -28
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/package.json +6 -1
- package/services/dist/index.d.ts +168 -5
- package/services/dist/services.es.js +1 -1
- package/services/dist/services.es.js.map +1 -1
package/map/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ import { Routes as Routes_2 } from '@tomtom-org/maps-sdk/core';
|
|
|
51
51
|
import { SectionProps } from '@tomtom-org/maps-sdk/core';
|
|
52
52
|
import { Source } from 'maplibre-gl';
|
|
53
53
|
import { SourceSpecification } from 'maplibre-gl';
|
|
54
|
+
import { StyleImageInterface } from 'maplibre-gl';
|
|
55
|
+
import { StyleImageMetadata } from 'maplibre-gl';
|
|
54
56
|
import { StyleSpecification } from 'maplibre-gl';
|
|
55
57
|
import { SymbolLayerSpecification } from 'maplibre-gl';
|
|
56
58
|
import { TrafficAreaAnalytics } from '@tomtom-org/maps-sdk/core';
|
|
@@ -181,6 +183,20 @@ export declare abstract class AbstractMapModule<SOURCES_WITH_LAYERS extends Sour
|
|
|
181
183
|
* @ignore
|
|
182
184
|
*/
|
|
183
185
|
protected readonly configChangeHandlers: ((config: CFG | undefined) => void)[];
|
|
186
|
+
/**
|
|
187
|
+
* Monotonically increasing index unique to this instance within its concrete module
|
|
188
|
+
* class. Auto-assigned in the constructor based on `new.target`, so each subclass
|
|
189
|
+
* has its own counter without per-subclass boilerplate. Use as a suffix on
|
|
190
|
+
* auto-generated source and layer IDs to keep them stable across style changes and
|
|
191
|
+
* unique across module instances.
|
|
192
|
+
* @ignore
|
|
193
|
+
*/
|
|
194
|
+
protected readonly instanceIndex: number;
|
|
195
|
+
/**
|
|
196
|
+
* Per-concrete-class instance counter. WeakMap-keyed so unloaded classes can be GC'd.
|
|
197
|
+
* @ignore
|
|
198
|
+
*/
|
|
199
|
+
private static readonly instanceCounters;
|
|
184
200
|
/**
|
|
185
201
|
* Indicates that this module is currently adding its sources and layers to the map, so during this time it might not function properly.
|
|
186
202
|
* @see waitUntilModuleReady
|
|
@@ -1122,7 +1138,7 @@ export declare class BaseMapModule extends AbstractMapModule<BaseSourceAndLayers
|
|
|
1122
1138
|
* @ignore
|
|
1123
1139
|
*/
|
|
1124
1140
|
protected _initSourcesWithLayers(config: BaseMapModuleInitConfig | undefined): {
|
|
1125
|
-
vectorTiles: StyleSourceWithLayers<SourceSpecification, Source>;
|
|
1141
|
+
vectorTiles: StyleSourceWithLayers< SourceSpecification, Source>;
|
|
1126
1142
|
};
|
|
1127
1143
|
/**
|
|
1128
1144
|
* @ignore
|
|
@@ -1227,7 +1243,7 @@ export declare class BaseMapModule extends AbstractMapModule<BaseSourceAndLayers
|
|
|
1227
1243
|
* unsub(); // remove by returned function
|
|
1228
1244
|
* ```
|
|
1229
1245
|
*/
|
|
1230
|
-
get events(): CombinedEvents<MapGeoJSONFeature, BaseMapModuleConfig, never>;
|
|
1246
|
+
get events(): CombinedEvents< MapGeoJSONFeature, BaseMapModuleConfig, never>;
|
|
1231
1247
|
}
|
|
1232
1248
|
|
|
1233
1249
|
/**
|
|
@@ -1941,6 +1957,338 @@ declare type ConnectionFeatureProps = {
|
|
|
1941
1957
|
*/
|
|
1942
1958
|
export declare type CSSCursor = 'alias' | 'all-scroll' | 'auto' | 'cell' | 'context-menu' | 'col-resize' | 'copy' | 'crosshair' | 'default' | 'e-resize' | 'ew-resize' | 'grab' | 'grabbing' | 'help' | 'move' | 'n-resize' | 'ne-resize' | 'nesw-resize' | 'ns-resize' | 'nw-resize' | 'nwse-resize' | 'no-drop' | 'none' | 'not-allowed' | 'pointer' | 'progress' | 'row-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'text' | 'vertical-text' | 'w-resize' | 'wait' | 'zoom-in' | 'zoom-out';
|
|
1943
1959
|
|
|
1960
|
+
/**
|
|
1961
|
+
* Per-source {@link CombinedEvents} surface keyed by the source name supplied in
|
|
1962
|
+
* {@link CustomGeoJSONModuleConfig.sources}.
|
|
1963
|
+
*
|
|
1964
|
+
* @group Custom
|
|
1965
|
+
*/
|
|
1966
|
+
export declare type CustomGeoJSONEvents<TSources extends Record<string, FeatureCollection>> = {
|
|
1967
|
+
[K in keyof TSources]: CombinedEvents<MapGeoJSONFeature, CustomGeoJSONModuleConfig<TSources>, TSources[K]>;
|
|
1968
|
+
};
|
|
1969
|
+
|
|
1970
|
+
/**
|
|
1971
|
+
* Any image payload accepted by MapLibre's `map.addImage`. Mirrors the parameter type
|
|
1972
|
+
* of that method.
|
|
1973
|
+
*
|
|
1974
|
+
* @group Custom
|
|
1975
|
+
*/
|
|
1976
|
+
export declare type CustomGeoJSONImageData = HTMLImageElement | ImageBitmap | ImageData | StyleImageInterface | {
|
|
1977
|
+
width: number;
|
|
1978
|
+
height: number;
|
|
1979
|
+
data: Uint8Array | Uint8ClampedArray;
|
|
1980
|
+
};
|
|
1981
|
+
|
|
1982
|
+
/**
|
|
1983
|
+
* Specification for a single custom image registered on the map by a
|
|
1984
|
+
* {@link CustomGeoJSONModule}. The module re-registers every image automatically after
|
|
1985
|
+
* every style change, so symbol layers in {@link CustomGeoJSONSourceSpec.layers} can
|
|
1986
|
+
* reference an image by ID and survive `setStyle` calls without extra wiring.
|
|
1987
|
+
*
|
|
1988
|
+
* @group Custom
|
|
1989
|
+
*/
|
|
1990
|
+
export declare type CustomGeoJSONImageSpec = {
|
|
1991
|
+
/**
|
|
1992
|
+
* The image data, in any format accepted by MapLibre's `addImage`. Asynchronous
|
|
1993
|
+
* sources (URLs, SVG strings) are not supported here — pre-load them and pass an
|
|
1994
|
+
* `HTMLImageElement` (or `ImageBitmap`/`ImageData`) instead.
|
|
1995
|
+
*/
|
|
1996
|
+
image: CustomGeoJSONImageData;
|
|
1997
|
+
/**
|
|
1998
|
+
* MapLibre image metadata: `pixelRatio`, `sdf`, `stretchX`, `stretchY`, `content`.
|
|
1999
|
+
* Forwarded verbatim to `addImage`.
|
|
2000
|
+
*/
|
|
2001
|
+
options?: Partial<StyleImageMetadata>;
|
|
2002
|
+
};
|
|
2003
|
+
|
|
2004
|
+
/**
|
|
2005
|
+
* Specification for a single custom layer attached to a {@link CustomGeoJSONSourceSpec}.
|
|
2006
|
+
*
|
|
2007
|
+
* Equivalent to a MapLibre layer specification (one of `circle`, `line`, `fill`,
|
|
2008
|
+
* `symbol`, `heatmap`, …) with `source` and `id` removed, and an optional `beforeID`
|
|
2009
|
+
* for ordering. The variant is preserved by `type`, so variant-specific properties
|
|
2010
|
+
* (`filter`, `layout`, `paint`, …) keep their narrow types.
|
|
2011
|
+
*
|
|
2012
|
+
* `id` is auto-generated as `${sourceID}-layer-${layerIndex}` when omitted. Provide
|
|
2013
|
+
* an explicit ID when you want to refer to the layer from outside the module
|
|
2014
|
+
* (e.g. to remove it via {@link applyConfig}), or when the layer set is expected to
|
|
2015
|
+
* change at runtime and you want a stable identity that is independent of array order.
|
|
2016
|
+
*
|
|
2017
|
+
* `beforeID` is the ID of an existing map layer the new layer should be inserted
|
|
2018
|
+
* before — see MapLibre's `addLayer`.
|
|
2019
|
+
*
|
|
2020
|
+
* @group Custom
|
|
2021
|
+
*/
|
|
2022
|
+
export declare type CustomGeoJSONLayerSpec = DistributiveOmit<LayerSpecWithSource, 'source' | 'id'> & {
|
|
2023
|
+
id?: string;
|
|
2024
|
+
beforeID?: string;
|
|
2025
|
+
};
|
|
2026
|
+
|
|
2027
|
+
/**
|
|
2028
|
+
* Module for displaying customer-owned GeoJSON data with TomTom SDK support.
|
|
2029
|
+
*
|
|
2030
|
+
* Wraps one or more MapLibre GeoJSON sources together with caller-supplied layer specs,
|
|
2031
|
+
* and adds the usual TomTom SDK lifecycle behaviour on top: style-change restoration,
|
|
2032
|
+
* `config-change` / `shown-features` events, and per-source user interaction events
|
|
2033
|
+
* (`click`, `hover`, `long-hover`, `contextmenu`).
|
|
2034
|
+
*
|
|
2035
|
+
* Unlike opinionated modules such as {@link PlacesModule} or {@link GeometriesModule},
|
|
2036
|
+
* this module makes no assumptions about how data is rendered — the caller passes raw
|
|
2037
|
+
* MapLibre layer specs (`circle`, `heatmap`, `fill`, `line`, `symbol`, …).
|
|
2038
|
+
*
|
|
2039
|
+
* @typeParam TSources - A record mapping source names to the {@link FeatureCollection}
|
|
2040
|
+
* type each source carries. Pass this generic when you want type-safe `show` /
|
|
2041
|
+
* `getShown` per source.
|
|
2042
|
+
*
|
|
2043
|
+
* @example
|
|
2044
|
+
* Single source, default generic:
|
|
2045
|
+
* ```typescript
|
|
2046
|
+
* const module = await CustomGeoJSONModule.get(map, {
|
|
2047
|
+
* sources: {
|
|
2048
|
+
* points: {
|
|
2049
|
+
* layers: [{ type: 'circle', paint: { 'circle-radius': 4, 'circle-color': '#0a3653' } }],
|
|
2050
|
+
* },
|
|
2051
|
+
* },
|
|
2052
|
+
* });
|
|
2053
|
+
*
|
|
2054
|
+
* await module.show(myFeatureCollection, 'points');
|
|
2055
|
+
* module.events.points.on('click', (feature, lngLat) => console.log(feature, lngLat));
|
|
2056
|
+
* ```
|
|
2057
|
+
*
|
|
2058
|
+
* @example
|
|
2059
|
+
* Multiple sources with typed payloads:
|
|
2060
|
+
* ```typescript
|
|
2061
|
+
* type Sources = {
|
|
2062
|
+
* heatmap: FeatureCollection<Point>;
|
|
2063
|
+
* buildings: FeatureCollection<Polygon, { name: string }>;
|
|
2064
|
+
* };
|
|
2065
|
+
*
|
|
2066
|
+
* const module = await CustomGeoJSONModule.get<Sources>(map, {
|
|
2067
|
+
* sources: {
|
|
2068
|
+
* heatmap: { layers: [{ type: 'heatmap', paint: { 'heatmap-radius': 12 } }] },
|
|
2069
|
+
* buildings: { layers: [{ type: 'fill', paint: { 'fill-color': '#5a5' } }] },
|
|
2070
|
+
* },
|
|
2071
|
+
* });
|
|
2072
|
+
*
|
|
2073
|
+
* await module.show(heatmapData, 'heatmap');
|
|
2074
|
+
* await module.show(buildingData, 'buildings');
|
|
2075
|
+
* ```
|
|
2076
|
+
*
|
|
2077
|
+
* @example
|
|
2078
|
+
* Same data, multiple renderings — call `show` once without a source name:
|
|
2079
|
+
* ```typescript
|
|
2080
|
+
* type Buildings = FeatureCollection<Point, { Name: string }>;
|
|
2081
|
+
*
|
|
2082
|
+
* const module = await CustomGeoJSONModule.get<{ heatmap: Buildings; markers: Buildings }>(map, {
|
|
2083
|
+
* sources: {
|
|
2084
|
+
* heatmap: { layers: heatmapLayers },
|
|
2085
|
+
* markers: { layers: markerLayers },
|
|
2086
|
+
* },
|
|
2087
|
+
* });
|
|
2088
|
+
*
|
|
2089
|
+
* await module.show(buildingData); // applied to both sources
|
|
2090
|
+
* ```
|
|
2091
|
+
*
|
|
2092
|
+
* @group Custom
|
|
2093
|
+
*/
|
|
2094
|
+
export declare class CustomGeoJSONModule<TSources extends Record<string, FeatureCollection> = Record<string, FeatureCollection>> extends AbstractMapModule<CustomGeoJSONSourcesWithLayers<TSources>, CustomGeoJSONModuleConfig<TSources>> {
|
|
2095
|
+
private resolvedSourceIDs;
|
|
2096
|
+
private resolvedLayerSpecs;
|
|
2097
|
+
private lastShown;
|
|
2098
|
+
private shownFeaturesHandlersBySource;
|
|
2099
|
+
/**
|
|
2100
|
+
* Creates a new {@link CustomGeoJSONModule} once the map is ready.
|
|
2101
|
+
*
|
|
2102
|
+
* @param tomtomMap The TomTomMap instance.
|
|
2103
|
+
* @param config Module configuration. `sources` is required and must contain at
|
|
2104
|
+
* least one entry; each entry must have at least one layer.
|
|
2105
|
+
*/
|
|
2106
|
+
static get<TSources extends Record<string, FeatureCollection> = Record<string, FeatureCollection>>(tomtomMap: TomTomMap, config: CustomGeoJSONModuleConfig<TSources>): Promise<CustomGeoJSONModule<TSources>>;
|
|
2107
|
+
private constructor();
|
|
2108
|
+
/**
|
|
2109
|
+
* @ignore
|
|
2110
|
+
*/
|
|
2111
|
+
protected _initSourcesWithLayers(config: CustomGeoJSONModuleConfig<TSources> | undefined, restore?: boolean): CustomGeoJSONSourcesWithLayers<TSources>;
|
|
2112
|
+
private registerImages;
|
|
2113
|
+
private resolveIDs;
|
|
2114
|
+
/**
|
|
2115
|
+
* @ignore
|
|
2116
|
+
*/
|
|
2117
|
+
protected _applyConfig(config: CustomGeoJSONModuleConfig<TSources> | undefined): CustomGeoJSONModuleConfig<TSources> | undefined;
|
|
2118
|
+
private updateLayersForExistingSources;
|
|
2119
|
+
private applyVisibility;
|
|
2120
|
+
/**
|
|
2121
|
+
* @ignore
|
|
2122
|
+
*/
|
|
2123
|
+
protected restoreDataAndConfigImpl(): void;
|
|
2124
|
+
/**
|
|
2125
|
+
* Displays the given GeoJSON data on the named source — or on every source when
|
|
2126
|
+
* no name is supplied.
|
|
2127
|
+
*
|
|
2128
|
+
* Replaces any previously shown data. Layer visibility is set automatically based
|
|
2129
|
+
* on whether the feature collection is non-empty.
|
|
2130
|
+
*
|
|
2131
|
+
* @param data The GeoJSON feature collection to display.
|
|
2132
|
+
* @param sourceName The source name (must match a key from
|
|
2133
|
+
* {@link CustomGeoJSONModuleConfig.sources}). When omitted, `data` is shown on
|
|
2134
|
+
* every source — best used when every source shares the same `FeatureCollection`
|
|
2135
|
+
* shape.
|
|
2136
|
+
*/
|
|
2137
|
+
show<K extends keyof TSources>(data: TSources[K], sourceName?: K): Promise<void>;
|
|
2138
|
+
private showOnSource;
|
|
2139
|
+
/**
|
|
2140
|
+
* Clears data from the given source — or from all sources when no name is supplied.
|
|
2141
|
+
*/
|
|
2142
|
+
clear(sourceName?: keyof TSources): Promise<void>;
|
|
2143
|
+
/**
|
|
2144
|
+
* Returns the feature collection currently shown on each source.
|
|
2145
|
+
*
|
|
2146
|
+
* Sources that have never been shown (or have been cleared) return the empty
|
|
2147
|
+
* feature collection that `GeoJSONSourceWithLayers` keeps as initial state.
|
|
2148
|
+
*/
|
|
2149
|
+
getShown(): {
|
|
2150
|
+
[K in keyof TSources]: TSources[K];
|
|
2151
|
+
};
|
|
2152
|
+
/**
|
|
2153
|
+
* Toggles visibility of every layer across every source.
|
|
2154
|
+
*
|
|
2155
|
+
* @remarks
|
|
2156
|
+
* Calling {@link show} on a source after `setVisible(false)` will re-reveal that
|
|
2157
|
+
* source's layers via `GeoJSONSourceWithLayers`' automatic visibility behaviour.
|
|
2158
|
+
* To keep a source hidden, call `setVisible(false)` after the next `show`.
|
|
2159
|
+
*/
|
|
2160
|
+
setVisible(visible: boolean): void;
|
|
2161
|
+
/**
|
|
2162
|
+
* Per-source events surface.
|
|
2163
|
+
*
|
|
2164
|
+
* Each key on the returned object is one of the source names declared in
|
|
2165
|
+
* {@link CustomGeoJSONModuleConfig.sources}. Each value is a {@link CombinedEvents}
|
|
2166
|
+
* instance covering both user interactions (`click`, `hover`, `long-hover`,
|
|
2167
|
+
* `contextmenu`) and module lifecycle events (`config-change`, `shown-features`).
|
|
2168
|
+
*
|
|
2169
|
+
* `config-change` handlers are module-wide (the same handler array is shared
|
|
2170
|
+
* across every source's `CombinedEvents`). `shown-features` handlers fire only for
|
|
2171
|
+
* their own source.
|
|
2172
|
+
*
|
|
2173
|
+
* @example
|
|
2174
|
+
* ```typescript
|
|
2175
|
+
* module.events.buildings.on('click', (feature, lngLat) => { ... });
|
|
2176
|
+
* module.events.heatmap.on('shown-features', (data) => { ... });
|
|
2177
|
+
* module.events.buildings.on('config-change', (config) => { ... });
|
|
2178
|
+
* ```
|
|
2179
|
+
*/
|
|
2180
|
+
get events(): CustomGeoJSONEvents<TSources>;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
/**
|
|
2184
|
+
* Configuration for the {@link CustomGeoJSONModule}.
|
|
2185
|
+
*
|
|
2186
|
+
* @typeParam TSources - A record describing each source name and the
|
|
2187
|
+
* {@link FeatureCollection} type it carries. When omitted, every source defaults to
|
|
2188
|
+
* `FeatureCollection`.
|
|
2189
|
+
*
|
|
2190
|
+
* @example
|
|
2191
|
+
* ```typescript
|
|
2192
|
+
* type MySources = {
|
|
2193
|
+
* buildings: FeatureCollection<Point, { name: string }>;
|
|
2194
|
+
* parks: FeatureCollection<Polygon>;
|
|
2195
|
+
* };
|
|
2196
|
+
*
|
|
2197
|
+
* const config: CustomGeoJSONModuleConfig<MySources> = {
|
|
2198
|
+
* sources: {
|
|
2199
|
+
* buildings: { layers: [{ type: 'circle', paint: { 'circle-radius': 4 } }] },
|
|
2200
|
+
* parks: { layers: [{ type: 'fill', paint: { 'fill-color': '#5a5' } }] },
|
|
2201
|
+
* },
|
|
2202
|
+
* };
|
|
2203
|
+
* ```
|
|
2204
|
+
*
|
|
2205
|
+
* @group Custom
|
|
2206
|
+
*/
|
|
2207
|
+
export declare type CustomGeoJSONModuleConfig<TSources extends Record<string, FeatureCollection> = Record<string, FeatureCollection>> = MapModuleCommonConfig & {
|
|
2208
|
+
/**
|
|
2209
|
+
* The sources, keyed by an arbitrary user-defined name, that this module manages.
|
|
2210
|
+
*
|
|
2211
|
+
* @remarks
|
|
2212
|
+
* The set of source names is fixed at module creation time. Calling
|
|
2213
|
+
* {@link applyConfig} with new source names or omitting existing ones is **not**
|
|
2214
|
+
* supported — only the layer specs and visibility of existing sources can be
|
|
2215
|
+
* updated at runtime.
|
|
2216
|
+
*/
|
|
2217
|
+
sources: {
|
|
2218
|
+
[K in keyof TSources]: CustomGeoJSONSourceSpec;
|
|
2219
|
+
};
|
|
2220
|
+
/**
|
|
2221
|
+
* Custom images to register on the map by ID. The module adds each image during
|
|
2222
|
+
* setup, before any source or layer is created, and re-adds every image after every
|
|
2223
|
+
* style change — so symbol layers referencing an image via `icon-image: '<id>'`
|
|
2224
|
+
* survive `setStyle` calls automatically.
|
|
2225
|
+
*
|
|
2226
|
+
* @remarks
|
|
2227
|
+
* - Existing images on the map are not overwritten — the module skips IDs for
|
|
2228
|
+
* which `map.hasImage(id)` is already `true`.
|
|
2229
|
+
* - Only synchronous MapLibre image payloads are supported. URLs and raw SVG
|
|
2230
|
+
* strings must be loaded by the caller before being passed in.
|
|
2231
|
+
* - `applyConfig` re-runs image registration **additively**: new IDs are added,
|
|
2232
|
+
* already-present IDs are skipped, and removing an entry from `images` does
|
|
2233
|
+
* not unregister it from the map (other layers may still reference it).
|
|
2234
|
+
*
|
|
2235
|
+
* @example
|
|
2236
|
+
* ```typescript
|
|
2237
|
+
* const config: CustomGeoJSONModuleConfig = {
|
|
2238
|
+
* sources: {
|
|
2239
|
+
* markers: { layers: [{ type: 'symbol', layout: { 'icon-image': 'my-marker' } }] },
|
|
2240
|
+
* },
|
|
2241
|
+
* images: {
|
|
2242
|
+
* 'my-marker': { image: myImageBitmap, options: { pixelRatio: 2 } },
|
|
2243
|
+
* },
|
|
2244
|
+
* };
|
|
2245
|
+
* ```
|
|
2246
|
+
*/
|
|
2247
|
+
images?: Record<string, CustomGeoJSONImageSpec>;
|
|
2248
|
+
/**
|
|
2249
|
+
* Initial visibility for all layers across all sources. Defaults to `true`.
|
|
2250
|
+
*
|
|
2251
|
+
* @remarks
|
|
2252
|
+
* After `show(name, data)` is called for a source, layer visibility follows the
|
|
2253
|
+
* data state (visible iff the feature collection is non-empty). Use
|
|
2254
|
+
* {@link CustomGeoJSONModule.setVisible} to override that automatic behaviour at
|
|
2255
|
+
* runtime.
|
|
2256
|
+
*/
|
|
2257
|
+
visible?: boolean;
|
|
2258
|
+
};
|
|
2259
|
+
|
|
2260
|
+
/**
|
|
2261
|
+
* Configuration for one logical source managed by a {@link CustomGeoJSONModule}.
|
|
2262
|
+
*
|
|
2263
|
+
* Each entry corresponds to a single MapLibre GeoJSON source plus its associated layers.
|
|
2264
|
+
*
|
|
2265
|
+
* @group Custom
|
|
2266
|
+
*/
|
|
2267
|
+
export declare type CustomGeoJSONSourceSpec = {
|
|
2268
|
+
/**
|
|
2269
|
+
* Optional MapLibre source ID. Auto-generated as
|
|
2270
|
+
* `custom-geojson-${instanceIndex}-${sourceName}` when absent.
|
|
2271
|
+
*/
|
|
2272
|
+
sourceID?: string;
|
|
2273
|
+
/**
|
|
2274
|
+
* The layers that render this source. At least one layer is required for the source
|
|
2275
|
+
* to be visible on the map.
|
|
2276
|
+
*/
|
|
2277
|
+
layers: CustomGeoJSONLayerSpec[];
|
|
2278
|
+
/**
|
|
2279
|
+
* MapLibre cluster options, forwarded verbatim to the underlying GeoJSON source.
|
|
2280
|
+
*
|
|
2281
|
+
* @remarks
|
|
2282
|
+
* Cluster options are applied at source creation time and cannot be changed via
|
|
2283
|
+
* {@link applyConfig}. To change clustering, recreate the module.
|
|
2284
|
+
*/
|
|
2285
|
+
cluster?: GeoJSONSourceClusterOptions;
|
|
2286
|
+
};
|
|
2287
|
+
|
|
2288
|
+
declare type CustomGeoJSONSourcesWithLayers<TSources extends Record<string, FeatureCollection>> = {
|
|
2289
|
+
[K in keyof TSources]: GeoJSONSourceWithLayers<TSources[K]>;
|
|
2290
|
+
};
|
|
2291
|
+
|
|
1944
2292
|
/**
|
|
1945
2293
|
* Basic structure to define custom map icons, which end up in the map sprite.
|
|
1946
2294
|
*
|
|
@@ -2655,6 +3003,8 @@ declare type DisplayTrafficSectionProps = DisplaySectionProps & TrafficSectionPr
|
|
|
2655
3003
|
title?: string;
|
|
2656
3004
|
};
|
|
2657
3005
|
|
|
3006
|
+
declare type DistributiveOmit<T, K extends string> = T extends unknown ? Omit<T, K> : never;
|
|
3007
|
+
|
|
2658
3008
|
/**
|
|
2659
3009
|
* Configuration for EV charging station availability display.
|
|
2660
3010
|
*
|
|
@@ -3129,7 +3479,6 @@ export declare class GeoJSONSourceWithLayers<T extends FeatureCollection = Featu
|
|
|
3129
3479
|
* @group Geometries
|
|
3130
3480
|
*/
|
|
3131
3481
|
export declare class GeometriesModule extends AbstractMapModule<GeometrySourcesWithLayers, GeometriesModuleConfig> {
|
|
3132
|
-
private static lastInstanceIndex;
|
|
3133
3482
|
private titleLayerSpecs;
|
|
3134
3483
|
private geometryFillLayerSpecs;
|
|
3135
3484
|
private geometryOutlineLayerSpecs;
|
|
@@ -3421,7 +3770,7 @@ export declare class GeometriesModule extends AbstractMapModule<GeometrySourcesW
|
|
|
3421
3770
|
* });
|
|
3422
3771
|
* ```
|
|
3423
3772
|
*/
|
|
3424
|
-
get events(): CombinedEvents<MapGeoJSONFeature, GeometriesModuleConfig, PolygonFeatures>;
|
|
3773
|
+
get events(): CombinedEvents< MapGeoJSONFeature, GeometriesModuleConfig, PolygonFeatures>;
|
|
3425
3774
|
}
|
|
3426
3775
|
|
|
3427
3776
|
/**
|
|
@@ -4116,7 +4465,7 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
4116
4465
|
* @ignore
|
|
4117
4466
|
*/
|
|
4118
4467
|
protected _initSourcesWithLayers(): {
|
|
4119
|
-
hillshade: StyleSourceWithLayers<SourceSpecification, Source>;
|
|
4468
|
+
hillshade: StyleSourceWithLayers< SourceSpecification, Source>;
|
|
4120
4469
|
};
|
|
4121
4470
|
/**
|
|
4122
4471
|
* @ignore
|
|
@@ -4170,7 +4519,7 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
4170
4519
|
* unsub();
|
|
4171
4520
|
* ```
|
|
4172
4521
|
*/
|
|
4173
|
-
get events(): CombinedEvents<MapGeoJSONFeature, HillshadeModuleConfig, never>;
|
|
4522
|
+
get events(): CombinedEvents< MapGeoJSONFeature, HillshadeModuleConfig, never>;
|
|
4174
4523
|
}
|
|
4175
4524
|
|
|
4176
4525
|
/**
|
|
@@ -5398,7 +5747,6 @@ export declare type PlaceLayersConfig = {
|
|
|
5398
5747
|
} & HasAdditionalLayersConfig;
|
|
5399
5748
|
|
|
5400
5749
|
export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLayers, PlacesModuleConfig> {
|
|
5401
|
-
private static lastInstanceIndex;
|
|
5402
5750
|
private layerSpecs;
|
|
5403
5751
|
private connectionLayerSpecs;
|
|
5404
5752
|
private currentClusterMode;
|
|
@@ -5406,12 +5754,6 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
5406
5754
|
private unclusteredSourceID;
|
|
5407
5755
|
private connectionSourceID;
|
|
5408
5756
|
private layerIDPrefix;
|
|
5409
|
-
/**
|
|
5410
|
-
* The index of this instance, to generate unique source and layer IDs.
|
|
5411
|
-
* * Starts with 0 and each instance increments it by one.
|
|
5412
|
-
* @private
|
|
5413
|
-
*/
|
|
5414
|
-
private instanceIndex;
|
|
5415
5757
|
private defaultPlaceIconID;
|
|
5416
5758
|
private shownConnections;
|
|
5417
5759
|
private readonly shownFeaturesHandlers;
|
|
@@ -6302,7 +6644,7 @@ export declare class POIsModule extends AbstractMapModule<PoIsSourcesAndLayers,
|
|
|
6302
6644
|
* @ignore
|
|
6303
6645
|
*/
|
|
6304
6646
|
protected _initSourcesWithLayers(): {
|
|
6305
|
-
poi: StyleSourceWithLayers<SourceSpecification, Source>;
|
|
6647
|
+
poi: StyleSourceWithLayers< SourceSpecification, Source>;
|
|
6306
6648
|
};
|
|
6307
6649
|
/**
|
|
6308
6650
|
* @ignore
|
|
@@ -7370,15 +7712,8 @@ export declare type RouteWidth = 's' | 'm' | 'l';
|
|
|
7370
7712
|
* @group Routing
|
|
7371
7713
|
*/
|
|
7372
7714
|
export declare class RoutingModule extends AbstractMapModule<RoutingSourcesWithLayers, RoutingModuleConfig> {
|
|
7373
|
-
private static lastInstanceIndex;
|
|
7374
7715
|
private layersSpecs;
|
|
7375
7716
|
private layerIDPrefix;
|
|
7376
|
-
/**
|
|
7377
|
-
* The index of this instance, to generate unique source and layer IDs.
|
|
7378
|
-
* * Starts with 0 and each instance increments it by one.
|
|
7379
|
-
* @private
|
|
7380
|
-
*/
|
|
7381
|
-
private instanceIndex;
|
|
7382
7717
|
private readonly shownFeaturesHandlers;
|
|
7383
7718
|
/**
|
|
7384
7719
|
* Make sure the map is ready before create an instance of the module and any other interaction with the map
|
|
@@ -9136,7 +9471,6 @@ export declare type TrafficAreaAnalyticsConfig = MapModuleCommonConfig & {
|
|
|
9136
9471
|
* @group Traffic Area Analytics
|
|
9137
9472
|
*/
|
|
9138
9473
|
export declare class TrafficAreaAnalyticsModule extends AbstractMapModule<AreaAnalyticsSourcesWithLayers, TrafficAreaAnalyticsConfig> {
|
|
9139
|
-
private static lastInstanceIndex;
|
|
9140
9474
|
private heatmapLayerSpec;
|
|
9141
9475
|
private hexFillLayerSpec;
|
|
9142
9476
|
private hexExtrusionLayerSpec;
|
|
@@ -9181,7 +9515,7 @@ export declare class TrafficAreaAnalyticsModule extends AbstractMapModule<AreaAn
|
|
|
9181
9515
|
static get(tomtomMap: TomTomMap, config?: TrafficAreaAnalyticsConfig): Promise<TrafficAreaAnalyticsModule>;
|
|
9182
9516
|
private constructor();
|
|
9183
9517
|
/** @ignore */
|
|
9184
|
-
protected _initSourcesWithLayers(config?: TrafficAreaAnalyticsConfig,
|
|
9518
|
+
protected _initSourcesWithLayers(config?: TrafficAreaAnalyticsConfig, _restore?: boolean): AreaAnalyticsSourcesWithLayers;
|
|
9185
9519
|
/** @ignore */
|
|
9186
9520
|
protected _applyConfig(config: TrafficAreaAnalyticsConfig | undefined): TrafficAreaAnalyticsConfig | undefined;
|
|
9187
9521
|
/** @ignore */
|
|
@@ -9576,7 +9910,7 @@ export declare class TrafficFlowModule extends AbstractMapModule<TrafficFlowSour
|
|
|
9576
9910
|
* @ignore
|
|
9577
9911
|
*/
|
|
9578
9912
|
protected _initSourcesWithLayers(): {
|
|
9579
|
-
trafficFlow: StyleSourceWithLayers<SourceSpecification, Source>;
|
|
9913
|
+
trafficFlow: StyleSourceWithLayers< SourceSpecification, Source>;
|
|
9580
9914
|
};
|
|
9581
9915
|
/**
|
|
9582
9916
|
* @ignore
|
|
@@ -9893,8 +10227,6 @@ export declare type TrafficIncidentOverlayConfig = MapModuleCommonConfig & {
|
|
|
9893
10227
|
* @group Traffic
|
|
9894
10228
|
*/
|
|
9895
10229
|
export declare class TrafficIncidentOverlayModule extends AbstractMapModule<Sources, TrafficIncidentOverlayConfig> {
|
|
9896
|
-
private static lastInstanceIndex;
|
|
9897
|
-
private instanceIndex;
|
|
9898
10230
|
private lastResult;
|
|
9899
10231
|
private lastFeatureIds;
|
|
9900
10232
|
private lastFocusIds;
|
|
@@ -9902,7 +10234,7 @@ export declare class TrafficIncidentOverlayModule extends AbstractMapModule<Sour
|
|
|
9902
10234
|
static get(tomtomMap: TomTomMap, config?: TrafficIncidentOverlayConfig): Promise<TrafficIncidentOverlayModule>;
|
|
9903
10235
|
private constructor();
|
|
9904
10236
|
/** @ignore */
|
|
9905
|
-
protected _initSourcesWithLayers(config?: TrafficIncidentOverlayConfig,
|
|
10237
|
+
protected _initSourcesWithLayers(config?: TrafficIncidentOverlayConfig, _restore?: boolean): Sources;
|
|
9906
10238
|
/** @ignore */
|
|
9907
10239
|
protected _applyConfig(config: TrafficIncidentOverlayConfig | undefined): TrafficIncidentOverlayConfig | undefined;
|
|
9908
10240
|
private applyBeforeLayer;
|
|
@@ -10211,7 +10543,7 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
|
|
|
10211
10543
|
* @ignore
|
|
10212
10544
|
*/
|
|
10213
10545
|
protected _initSourcesWithLayers(): {
|
|
10214
|
-
trafficIncidents: StyleSourceWithLayers<SourceSpecification, Source>;
|
|
10546
|
+
trafficIncidents: StyleSourceWithLayers< SourceSpecification, Source>;
|
|
10215
10547
|
};
|
|
10216
10548
|
/**
|
|
10217
10549
|
* @ignore
|