@tomtom-org/maps-sdk 0.60.0 → 0.61.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 +418 -243
- package/README.md +2 -1
- package/core/dist/core.es.js +1 -1
- package/core/dist/core.es.js.map +1 -1
- package/core/dist/index.d.ts +51 -36
- package/core/package.json +4 -2
- package/map/dist/chunks/maplibre-gl-DJlOK9hg.js +2 -0
- package/map/dist/chunks/maplibre-gl-DJlOK9hg.js.map +1 -0
- package/map/dist/index.d.ts +2182 -1230
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/map/package.json +19 -1
- package/package.json +8 -1
- package/services/dist/index.d.ts +816 -973
- package/services/dist/services.es.js +1 -1
- package/services/dist/services.es.js.map +1 -1
package/map/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AllLayoutProperties, AllPaintProperties, BackgroundLayerSpecification, CircleLayerSpecification, DataDrivenPropertyValueSpecification, ExpressionFilterSpecification, ExpressionSpecification, FilterSpecification, GeoJSONSource, GeoJSONSourceSpecification, LayerSpecification, LineLayerSpecification, LngLat, Map as Map$1, MapGeoJSONFeature, MapOptions, Source, SourceSpecification, StyleImageInterface, StyleImageMetadata, StyleSpecification, SymbolLayerSpecification } from "maplibre-gl";
|
|
2
|
-
import { Anything, AreaAnalyticsMetricKey, AreaAnalyticsMetrics, BBox, ChargingSpeed, ChargingStop, ChargingStopProps, CommonPlaceProps, CountrySectionProps, DelayMagnitude, DisplayUnits, EntryPoint, GetPositionEntryPointOption, GlobalConfig, Instruction, Language, POICategory, Place, Places, PolygonFeature, PolygonFeatures, Route, RouteProps, Routes, SectionProps, SectionType, TrafficAreaAnalytics, TrafficIncident, TrafficIncidentBaseProperties, TrafficIncidentCategory, TrafficIncidentDetails, TrafficIncidentTimeValidity, TrafficSectionProps, Waypoint, WaypointLike, Waypoints } from "@tomtom-org/maps-sdk/core";
|
|
2
|
+
import { Anything, AreaAnalyticsMetricKey, AreaAnalyticsMetrics, BBox, ChargingSpeed, ChargingStop, ChargingStopProps, CommonPlaceProps, CountrySectionProps, DelayMagnitude, DisplayUnits, DistanceDisplayUnits, EntryPoint, GeopoliticalView, GetPositionEntryPointOption, GlobalConfig, Instruction, Language, POICategory, Place, Places, PolygonFeature, PolygonFeatures, Route, RouteProps, Routes, SectionProps, SectionType, TimeDisplayUnits, TrafficAreaAnalytics, TrafficIncident, TrafficIncidentBaseProperties, TrafficIncidentCategory, TrafficIncidentDetails, TrafficIncidentTimeValidity, TrafficSectionProps, Waypoint, WaypointLike, Waypoints } from "@tomtom-org/maps-sdk/core";
|
|
3
3
|
//#region src/init/types/mapEventsConfig.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Configuration options for map user event handling.
|
|
@@ -980,7 +980,7 @@ type StylingKnobAppliesTo = (typeof stylingKnobAppliesTo)[number];
|
|
|
980
980
|
*
|
|
981
981
|
* @group Map Styling
|
|
982
982
|
*/
|
|
983
|
-
type StylingKnobValue =
|
|
983
|
+
type StylingKnobValue = KnobValueOf<StylingKnobKind>;
|
|
984
984
|
/**
|
|
985
985
|
* The valid range of a numeric knob, in the units of the knob (`factor` knobs are unitless).
|
|
986
986
|
* Styling always ships a slider `step`; the shared {@link KnobRange} leaves it optional.
|
|
@@ -992,20 +992,16 @@ type StylingKnobRange = KnobRange & {
|
|
|
992
992
|
};
|
|
993
993
|
/**
|
|
994
994
|
* One entry of {@link stylingKnobCatalogue}: what a UI or a coding agent needs to offer the knob and
|
|
995
|
-
* validate a value for it, with no map loaded.
|
|
995
|
+
* validate a value for it, with no map loaded. It carries no `default`: the loaded style decides,
|
|
996
|
+
* and {@link StylingModule.get} reads the value in force.
|
|
996
997
|
*
|
|
997
998
|
* @group Map Styling
|
|
998
999
|
*/
|
|
999
|
-
type StylingKnob = {
|
|
1000
|
+
type StylingKnob = KnobEntry<StylingKnobId, StylingKnobKind> & {
|
|
1000
1001
|
/** The knob's id, as accepted by {@link StylingModule.set}. */
|
|
1001
1002
|
id: StylingKnobId;
|
|
1002
|
-
kind: StylingKnobKind;
|
|
1003
|
-
/** One line on what turning the knob does. */
|
|
1004
|
-
description: string;
|
|
1005
|
-
/** The range of valid values, for `factor` and `number` knobs. */
|
|
1006
1003
|
range?: StylingKnobRange;
|
|
1007
|
-
|
|
1008
|
-
options?: readonly string[];
|
|
1004
|
+
default?: never;
|
|
1009
1005
|
/** Which styles the knob works on; see {@link stylingKnobAppliesTo}. */
|
|
1010
1006
|
appliesTo: StylingKnobAppliesTo;
|
|
1011
1007
|
};
|
|
@@ -1137,19 +1133,11 @@ type KnobMechanism =
|
|
|
1137
1133
|
{
|
|
1138
1134
|
type: 'published';
|
|
1139
1135
|
};
|
|
1140
|
-
|
|
1141
|
-
type KnobDefinition = {
|
|
1142
|
-
kind: StylingKnobKind;
|
|
1143
|
-
description: string;
|
|
1136
|
+
type KnobDefinitionOf<KIND extends StylingKnobKind> = Omit<KnobEntry<string, KIND>, 'id' | 'default'> & {
|
|
1144
1137
|
range?: StylingKnobRange;
|
|
1145
|
-
/** The valid values of an `enum` knob. */
|
|
1146
|
-
options?: readonly string[];
|
|
1147
1138
|
appliesTo: StylingKnobAppliesTo;
|
|
1148
1139
|
mechanisms: KnobMechanism[];
|
|
1149
1140
|
};
|
|
1150
|
-
type KnobDefinitionOf<KIND extends StylingKnobKind> = KnobDefinition & {
|
|
1151
|
-
kind: KIND;
|
|
1152
|
-
};
|
|
1153
1141
|
/**
|
|
1154
1142
|
* The styling knob catalogue: what the SDK can restyle on a TomTom standard style, and how.
|
|
1155
1143
|
*
|
|
@@ -1176,6 +1164,7 @@ declare const knobDefinitions: {
|
|
|
1176
1164
|
readonly min: 0;
|
|
1177
1165
|
readonly max: 359;
|
|
1178
1166
|
readonly step: 1;
|
|
1167
|
+
readonly bounds: "hard";
|
|
1179
1168
|
};
|
|
1180
1169
|
readonly appliesTo: "tomtom-styles";
|
|
1181
1170
|
readonly mechanisms: [{
|
|
@@ -1191,6 +1180,7 @@ declare const knobDefinitions: {
|
|
|
1191
1180
|
readonly min: 0;
|
|
1192
1181
|
readonly max: 1;
|
|
1193
1182
|
readonly step: 0.05;
|
|
1183
|
+
readonly bounds: "hard";
|
|
1194
1184
|
};
|
|
1195
1185
|
readonly appliesTo: "tomtom-styles";
|
|
1196
1186
|
readonly mechanisms: [{
|
|
@@ -1206,6 +1196,7 @@ declare const knobDefinitions: {
|
|
|
1206
1196
|
readonly min: 10;
|
|
1207
1197
|
readonly max: 22;
|
|
1208
1198
|
readonly step: 1;
|
|
1199
|
+
readonly bounds: "hard";
|
|
1209
1200
|
};
|
|
1210
1201
|
readonly appliesTo: "tomtom-styles";
|
|
1211
1202
|
readonly mechanisms: [{
|
|
@@ -1283,6 +1274,7 @@ declare const knobDefinitions: {
|
|
|
1283
1274
|
readonly min: 3;
|
|
1284
1275
|
readonly max: 18;
|
|
1285
1276
|
readonly step: 1;
|
|
1277
|
+
readonly bounds: "hard";
|
|
1286
1278
|
};
|
|
1287
1279
|
readonly appliesTo: "tomtom-styles";
|
|
1288
1280
|
readonly mechanisms: [{
|
|
@@ -1305,6 +1297,7 @@ declare const knobDefinitions: {
|
|
|
1305
1297
|
readonly min: -3;
|
|
1306
1298
|
readonly max: 3;
|
|
1307
1299
|
readonly step: 1;
|
|
1300
|
+
readonly bounds: "hard";
|
|
1308
1301
|
};
|
|
1309
1302
|
readonly appliesTo: "tomtom-styles";
|
|
1310
1303
|
readonly mechanisms: [{
|
|
@@ -1385,13 +1378,12 @@ type StylingColorKnobId = { [ID in StylingKnobId]: (typeof knobDefinitions)[ID][
|
|
|
1385
1378
|
* @group Map Styling
|
|
1386
1379
|
*/
|
|
1387
1380
|
export declare const stylingColorKnobIds: StylingColorKnobId[];
|
|
1388
|
-
type ValueOfKind<KIND extends StylingKnobKind> = KIND extends 'toggle' ? boolean : KIND extends 'color' | 'enum' ? string : number;
|
|
1389
1381
|
/**
|
|
1390
1382
|
* The value type a given styling knob takes.
|
|
1391
1383
|
*
|
|
1392
1384
|
* @group Map Styling
|
|
1393
1385
|
*/
|
|
1394
|
-
type StylingKnobValueOf<ID extends StylingKnobId> =
|
|
1386
|
+
type StylingKnobValueOf<ID extends StylingKnobId> = KnobValueOf<(typeof knobDefinitions)[ID]['kind']>;
|
|
1395
1387
|
//#endregion
|
|
1396
1388
|
//#region src/shared/layers/abstractLayerComposer.d.ts
|
|
1397
1389
|
/**
|
|
@@ -1758,6 +1750,7 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
|
|
|
1758
1750
|
* ```
|
|
1759
1751
|
*/
|
|
1760
1752
|
reset(id?: StylingKnobId): void;
|
|
1753
|
+
private publish;
|
|
1761
1754
|
private publishMapColors;
|
|
1762
1755
|
/**
|
|
1763
1756
|
* Recolours the whole base map with up to ten semantic colours in one call — the style themes'
|
|
@@ -1834,7 +1827,6 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
|
|
|
1834
1827
|
private defaultOf;
|
|
1835
1828
|
private mapLevelDefaultOf;
|
|
1836
1829
|
private assertKnob;
|
|
1837
|
-
private validate;
|
|
1838
1830
|
private warnOnce;
|
|
1839
1831
|
}
|
|
1840
1832
|
//#endregion
|
|
@@ -1956,8 +1948,8 @@ export type SetStyleOptions = {
|
|
|
1956
1948
|
* - `true`: a clean switch. Modules re-bind to the new style with default configuration and
|
|
1957
1949
|
* nothing shown, and only the style parts named in the new style input are loaded.
|
|
1958
1950
|
*
|
|
1959
|
-
* The map language
|
|
1960
|
-
* {@link TomTomMap.setLanguage}
|
|
1951
|
+
* The map language and geopolitical view are not SDK state: both survive either case, and only
|
|
1952
|
+
* {@link TomTomMap.setLanguage} and {@link TomTomMap.setGeopoliticalView} change them.
|
|
1961
1953
|
*
|
|
1962
1954
|
* Registered {@link StyleChangeHandler}s run in both cases and receive the value in their
|
|
1963
1955
|
* {@link StyleChangeContext}.
|
|
@@ -1978,6 +1970,7 @@ export type SetStyleOptions = {
|
|
|
1978
1970
|
* - Seamless style switching without map reload
|
|
1979
1971
|
* - Integrated event handling system
|
|
1980
1972
|
* - Multi-language support with dynamic switching
|
|
1973
|
+
* - Geopolitical views of disputed borders and names, switchable at runtime
|
|
1981
1974
|
* - Compatible with TomTom map modules (traffic, POIs, routing, etc.)
|
|
1982
1975
|
*
|
|
1983
1976
|
* **Architecture:**
|
|
@@ -2151,6 +2144,26 @@ export declare class TomTomMap {
|
|
|
2151
2144
|
* @ignore
|
|
2152
2145
|
*/
|
|
2153
2146
|
_onMapColorsChange(handler: (colors: Readonly<MapColors>) => void): void;
|
|
2147
|
+
private stylingSettings;
|
|
2148
|
+
private readonly stylingAppliedHandlers;
|
|
2149
|
+
/**
|
|
2150
|
+
* The knobs in force, as the {@link StylingModule} last applied them. Empty until a styling module exists.
|
|
2151
|
+
* @ignore
|
|
2152
|
+
*/
|
|
2153
|
+
get _stylingSettings(): Readonly<StylingSettings>;
|
|
2154
|
+
/**
|
|
2155
|
+
* Publishes the knobs in force; the styling module calls this each time it has applied knobs to
|
|
2156
|
+
* the loaded style, with the ids of those it rewrote or whose value moved.
|
|
2157
|
+
* @ignore
|
|
2158
|
+
*/
|
|
2159
|
+
_setStylingSettings(settings: StylingSettings, knobIds: ReadonlySet<StylingKnobId>): void;
|
|
2160
|
+
/**
|
|
2161
|
+
* Runs `handler` each time the styling module has applied knobs to the loaded style — after any
|
|
2162
|
+
* knob change and after every style change — for as long as the map lives. It is how a module
|
|
2163
|
+
* drawing its own layers in a look borrowed from the style's follows the knobs that restyle it.
|
|
2164
|
+
* @ignore
|
|
2165
|
+
*/
|
|
2166
|
+
_onStylingApplied(handler: (knobIds: ReadonlySet<StylingKnobId>) => void): void;
|
|
2154
2167
|
private readonly styleChangeHandlers;
|
|
2155
2168
|
private styleGivenToMapLibre;
|
|
2156
2169
|
private styleRequestSequence;
|
|
@@ -2213,8 +2226,6 @@ export declare class TomTomMap {
|
|
|
2213
2226
|
* });
|
|
2214
2227
|
* ```
|
|
2215
2228
|
*
|
|
2216
|
-
* @throws Will log errors if RTL text plugin fails to load (non-blocking)
|
|
2217
|
-
*
|
|
2218
2229
|
* @see {@link MapLibreOptions}
|
|
2219
2230
|
* @see {@link TomTomMapParams}
|
|
2220
2231
|
* @see {@link https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/ | MapLibre Map Parameters}
|
|
@@ -2223,11 +2234,6 @@ export declare class TomTomMap {
|
|
|
2223
2234
|
* @see [User Interaction Events Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/user-events)
|
|
2224
2235
|
*/
|
|
2225
2236
|
constructor(mapParams: TomTomMapParams);
|
|
2226
|
-
private loadRTLTextPlugin;
|
|
2227
|
-
/**
|
|
2228
|
-
* Dynamically loads the MapLibre CSS stylesheet from CDN.
|
|
2229
|
-
*/
|
|
2230
|
-
private ensureMapLibreCSSLoaded;
|
|
2231
2237
|
/**
|
|
2232
2238
|
* Changes the map style dynamically without reloading the entire map.
|
|
2233
2239
|
*
|
|
@@ -2425,6 +2431,20 @@ export declare class TomTomMap {
|
|
|
2425
2431
|
* @see {@link https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes | ISO 639-1 Language Codes}
|
|
2426
2432
|
*/
|
|
2427
2433
|
setLanguage(language: Language): void;
|
|
2434
|
+
/**
|
|
2435
|
+
* Changes the geopolitical view of the map: the borders, and the territory and sea names, it
|
|
2436
|
+
* draws for disputed territories.
|
|
2437
|
+
*
|
|
2438
|
+
* @param geopoliticalView The view to draw, or `undefined` for the default view of the country
|
|
2439
|
+
* the map is viewed from. Set it at construction through {@link core!GlobalConfig.geopoliticalView}.
|
|
2440
|
+
*
|
|
2441
|
+
* @remarks
|
|
2442
|
+
* - The visible tiles reload in place, and the view persists across every style change.
|
|
2443
|
+
* - Applies to the TomTom Orbis vector tiles, those of a custom style included. The tiles do not
|
|
2444
|
+
* serve `CN` and `RU`, which leave the default view; see {@link core!GeopoliticalView}.
|
|
2445
|
+
* - Services keep the view of the global configuration, or of each call.
|
|
2446
|
+
*/
|
|
2447
|
+
setGeopoliticalView(geopoliticalView: GeopoliticalView | undefined): void;
|
|
2428
2448
|
/**
|
|
2429
2449
|
* Changes the map's user events configuration at runtime.
|
|
2430
2450
|
*
|
|
@@ -3942,6 +3962,15 @@ type CustomImage<I extends string = string> = {
|
|
|
3942
3962
|
*/
|
|
3943
3963
|
offsetY?: number;
|
|
3944
3964
|
};
|
|
3965
|
+
/**
|
|
3966
|
+
* A {@link CustomImage} that survives JSON: its `image` a URL, data URI or SVG text. `JSON.stringify`
|
|
3967
|
+
* turns an `HTMLImageElement` into `{}`.
|
|
3968
|
+
*
|
|
3969
|
+
* @group Shared
|
|
3970
|
+
*/
|
|
3971
|
+
type SerializableCustomImage<I extends string = string> = Omit<CustomImage<I>, 'image'> & {
|
|
3972
|
+
image?: Exclude<CustomImage['image'], HTMLImageElement>;
|
|
3973
|
+
};
|
|
3945
3974
|
/**
|
|
3946
3975
|
* Options to style SDK SVG icons with custom colors and opacity.
|
|
3947
3976
|
*
|
|
@@ -5499,12 +5528,16 @@ export declare abstract class AbstractMapModule<SOURCES_WITH_LAYERS extends Sour
|
|
|
5499
5528
|
* Owning the data brings the duty this class states: a clean style switch must forget the data
|
|
5500
5529
|
* the module remembers having shown, through {@link discardShownData}.
|
|
5501
5530
|
*
|
|
5531
|
+
* Every such module hides and shows through {@link setVisible}, which keeps the data it shows.
|
|
5532
|
+
*
|
|
5502
5533
|
* @typeParam SOURCES_WITH_LAYERS - The GeoJSON sources, with their layers, this module owns
|
|
5503
5534
|
* @typeParam CFG - The configuration type for this module, or undefined if no configuration is needed
|
|
5504
5535
|
*
|
|
5505
5536
|
* @group Shared
|
|
5506
5537
|
*/
|
|
5507
|
-
export declare abstract class AbstractDataOwnedMapModule<SOURCES_WITH_LAYERS extends GeoJSONSourcesWithLayers, CFG extends MapModuleCommonConfig
|
|
5538
|
+
export declare abstract class AbstractDataOwnedMapModule<SOURCES_WITH_LAYERS extends GeoJSONSourcesWithLayers, CFG extends (MapModuleCommonConfig & {
|
|
5539
|
+
visible?: boolean;
|
|
5540
|
+
}) | undefined = undefined> extends AbstractMapModule<SOURCES_WITH_LAYERS, CFG> {
|
|
5508
5541
|
/**
|
|
5509
5542
|
* Owning the data it draws, such a module always remembers something a clean style switch must
|
|
5510
5543
|
* forget, so the inherited no-op becomes a duty here. A module that remembers nothing
|
|
@@ -5513,6 +5546,37 @@ export declare abstract class AbstractDataOwnedMapModule<SOURCES_WITH_LAYERS ext
|
|
|
5513
5546
|
* @ignore
|
|
5514
5547
|
*/
|
|
5515
5548
|
protected abstract discardShownData(): void;
|
|
5549
|
+
/**
|
|
5550
|
+
* Shows or hides the layers of everything shown, per `config.visible` and whether each part has
|
|
5551
|
+
* data. `config` is passed rather than read, because `_applyConfig` runs before `this.config`
|
|
5552
|
+
* holds the new configuration.
|
|
5553
|
+
* @protected
|
|
5554
|
+
* @ignore
|
|
5555
|
+
*/
|
|
5556
|
+
protected abstract applyVisibility(config: CFG | undefined): void;
|
|
5557
|
+
/**
|
|
5558
|
+
* Shows or hides everything the module draws.
|
|
5559
|
+
*
|
|
5560
|
+
* @remarks
|
|
5561
|
+
* Stored as `visible` in the configuration. Showing and clearing data never change it: a hidden
|
|
5562
|
+
* module keeps its data, through style changes too, and draws it again on `setVisible(true)`.
|
|
5563
|
+
*
|
|
5564
|
+
* Showing leaves hidden what the configuration turns off: a route section type that is off, the
|
|
5565
|
+
* layers a place marker type does not use.
|
|
5566
|
+
*
|
|
5567
|
+
* @example
|
|
5568
|
+
* ```typescript
|
|
5569
|
+
* module.setVisible(false);
|
|
5570
|
+
* await module.show(data); // stays hidden
|
|
5571
|
+
* module.setVisible(true);
|
|
5572
|
+
* ```
|
|
5573
|
+
*/
|
|
5574
|
+
setVisible(visible: boolean): void;
|
|
5575
|
+
/**
|
|
5576
|
+
* Whether the module is set to be shown: its `visible` setting, `true` unless set. A shown
|
|
5577
|
+
* module with nothing shown draws nothing; `getShown()` returns what is shown.
|
|
5578
|
+
*/
|
|
5579
|
+
isVisible(): boolean;
|
|
5516
5580
|
}
|
|
5517
5581
|
//#endregion
|
|
5518
5582
|
//#region src/shared/layers/layerVisibilityComposer.d.ts
|
|
@@ -5591,16 +5655,29 @@ export declare abstract class AbstractStyleOwnedMapModule<SOURCES_WITH_LAYERS ex
|
|
|
5591
5655
|
* - `toggle`: `true`/`false`, e.g. whether an overlay is drawn.
|
|
5592
5656
|
* - `factor`: a multiplier over what the style already does (`1` = unchanged).
|
|
5593
5657
|
* - `number`: an absolute number with a range.
|
|
5658
|
+
* - `offset`: an `[x, y]` displacement on screen, x to the right and y down, each within the
|
|
5659
|
+
* knob's range; the description gives the unit.
|
|
5594
5660
|
* - `color`: a CSS colour string.
|
|
5595
5661
|
* - `enum`: one of the knob's `options`.
|
|
5662
|
+
* - `enums`: a list of the knob's `options`, e.g. the categories a filter shows. The description
|
|
5663
|
+
* says when the order matters.
|
|
5596
5664
|
* - `colors`: a list of colours, each a CSS colour string or one of the knob's `options` — names
|
|
5597
5665
|
* the module resolves to colours, such as styling knob ids. An empty list is the knob's default.
|
|
5666
|
+
* - `image`: the id of an image in the loaded style's sprite, e.g. `poi-toll_plaza`.
|
|
5667
|
+
* - `text`: any string, e.g. the label written after a distance.
|
|
5598
5668
|
* @group Shared
|
|
5599
5669
|
*/
|
|
5600
|
-
export type KnobKind = 'toggle' | 'factor' | 'number' | 'color' | 'enum' | 'colors';
|
|
5670
|
+
export type KnobKind = 'toggle' | 'factor' | 'number' | 'offset' | 'color' | 'enum' | 'enums' | 'colors' | 'image' | 'text';
|
|
5601
5671
|
/**
|
|
5602
|
-
* Inclusive bounds for a `factor` or `
|
|
5603
|
-
*
|
|
5672
|
+
* Inclusive bounds for a `factor`, `number` or `offset` knob, on an `offset` for each of x and y.
|
|
5673
|
+
* `step` is what a slider would use.
|
|
5674
|
+
*
|
|
5675
|
+
* @remarks
|
|
5676
|
+
* `bounds` says which ends a value must keep to, as {@link validateKnobValue} checks:
|
|
5677
|
+
* - `hard`: both, e.g. an opacity or a factor. Outside them the value is invalid.
|
|
5678
|
+
* - `hard-min`: `min` is a floor, e.g. no height below 0 m; `max` is where a control's span ends,
|
|
5679
|
+
* and a larger value still applies.
|
|
5680
|
+
* - `soft`: neither; the range is the span a control offers, and any number applies.
|
|
5604
5681
|
*
|
|
5605
5682
|
* @group Shared
|
|
5606
5683
|
*/
|
|
@@ -5608,7 +5685,105 @@ export type KnobRange = {
|
|
|
5608
5685
|
min: number;
|
|
5609
5686
|
max: number;
|
|
5610
5687
|
step?: number;
|
|
5688
|
+
bounds: 'hard' | 'hard-min' | 'soft';
|
|
5611
5689
|
};
|
|
5690
|
+
/**
|
|
5691
|
+
* The value a knob of the given {@link KnobKind} holds.
|
|
5692
|
+
*
|
|
5693
|
+
* @group Shared
|
|
5694
|
+
*/
|
|
5695
|
+
export type KnobValueOf<KIND extends KnobKind> = KIND extends 'toggle' ? boolean : KIND extends 'factor' | 'number' ? number : KIND extends 'offset' ? readonly [x: number, y: number] : KIND extends 'colors' | 'enums' ? readonly string[] : string;
|
|
5696
|
+
/**
|
|
5697
|
+
* One entry of a knob catalogue: what a UI or a coding agent needs to offer a knob and validate a
|
|
5698
|
+
* value for it, with no map loaded. A catalogue may add fields of its own.
|
|
5699
|
+
*
|
|
5700
|
+
* @remarks
|
|
5701
|
+
* One union member per kind: a `factor`, `number` or `offset` knob always carries its `range`, an
|
|
5702
|
+
* `enum` or `enums` knob its `options`, and a `colors` knob may carry the names it resolves.
|
|
5703
|
+
*
|
|
5704
|
+
* @group Shared
|
|
5705
|
+
*/
|
|
5706
|
+
export type KnobEntry<ID extends string, KIND extends KnobKind = KnobKind> = KIND extends KnobKind ? {
|
|
5707
|
+
/** The knob's id, unique within its catalogue. */
|
|
5708
|
+
id: ID;
|
|
5709
|
+
kind: KIND;
|
|
5710
|
+
/** One line on what turning the knob does. */
|
|
5711
|
+
description: string;
|
|
5712
|
+
/** The value in force when nothing sets the knob, where one value holds everywhere. */
|
|
5713
|
+
default?: KnobValueOf<KIND>;
|
|
5714
|
+
} & (KIND extends 'factor' | 'number' | 'offset' ? {
|
|
5715
|
+
range: KnobRange;
|
|
5716
|
+
options?: never;
|
|
5717
|
+
} : KIND extends 'enum' | 'enums' ? {
|
|
5718
|
+
range?: never;
|
|
5719
|
+
options: readonly string[];
|
|
5720
|
+
} : KIND extends 'colors' ? {
|
|
5721
|
+
range?: never;
|
|
5722
|
+
options?: readonly string[];
|
|
5723
|
+
} : {
|
|
5724
|
+
range?: never;
|
|
5725
|
+
options?: never;
|
|
5726
|
+
}) : never;
|
|
5727
|
+
//#endregion
|
|
5728
|
+
//#region src/shared/knobUtils.d.ts
|
|
5729
|
+
type ElementAt<T, KEY extends string> = T extends readonly (infer ELEMENT)[] ? KEY extends `${number}` ? ELEMENT : never : never;
|
|
5730
|
+
/**
|
|
5731
|
+
* The value at a dotted path into T, or `never` where the path names nothing. A union is read
|
|
5732
|
+
* member by member, so `focus.widthFactor` resolves through `false | IncidentFocusStyle`, and a
|
|
5733
|
+
* numeric segment indexes a list.
|
|
5734
|
+
* @ignore
|
|
5735
|
+
*/
|
|
5736
|
+
type ValueAt<T, PATH extends string> = T extends unknown ? PATH extends `${infer HEAD}.${infer REST}` ? HEAD extends keyof T ? ValueAt<NonNullable<T[HEAD]>, REST> : ValueAt<NonNullable<ElementAt<T, HEAD>>, REST> : PATH extends keyof T ? NonNullable<T[PATH]> : NonNullable<ElementAt<T, PATH>> : never;
|
|
5737
|
+
/**
|
|
5738
|
+
* The alternatives of VALUE a knob holds: plain values, lists and `[x, y]` pairs, without the
|
|
5739
|
+
* objects, MapLibre expressions and callbacks the config also takes there.
|
|
5740
|
+
* @ignore
|
|
5741
|
+
*/
|
|
5742
|
+
type KnobPlainValue<VALUE> = VALUE extends ExpressionSpecification ? never : VALUE extends readonly unknown[] ? VALUE : VALUE extends object ? never : VALUE;
|
|
5743
|
+
//#endregion
|
|
5744
|
+
//#region src/shared/knobValues.d.ts
|
|
5745
|
+
/**
|
|
5746
|
+
* Checks a value against a catalogue entry: its kind, its options, and its range as far as the
|
|
5747
|
+
* range's `bounds` hold.
|
|
5748
|
+
*
|
|
5749
|
+
* @remarks
|
|
5750
|
+
* A `color` must parse as a CSS colour. An `image` or `text` value need only be a string; whether
|
|
5751
|
+
* the sprite has the image is known on a loaded map only.
|
|
5752
|
+
*
|
|
5753
|
+
* @param knob - The knob's entry in its catalogue.
|
|
5754
|
+
* @throws `RangeError` naming the knob and what it expects, for a value it does not take.
|
|
5755
|
+
*
|
|
5756
|
+
* @example
|
|
5757
|
+
* ```typescript
|
|
5758
|
+
* const knob = trafficIncidentsKnobCatalogue.find(({ id }) => id === 'filters.any.0.magnitudes.values');
|
|
5759
|
+
* validateKnobValue(knob, ['major', 'severe']); // RangeError: … 'severe' is not
|
|
5760
|
+
* ```
|
|
5761
|
+
*
|
|
5762
|
+
* @group Shared
|
|
5763
|
+
*/
|
|
5764
|
+
export declare const validateKnobValue: (knob: KnobEntry<string>, value: unknown) => void;
|
|
5765
|
+
/**
|
|
5766
|
+
* Sets one knob of a module by its catalogue id: checks the value with {@link validateKnobValue},
|
|
5767
|
+
* then applies the module's configuration with the value at the knob's path and every other
|
|
5768
|
+
* setting kept.
|
|
5769
|
+
*
|
|
5770
|
+
* @remarks
|
|
5771
|
+
* Nothing changes when the value is invalid. `StylingModule` sets its knobs with its own `set`.
|
|
5772
|
+
*
|
|
5773
|
+
* @param catalogue - The module's knob catalogue, e.g. `trafficFlowKnobCatalogue` for a
|
|
5774
|
+
* `TrafficFlowModule`.
|
|
5775
|
+
* @param id - The knob's id, its path in the module's configuration.
|
|
5776
|
+
* @throws `RangeError` for a value the knob does not take; `Error` for an id the catalogue lacks.
|
|
5777
|
+
*
|
|
5778
|
+
* @example
|
|
5779
|
+
* ```typescript
|
|
5780
|
+
* setKnob(trafficFlow, trafficFlowKnobCatalogue, 'filters.any.0.roadCategories.show', 'only');
|
|
5781
|
+
* setKnob(analytics, trafficAreaAnalyticsKnobCatalogue, 'metricConfig.speed.height.maxHeightMeters', 2000);
|
|
5782
|
+
* ```
|
|
5783
|
+
*
|
|
5784
|
+
* @group Shared
|
|
5785
|
+
*/
|
|
5786
|
+
export declare const setKnob: <CONFIG extends MapModuleCommonConfig, ID extends string, KNOB extends ID>(module: Pick<AbstractMapModule<SourcesWithLayers, CONFIG>, "getConfig" | "applyConfig">, catalogue: readonly KnobEntry<ID>[], id: KNOB, value: KnobPlainValue<ValueAt<CONFIG, KNOB>>) => void;
|
|
5612
5787
|
//#endregion
|
|
5613
5788
|
//#region src/shared/layers/sourcesIDs.d.ts
|
|
5614
5789
|
/**
|
|
@@ -5749,6 +5924,7 @@ export type BaseMapEvents = CombinedEvents<MapGeoJSONFeature, BaseMapModuleConfi
|
|
|
5749
5924
|
* toggles within a group (`roads.arrows`, `roads.exitNumbers`, …) hide their layers inside what this
|
|
5750
5925
|
* module shows, and never show them in a group it hides.
|
|
5751
5926
|
* See [Who owns what](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#who-owns-what).
|
|
5927
|
+
* {@link baseMapKnobCatalogue} lists every setting of its configuration.
|
|
5752
5928
|
*
|
|
5753
5929
|
* **Managed Layers:**
|
|
5754
5930
|
* - Background and land cover
|
|
@@ -5888,20 +6064,21 @@ export declare class BaseMapModule extends AbstractStyleOwnedMapModule<BaseSourc
|
|
|
5888
6064
|
*/
|
|
5889
6065
|
protected _applyConfig(config: BaseMapModuleConfig | undefined): BaseMapModuleConfig | undefined;
|
|
5890
6066
|
/**
|
|
5891
|
-
*
|
|
6067
|
+
* Whether the base map, or the layer groups asked about, is set to be shown.
|
|
5892
6068
|
*
|
|
5893
6069
|
* @param options - Optional settings for fine-grained control.
|
|
5894
6070
|
* @param options.layerGroups - Ask about specific layer groups instead of all layers.
|
|
5895
6071
|
*
|
|
5896
|
-
* @returns `true` if at least one of the layers asked about is
|
|
5897
|
-
*
|
|
6072
|
+
* @returns `true` if at least one of the layers asked about is set to show, `false` if all are
|
|
6073
|
+
* set to hide.
|
|
5898
6074
|
*
|
|
5899
6075
|
* @remarks
|
|
5900
|
-
*
|
|
5901
|
-
*
|
|
6076
|
+
* Reads the settings, not the map: `visible`, then the `groups` and the {@link StylingModule}
|
|
6077
|
+
* toggles over them, the last that reaches a layer winning — the same order {@link setVisible}
|
|
6078
|
+
* writes them in.
|
|
5902
6079
|
*
|
|
5903
|
-
*
|
|
5904
|
-
*
|
|
6080
|
+
* A layer none of them reaches answers with what the style draws, which is how a per-group
|
|
6081
|
+
* control reflects the state the style starts in.
|
|
5905
6082
|
*
|
|
5906
6083
|
* @example
|
|
5907
6084
|
* ```typescript
|
|
@@ -5999,6 +6176,7 @@ export declare class BaseMapModule extends AbstractStyleOwnedMapModule<BaseSourc
|
|
|
5999
6176
|
*/
|
|
6000
6177
|
_onGroupsTakenOver(listener: (groups: readonly BaseMapLayerGroupName[]) => void): void;
|
|
6001
6178
|
private writeVisibility;
|
|
6179
|
+
private layerSettings;
|
|
6002
6180
|
/**
|
|
6003
6181
|
* The base-map layer ids grouped by {@link BaseMapLayerGroupName}, for the
|
|
6004
6182
|
* layers this module manages in the current style.
|
|
@@ -6059,6 +6237,53 @@ export declare class BaseMapModule extends AbstractStyleOwnedMapModule<BaseSourc
|
|
|
6059
6237
|
get events(): BaseMapEvents;
|
|
6060
6238
|
}
|
|
6061
6239
|
//#endregion
|
|
6240
|
+
//#region src/base/types/baseMapKnobs.d.ts
|
|
6241
|
+
/**
|
|
6242
|
+
* The id of a base-map knob: its path into {@link BaseMapModuleConfig}, e.g. `visible` or
|
|
6243
|
+
* `groups.water.visible`. See {@link baseMapKnobCatalogue} for what each one does.
|
|
6244
|
+
*
|
|
6245
|
+
* @remarks
|
|
6246
|
+
* Every {@link BaseMapLayerGroupName} contributes one `groups.<group>.visible` id.
|
|
6247
|
+
*
|
|
6248
|
+
* @group Base Map
|
|
6249
|
+
*/
|
|
6250
|
+
type BaseMapKnobId = 'visible' | `groups.${BaseMapLayerGroupName}.visible`;
|
|
6251
|
+
/**
|
|
6252
|
+
* The value type a given base-map knob takes: the plain value its path holds in {@link BaseMapModuleConfig}.
|
|
6253
|
+
*
|
|
6254
|
+
* @group Base Map
|
|
6255
|
+
*/
|
|
6256
|
+
type BaseMapKnobValueOf<ID extends BaseMapKnobId> = KnobPlainValue<ValueAt<BaseMapModuleConfig, ID>>;
|
|
6257
|
+
/**
|
|
6258
|
+
* One entry of {@link baseMapKnobCatalogue}. The value in force is the one at its path in
|
|
6259
|
+
* {@link BaseMapModule.getConfig}; with none, the style decides.
|
|
6260
|
+
*
|
|
6261
|
+
* @group Base Map
|
|
6262
|
+
*/
|
|
6263
|
+
type BaseMapKnob = KnobEntry<BaseMapKnobId, 'toggle'>;
|
|
6264
|
+
//#endregion
|
|
6265
|
+
//#region src/base/knobCatalogue.d.ts
|
|
6266
|
+
/**
|
|
6267
|
+
* Every base-map knob with its kind and description: `visible`, then one toggle per layer group in
|
|
6268
|
+
* {@link baseMapLayerGroupNames} order. Static data, readable with no map loaded.
|
|
6269
|
+
*
|
|
6270
|
+
* @remarks
|
|
6271
|
+
* A knob is a plain display value in {@link BaseMapModuleConfig}, at the path its id names. None
|
|
6272
|
+
* carries a `default`: unset, a layer is drawn as the style ships it, and some groups ship hidden.
|
|
6273
|
+
*
|
|
6274
|
+
* The `basemap.<group>`, `buildings.footprints`, `buildings.3d` and `roads.shields`
|
|
6275
|
+
* {@link StylingModule} knobs toggle the same groups through this module. Not knobs: `events`.
|
|
6276
|
+
*
|
|
6277
|
+
* @group Base Map
|
|
6278
|
+
*/
|
|
6279
|
+
export declare const baseMapKnobCatalogue: readonly BaseMapKnob[];
|
|
6280
|
+
/**
|
|
6281
|
+
* Every base-map knob id, in catalogue order.
|
|
6282
|
+
*
|
|
6283
|
+
* @group Base Map
|
|
6284
|
+
*/
|
|
6285
|
+
export declare const baseMapKnobIds: readonly BaseMapKnobId[];
|
|
6286
|
+
//#endregion
|
|
6062
6287
|
//#region src/custom/types/customGeoJSONModuleConfig.d.ts
|
|
6063
6288
|
type DistributiveOmit<T, K extends string> = T extends unknown ? Omit<T, K> : never;
|
|
6064
6289
|
/**
|
|
@@ -6164,6 +6389,8 @@ export type CustomGeoJSONSourceSpec = {
|
|
|
6164
6389
|
* };
|
|
6165
6390
|
* ```
|
|
6166
6391
|
*
|
|
6392
|
+
* @see {@link CustomGeoJSONModuleSerializableConfig} for the part that survives JSON.
|
|
6393
|
+
*
|
|
6167
6394
|
* @group Custom
|
|
6168
6395
|
*/
|
|
6169
6396
|
export type CustomGeoJSONModuleConfig<TSources extends Record<string, FeatureCollection> = Record<string, FeatureCollection>> = MapModuleCommonConfig & {
|
|
@@ -6206,16 +6433,34 @@ export type CustomGeoJSONModuleConfig<TSources extends Record<string, FeatureCol
|
|
|
6206
6433
|
*/
|
|
6207
6434
|
images?: Record<string, CustomGeoJSONImageSpec>;
|
|
6208
6435
|
/**
|
|
6209
|
-
*
|
|
6436
|
+
* Whether the module draws anything: every layer of every source.
|
|
6210
6437
|
*
|
|
6211
6438
|
* @remarks
|
|
6212
|
-
*
|
|
6213
|
-
*
|
|
6214
|
-
*
|
|
6215
|
-
*
|
|
6439
|
+
* A shown source draws its layers while it holds features. `show()` and `clear()` never change
|
|
6440
|
+
* this — a hidden module keeps its data until {@link CustomGeoJSONModule.setVisible} shows it again.
|
|
6441
|
+
*
|
|
6442
|
+
* @default true
|
|
6216
6443
|
*/
|
|
6217
6444
|
visible?: boolean;
|
|
6218
6445
|
};
|
|
6446
|
+
/**
|
|
6447
|
+
* The part of a {@link CustomGeoJSONModuleConfig} that survives JSON, for saving
|
|
6448
|
+
* `getConfig()` and replaying it with `applyConfig()`.
|
|
6449
|
+
*
|
|
6450
|
+
* @remarks
|
|
6451
|
+
* It leaves out `images`: no {@link CustomGeoJSONImageData} survives JSON, so a replay passes them again.
|
|
6452
|
+
*
|
|
6453
|
+
* @example
|
|
6454
|
+
* ```typescript
|
|
6455
|
+
* const saved = JSON.stringify({ ...custom.getConfig(), images: undefined });
|
|
6456
|
+
*
|
|
6457
|
+
* const state: CustomGeoJSONModuleSerializableConfig = JSON.parse(saved);
|
|
6458
|
+
* custom.applyConfig({ ...state, images: markerImages });
|
|
6459
|
+
* ```
|
|
6460
|
+
*
|
|
6461
|
+
* @group Custom
|
|
6462
|
+
*/
|
|
6463
|
+
export type CustomGeoJSONModuleSerializableConfig<TSources extends Record<string, FeatureCollection> = Record<string, FeatureCollection>> = Omit<CustomGeoJSONModuleConfig<TSources>, 'images'>;
|
|
6219
6464
|
//#endregion
|
|
6220
6465
|
//#region src/custom/CustomGeoJSONModule.d.ts
|
|
6221
6466
|
type CustomGeoJSONSourcesWithLayers<TSources extends Record<string, FeatureCollection>> = { [K in keyof TSources]: GeoJSONSourceWithLayers<TSources[K]>; };
|
|
@@ -6252,6 +6497,7 @@ export type CustomGeoJSONEvents<TSources extends Record<string, FeatureCollectio
|
|
|
6252
6497
|
* Because the sources and layers are caller-supplied, the module has no built-in defaults:
|
|
6253
6498
|
* `resetConfig()` (or `applyConfig(undefined)`) returns to the configuration passed to
|
|
6254
6499
|
* {@link CustomGeoJSONModule.create | create}, and `getConfig()` never becomes `undefined`.
|
|
6500
|
+
* {@link customGeoJSONKnobCatalogue} lists the settings of its configuration a knob holds.
|
|
6255
6501
|
*
|
|
6256
6502
|
* @typeParam TSources - A record mapping source names to the {@link FeatureCollection}
|
|
6257
6503
|
* type each source carries. Pass this generic when you want type-safe `show` /
|
|
@@ -6338,7 +6584,8 @@ export declare class CustomGeoJSONModule<TSources extends Record<string, Feature
|
|
|
6338
6584
|
*/
|
|
6339
6585
|
protected _applyConfig(config: CustomGeoJSONModuleConfig<TSources> | undefined): CustomGeoJSONModuleConfig<TSources> | undefined;
|
|
6340
6586
|
private updateLayersForExistingSources;
|
|
6341
|
-
|
|
6587
|
+
/** @ignore */
|
|
6588
|
+
protected applyVisibility(config: CustomGeoJSONModuleConfig<TSources> | undefined): void;
|
|
6342
6589
|
/**
|
|
6343
6590
|
* @ignore
|
|
6344
6591
|
*/
|
|
@@ -6351,8 +6598,8 @@ export declare class CustomGeoJSONModule<TSources extends Record<string, Feature
|
|
|
6351
6598
|
* Displays the given GeoJSON data on the named source — or on every source when
|
|
6352
6599
|
* no name is supplied.
|
|
6353
6600
|
*
|
|
6354
|
-
* Replaces any previously shown data.
|
|
6355
|
-
*
|
|
6601
|
+
* Replaces any previously shown data. The source's layers draw while it holds features and
|
|
6602
|
+
* the module is visible ({@link CustomGeoJSONModuleConfig.visible}).
|
|
6356
6603
|
*
|
|
6357
6604
|
* @param data The GeoJSON feature collection to display.
|
|
6358
6605
|
* @param sourceName The source name (must match a key from
|
|
@@ -6373,15 +6620,6 @@ export declare class CustomGeoJSONModule<TSources extends Record<string, Feature
|
|
|
6373
6620
|
* feature collection that `GeoJSONSourceWithLayers` keeps as initial state.
|
|
6374
6621
|
*/
|
|
6375
6622
|
getShown(): { [K in keyof TSources]: TSources[K]; };
|
|
6376
|
-
/**
|
|
6377
|
-
* Toggles visibility of every layer across every source.
|
|
6378
|
-
*
|
|
6379
|
-
* @remarks
|
|
6380
|
-
* Calling {@link show} on a source after `setVisible(false)` will re-reveal that
|
|
6381
|
-
* source's layers via `GeoJSONSourceWithLayers`' automatic visibility behaviour.
|
|
6382
|
-
* To keep a source hidden, call `setVisible(false)` after the next `show`.
|
|
6383
|
-
*/
|
|
6384
|
-
setVisible(visible: boolean): void;
|
|
6385
6623
|
/**
|
|
6386
6624
|
* Per-source events surface.
|
|
6387
6625
|
*
|
|
@@ -6404,6 +6642,56 @@ export declare class CustomGeoJSONModule<TSources extends Record<string, Feature
|
|
|
6404
6642
|
get events(): CustomGeoJSONEvents<TSources>;
|
|
6405
6643
|
}
|
|
6406
6644
|
//#endregion
|
|
6645
|
+
//#region src/custom/types/customGeoJSONKnobs.d.ts
|
|
6646
|
+
/**
|
|
6647
|
+
* The id of a custom GeoJSON knob: its path into {@link CustomGeoJSONModuleConfig}. See
|
|
6648
|
+
* {@link customGeoJSONKnobCatalogue} for what each one does.
|
|
6649
|
+
*
|
|
6650
|
+
* @remarks
|
|
6651
|
+
* Every setting but `sources` and `images`, which hold the caller's own MapLibre layers, source
|
|
6652
|
+
* options and images rather than plain values.
|
|
6653
|
+
*
|
|
6654
|
+
* @group Custom
|
|
6655
|
+
*/
|
|
6656
|
+
type CustomGeoJSONKnobId = Exclude<keyof CustomGeoJSONModuleConfig, 'sources' | 'images' | keyof MapModuleCommonConfig>;
|
|
6657
|
+
/**
|
|
6658
|
+
* The value type a given custom GeoJSON knob takes: the plain value its path holds in
|
|
6659
|
+
* {@link CustomGeoJSONModuleConfig}.
|
|
6660
|
+
*
|
|
6661
|
+
* @group Custom
|
|
6662
|
+
*/
|
|
6663
|
+
type CustomGeoJSONKnobValueOf<ID extends CustomGeoJSONKnobId> = KnobPlainValue<ValueAt<CustomGeoJSONModuleConfig, ID>>;
|
|
6664
|
+
/**
|
|
6665
|
+
* One entry of {@link customGeoJSONKnobCatalogue}. The value in force is the one at its path in
|
|
6666
|
+
* {@link CustomGeoJSONModule.getConfig}, else its `default`.
|
|
6667
|
+
*
|
|
6668
|
+
* @group Custom
|
|
6669
|
+
*/
|
|
6670
|
+
type CustomGeoJSONKnob = KnobEntry<CustomGeoJSONKnobId, 'toggle'>;
|
|
6671
|
+
//#endregion
|
|
6672
|
+
//#region src/custom/knobCatalogue.d.ts
|
|
6673
|
+
/**
|
|
6674
|
+
* Every custom GeoJSON knob with its kind, description and default. Static data, readable with no
|
|
6675
|
+
* map loaded.
|
|
6676
|
+
*
|
|
6677
|
+
* @remarks
|
|
6678
|
+
* A knob is a plain display value in {@link CustomGeoJSONModuleConfig}, at the path its id names.
|
|
6679
|
+
* How the module draws is the caller's own MapLibre styling, so `visible` is the only one. Not knobs:
|
|
6680
|
+
* - each source's `layers`, raw MapLibre layer specs passed through untouched;
|
|
6681
|
+
* - each source's `cluster`, MapLibre source options forwarded verbatim and fixed at creation, and
|
|
6682
|
+
* its `sourceID`, a name;
|
|
6683
|
+
* - `images`, image payloads; and `events`.
|
|
6684
|
+
*
|
|
6685
|
+
* @group Custom
|
|
6686
|
+
*/
|
|
6687
|
+
export declare const customGeoJSONKnobCatalogue: readonly CustomGeoJSONKnob[];
|
|
6688
|
+
/**
|
|
6689
|
+
* Every custom GeoJSON knob id, in catalogue order.
|
|
6690
|
+
*
|
|
6691
|
+
* @group Custom
|
|
6692
|
+
*/
|
|
6693
|
+
export declare const customGeoJSONKnobIds: readonly CustomGeoJSONKnobId[];
|
|
6694
|
+
//#endregion
|
|
6407
6695
|
//#region src/geometry/layers/colorPalettes.d.ts
|
|
6408
6696
|
export declare const colorPalettes: {
|
|
6409
6697
|
warm: string[];
|
|
@@ -6461,8 +6749,8 @@ export declare const geometryFillStyles: readonly ["filled", "outline", "inverte
|
|
|
6461
6749
|
* // Solid color with opacity
|
|
6462
6750
|
* const fill: GeometryFillConfig = { color: '#FF5733', opacity: 0.3 };
|
|
6463
6751
|
*
|
|
6464
|
-
* //
|
|
6465
|
-
* const fill: GeometryFillConfig = {
|
|
6752
|
+
* // One colour per feature, in turn, from a palette
|
|
6753
|
+
* const fill: GeometryFillConfig = { palette: 'blues', opacity: 0.25 };
|
|
6466
6754
|
*
|
|
6467
6755
|
* // Data-driven color based on properties
|
|
6468
6756
|
* const fill: GeometryFillConfig = {
|
|
@@ -6475,15 +6763,23 @@ export declare const geometryFillStyles: readonly ["filled", "outline", "inverte
|
|
|
6475
6763
|
*/
|
|
6476
6764
|
export type GeometryFillConfig = {
|
|
6477
6765
|
/**
|
|
6478
|
-
* Fill color: a
|
|
6479
|
-
*
|
|
6766
|
+
* Fill color: a CSS colour string (`'#FF5733'`) or a MapLibre expression for data-driven styling
|
|
6767
|
+
* (e.g. `['get', 'color']`).
|
|
6480
6768
|
*
|
|
6481
6769
|
* @remarks
|
|
6482
|
-
* Overrides
|
|
6483
|
-
*
|
|
6484
|
-
* overrides it.
|
|
6770
|
+
* Overrides {@link GeometryFillConfig.palette | palette} and the top-level
|
|
6771
|
+
* {@link GeometriesModuleConfig.color}, for the fill and the border; the full order is on the latter.
|
|
6485
6772
|
*/
|
|
6486
|
-
color?:
|
|
6773
|
+
color?: string | ExpressionSpecification;
|
|
6774
|
+
/**
|
|
6775
|
+
* Named palette the features take their fill colours from, one per feature in turn
|
|
6776
|
+
* (see {@link colorPaletteIDs}). On dark map styles its colours are adapted to stay legible.
|
|
6777
|
+
*
|
|
6778
|
+
* @remarks
|
|
6779
|
+
* Overrides the top-level {@link GeometriesModuleConfig.color}, for the fill and the border; the
|
|
6780
|
+
* full order is on the latter.
|
|
6781
|
+
*/
|
|
6782
|
+
palette?: ColorPaletteOptions;
|
|
6487
6783
|
/**
|
|
6488
6784
|
* Fill opacity, 0 (transparent) to 1 (opaque). Also accepts a MapLibre expression.
|
|
6489
6785
|
*
|
|
@@ -6495,34 +6791,36 @@ export type GeometryFillConfig = {
|
|
|
6495
6791
|
* The label drawn at the center of each geometry: its text, and how it looks.
|
|
6496
6792
|
*
|
|
6497
6793
|
* @remarks
|
|
6498
|
-
* Unset
|
|
6499
|
-
* `'#333333'` text with a `'#FFFFFF'` halo on light map styles, the
|
|
6794
|
+
* Unset fields keep the defaults: the feature's `title` as text, size 15, bold font, and
|
|
6795
|
+
* theme-adaptive colours — `'#333333'` text with a `'#FFFFFF'` halo on light map styles, the
|
|
6796
|
+
* reverse on dark.
|
|
6500
6797
|
*
|
|
6501
6798
|
* @example
|
|
6502
6799
|
* ```typescript
|
|
6503
6800
|
* // Simple text
|
|
6504
|
-
* const label:
|
|
6801
|
+
* const label: GeometryLabelConfig = {
|
|
6505
6802
|
* text: ['get', 'name']
|
|
6506
6803
|
* };
|
|
6507
6804
|
*
|
|
6508
6805
|
* // Conditional text, larger and in white
|
|
6509
|
-
* const conditionalLabel:
|
|
6806
|
+
* const conditionalLabel: GeometryLabelConfig = {
|
|
6510
6807
|
* text: ['case', ['has', 'title'], ['get', 'title'], ['get', 'id']],
|
|
6511
6808
|
* size: 18,
|
|
6512
6809
|
* color: '#FFFFFF',
|
|
6513
6810
|
* haloColor: '#000000',
|
|
6514
6811
|
* };
|
|
6812
|
+
*
|
|
6813
|
+
* // The title, restyled
|
|
6814
|
+
* const largeLabel: GeometryLabelConfig = { size: 18 };
|
|
6515
6815
|
* ```
|
|
6516
6816
|
*
|
|
6517
6817
|
* @group Geometries
|
|
6518
6818
|
*/
|
|
6519
|
-
export type
|
|
6819
|
+
export type GeometryLabelConfig = LabelConfig & {
|
|
6520
6820
|
/**
|
|
6521
|
-
* Text
|
|
6821
|
+
* Text of the label: a string, or a MapLibre expression that evaluates to one.
|
|
6522
6822
|
*
|
|
6523
|
-
* @
|
|
6524
|
-
* Must be a MapLibre expression that evaluates to a string.
|
|
6525
|
-
* Labels are positioned at the geometry's center point.
|
|
6823
|
+
* @default ['get', 'title']
|
|
6526
6824
|
*
|
|
6527
6825
|
* @example
|
|
6528
6826
|
* ```typescript
|
|
@@ -6536,7 +6834,7 @@ export type GeometryLabel = LabelConfig & {
|
|
|
6536
6834
|
* text: ['case', ['has', 'label'], ['get', 'label'], '']
|
|
6537
6835
|
* ```
|
|
6538
6836
|
*/
|
|
6539
|
-
text
|
|
6837
|
+
text?: DataDrivenPropertyValueSpecification<string>;
|
|
6540
6838
|
};
|
|
6541
6839
|
/**
|
|
6542
6840
|
* Line/border configuration for geometries — the outline color, opacity, width, an escape hatch for
|
|
@@ -6567,8 +6865,9 @@ export type GeometryLineConfig = {
|
|
|
6567
6865
|
* Border/outline color: a hex string or a MapLibre expression (e.g. `['get', 'borderColor']`).
|
|
6568
6866
|
*
|
|
6569
6867
|
* @remarks
|
|
6570
|
-
* Overrides a feature's `color` property, {@link GeometryFillConfig.color | fill.color}
|
|
6571
|
-
*
|
|
6868
|
+
* Overrides a feature's `color` property, {@link GeometryFillConfig.color | fill.color},
|
|
6869
|
+
* {@link GeometryFillConfig.palette | fill.palette} and the top-level
|
|
6870
|
+
* {@link GeometriesModuleConfig.color} for the border.
|
|
6572
6871
|
*/
|
|
6573
6872
|
color?: DataDrivenPropertyValueSpecification<string>;
|
|
6574
6873
|
/**
|
|
@@ -6607,23 +6906,26 @@ export type GeometryLineConfig = {
|
|
|
6607
6906
|
layer?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
6608
6907
|
};
|
|
6609
6908
|
/**
|
|
6610
|
-
* Labels placed along the polygon border lines
|
|
6909
|
+
* Labels placed along the polygon border lines: the center label's fields, plus where along the
|
|
6910
|
+
* border they repeat.
|
|
6611
6911
|
*
|
|
6612
6912
|
* When set, a symbol layer is added to the geometry source.
|
|
6613
6913
|
*
|
|
6614
6914
|
* @remarks
|
|
6615
6915
|
* Defaults for the unset fields:
|
|
6616
|
-
* - `minZoom` 3, `size` 15, `haloWidth` 2, `symbolSpacing` 200,
|
|
6916
|
+
* - `text` the feature's `title`, `minZoom` 3, `size` 15, `haloWidth` 2, `symbolSpacing` 200,
|
|
6917
|
+
* `opacity` 1, `offset` `[0, 1]`, bold font.
|
|
6617
6918
|
* - `color` and `haloColor` are theme-adaptive: `'#333333'` text with a `'#FFFFFF'` halo on light map
|
|
6618
6919
|
* styles, the reverse on dark.
|
|
6619
6920
|
*
|
|
6620
6921
|
* @example
|
|
6621
6922
|
* ```typescript
|
|
6622
6923
|
* // Defaults
|
|
6623
|
-
* const lineLabel:
|
|
6924
|
+
* const lineLabel: GeometryLineLabelConfig = {};
|
|
6624
6925
|
*
|
|
6625
|
-
* // Custom appearance for dark fills
|
|
6626
|
-
* const lineLabel:
|
|
6926
|
+
* // Custom text and appearance for dark fills
|
|
6927
|
+
* const lineLabel: GeometryLineLabelConfig = {
|
|
6928
|
+
* text: ['get', 'name'],
|
|
6627
6929
|
* minZoom: 10,
|
|
6628
6930
|
* color: '#FFFFFF',
|
|
6629
6931
|
* haloColor: '#000000',
|
|
@@ -6633,7 +6935,7 @@ export type GeometryLineConfig = {
|
|
|
6633
6935
|
*
|
|
6634
6936
|
* @group Geometries
|
|
6635
6937
|
*/
|
|
6636
|
-
export type
|
|
6938
|
+
export type GeometryLineLabelConfig = GeometryLabelConfig & {
|
|
6637
6939
|
/**
|
|
6638
6940
|
* Minimum zoom level at which border labels are visible.
|
|
6639
6941
|
*
|
|
@@ -6728,6 +7030,8 @@ export type GeometryBeforeLayerConfig = PartsBeforeLayerConfig<'fill' | 'line'>;
|
|
|
6728
7030
|
* };
|
|
6729
7031
|
* ```
|
|
6730
7032
|
*
|
|
7033
|
+
* @see {@link GeometriesModuleSerializableConfig} for the part that survives JSON.
|
|
7034
|
+
*
|
|
6731
7035
|
* @group Geometries
|
|
6732
7036
|
*/
|
|
6733
7037
|
export type GeometriesModuleConfig = MapModuleCommonConfig & {
|
|
@@ -6736,9 +7040,10 @@ export type GeometriesModuleConfig = MapModuleCommonConfig & {
|
|
|
6736
7040
|
*
|
|
6737
7041
|
* @remarks
|
|
6738
7042
|
* Precedence, highest first:
|
|
6739
|
-
* - Fill: a feature's own `color` property, {@link GeometryFillConfig.color | fill.color},
|
|
7043
|
+
* - Fill: a feature's own `color` property, {@link GeometryFillConfig.color | fill.color},
|
|
7044
|
+
* {@link GeometryFillConfig.palette | fill.palette}, this field.
|
|
6740
7045
|
* - Border: {@link GeometryLineConfig.color | line.color}, a feature's own `color` property, `fill.color`,
|
|
6741
|
-
* this field.
|
|
7046
|
+
* `fill.palette`, this field.
|
|
6742
7047
|
* - Then, for both: the map's accent when a theme sets one ({@link TomTomMap.mapColors}), else a
|
|
6743
7048
|
* theme-adaptive default — `'#0A3653'` on light map styles, `'#5FA8D8'` on dark (custom styles count as light).
|
|
6744
7049
|
*
|
|
@@ -6765,7 +7070,7 @@ export type GeometriesModuleConfig = MapModuleCommonConfig & {
|
|
|
6765
7070
|
/**
|
|
6766
7071
|
* The label at each geometry's center: its text and styling.
|
|
6767
7072
|
*/
|
|
6768
|
-
label?:
|
|
7073
|
+
label?: GeometryLabelConfig;
|
|
6769
7074
|
/**
|
|
6770
7075
|
* Border/outline configuration.
|
|
6771
7076
|
*
|
|
@@ -6794,7 +7099,7 @@ export type GeometriesModuleConfig = MapModuleCommonConfig & {
|
|
|
6794
7099
|
/**
|
|
6795
7100
|
* Labels along the polygon border lines, drawn only when this is set (`{}` for the defaults).
|
|
6796
7101
|
*/
|
|
6797
|
-
lineLabel?:
|
|
7102
|
+
lineLabel?: GeometryLineLabelConfig;
|
|
6798
7103
|
/**
|
|
6799
7104
|
* How every feature shown by this module is filled.
|
|
6800
7105
|
*
|
|
@@ -6843,6 +7148,24 @@ export type GeometriesModuleConfig = MapModuleCommonConfig & {
|
|
|
6843
7148
|
*/
|
|
6844
7149
|
transformFeaturesForDisplay?: (input: PolygonFeatures) => PolygonFeatures;
|
|
6845
7150
|
};
|
|
7151
|
+
/**
|
|
7152
|
+
* The part of a {@link GeometriesModuleConfig} that survives JSON, for saving
|
|
7153
|
+
* `getConfig()` and replaying it with `applyConfig()`.
|
|
7154
|
+
*
|
|
7155
|
+
* @remarks
|
|
7156
|
+
* It leaves out `transformFeaturesForDisplay`, a function, which a replay adds back in code.
|
|
7157
|
+
*
|
|
7158
|
+
* @example
|
|
7159
|
+
* ```typescript
|
|
7160
|
+
* const saved = JSON.stringify(geometries.getConfig());
|
|
7161
|
+
*
|
|
7162
|
+
* const state: GeometriesModuleSerializableConfig = JSON.parse(saved);
|
|
7163
|
+
* geometries.applyConfig({ ...state, transformFeaturesForDisplay: addAreaLabels });
|
|
7164
|
+
* ```
|
|
7165
|
+
*
|
|
7166
|
+
* @group Geometries
|
|
7167
|
+
*/
|
|
7168
|
+
export type GeometriesModuleSerializableConfig = Omit<GeometriesModuleConfig, 'transformFeaturesForDisplay'>;
|
|
6846
7169
|
//#endregion
|
|
6847
7170
|
//#region src/geometry/GeometriesModule.d.ts
|
|
6848
7171
|
/**
|
|
@@ -7051,7 +7374,8 @@ export declare class GeometriesModule extends AbstractDataOwnedMapModule<Geometr
|
|
|
7051
7374
|
* @ignore
|
|
7052
7375
|
*/
|
|
7053
7376
|
protected _applyConfig(config: GeometriesModuleConfig | undefined): GeometriesModuleConfig | undefined;
|
|
7054
|
-
|
|
7377
|
+
/** @ignore */
|
|
7378
|
+
protected applyVisibility(config: GeometriesModuleConfig | undefined): void;
|
|
7055
7379
|
private get partLayerIDs();
|
|
7056
7380
|
/**
|
|
7057
7381
|
* Positions the geometry layers relative to other map layers.
|
|
@@ -7072,26 +7396,6 @@ export declare class GeometriesModule extends AbstractDataOwnedMapModule<Geometr
|
|
|
7072
7396
|
* ```
|
|
7073
7397
|
*/
|
|
7074
7398
|
moveBeforeLayer(layerConfig: GeometryBeforeLayerConfig): void;
|
|
7075
|
-
/**
|
|
7076
|
-
* Shows or hides everything the module draws: fills, borders, center labels and border labels.
|
|
7077
|
-
*
|
|
7078
|
-
* @remarks
|
|
7079
|
-
* `show()` and `clear()` never change it: a hidden module keeps its data and draws it again on
|
|
7080
|
-
* `setVisible(true)`.
|
|
7081
|
-
*
|
|
7082
|
-
* @example
|
|
7083
|
-
* ```typescript
|
|
7084
|
-
* geometries.setVisible(false);
|
|
7085
|
-
* await geometries.show(areas); // stays hidden
|
|
7086
|
-
* geometries.setVisible(true);
|
|
7087
|
-
* ```
|
|
7088
|
-
*/
|
|
7089
|
-
setVisible(visible: boolean): void;
|
|
7090
|
-
/**
|
|
7091
|
-
* Whether the module is set to be shown ({@link GeometriesModuleConfig.visible}). A shown module
|
|
7092
|
-
* with no geometries draws nothing.
|
|
7093
|
-
*/
|
|
7094
|
-
isVisible(): boolean;
|
|
7095
7399
|
private applyBeforeLayerConfig;
|
|
7096
7400
|
/**
|
|
7097
7401
|
* Updates the label at the center of each displayed geometry: its text and styling.
|
|
@@ -7100,19 +7404,19 @@ export declare class GeometriesModule extends AbstractDataOwnedMapModule<Geometr
|
|
|
7100
7404
|
*
|
|
7101
7405
|
* @remarks
|
|
7102
7406
|
* **Configuration:**
|
|
7103
|
-
* - `text`: MapLibre expression
|
|
7407
|
+
* - `text`: label text, a string or a MapLibre expression; the feature's `title` when unset
|
|
7104
7408
|
* - `size`, `color`, `haloColor`, `haloWidth`, `opacity`, `font`: label styling
|
|
7105
7409
|
* - Changes apply to currently shown and future geometries
|
|
7106
7410
|
*
|
|
7107
7411
|
* @example
|
|
7108
7412
|
* ```typescript
|
|
7109
7413
|
* // Show feature property as label
|
|
7110
|
-
* geometries.
|
|
7414
|
+
* geometries.applyLabelConfig({
|
|
7111
7415
|
* text: ['get', 'name']
|
|
7112
7416
|
* });
|
|
7113
7417
|
*
|
|
7114
7418
|
* // Conditional labels, in white
|
|
7115
|
-
* geometries.
|
|
7419
|
+
* geometries.applyLabelConfig({
|
|
7116
7420
|
* text: [
|
|
7117
7421
|
* 'case',
|
|
7118
7422
|
* ['has', 'label'],
|
|
@@ -7123,16 +7427,14 @@ export declare class GeometriesModule extends AbstractDataOwnedMapModule<Geometr
|
|
|
7123
7427
|
* });
|
|
7124
7428
|
* ```
|
|
7125
7429
|
*/
|
|
7126
|
-
|
|
7127
|
-
private
|
|
7430
|
+
applyLabelConfig(label: GeometryLabelConfig): void;
|
|
7431
|
+
private updateLayers;
|
|
7128
7432
|
/**
|
|
7129
7433
|
* @ignore
|
|
7130
7434
|
*/
|
|
7131
7435
|
protected discardShownData(): void;
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
*/
|
|
7135
|
-
protected restoreDataAndConfigImpl(): void;
|
|
7436
|
+
private prepare;
|
|
7437
|
+
private display;
|
|
7136
7438
|
/**
|
|
7137
7439
|
* Displays the given polygon geometries on the map.
|
|
7138
7440
|
*
|
|
@@ -7274,97 +7576,191 @@ export declare class GeometriesModule extends AbstractDataOwnedMapModule<Geometr
|
|
|
7274
7576
|
get events(): GeometriesEvents;
|
|
7275
7577
|
}
|
|
7276
7578
|
//#endregion
|
|
7277
|
-
//#region src/geometry/
|
|
7278
|
-
/** Custom label generator for reachable range features. */
|
|
7279
|
-
export type ReachableRangeLabelFn = (feature: PolygonFeature, index: number) => string;
|
|
7579
|
+
//#region src/geometry/types/geometryConfigOptions.d.ts
|
|
7280
7580
|
/**
|
|
7281
|
-
*
|
|
7282
|
-
*
|
|
7283
|
-
* Features must be ordered **largest budget first** (e.g. 30 min, 20 min, 10 min).
|
|
7284
|
-
* For the `inverted` fill style, polygons are converted to donuts and one extra innermost feature is appended.
|
|
7285
|
-
*
|
|
7286
|
-
* @param features Polygon features from `calculateReachableRange`, ordered largest budget first.
|
|
7287
|
-
* @param labels Label per feature in matching order (e.g. `['30 min', '20 min', '10 min']`).
|
|
7288
|
-
* @param fillStyle Fill style. Defaults to `'filled'`.
|
|
7289
|
-
*
|
|
7290
|
-
* @example
|
|
7291
|
-
* ```typescript
|
|
7292
|
-
* const features = [range30min, range20min, range10min];
|
|
7293
|
-
* const labels = ['30 min', '20 min', '10 min'];
|
|
7294
|
-
*
|
|
7295
|
-
* module.show({
|
|
7296
|
-
* type: 'FeatureCollection',
|
|
7297
|
-
* features: buildReachableRangeFeatures(features, labels, 'inverted'),
|
|
7298
|
-
* });
|
|
7299
|
-
* ```
|
|
7581
|
+
* Custom title generator for reachable range features: the text of each range's labels.
|
|
7300
7582
|
*
|
|
7301
7583
|
* @group Geometries
|
|
7302
7584
|
*/
|
|
7303
|
-
export
|
|
7585
|
+
export type ReachableRangeTitleFn = (feature: PolygonFeature, index: number) => string;
|
|
7304
7586
|
/**
|
|
7305
|
-
*
|
|
7306
|
-
*
|
|
7307
|
-
* Derives labels from each feature's `budget` property by default, applies fill-style-specific
|
|
7308
|
-
* geometry, and preserves the bounding box. Pass the returned value directly to `module.show()`.
|
|
7309
|
-
*
|
|
7310
|
-
* Note: when using {@link reachableRangeGeometryConfig} this is called automatically — you only
|
|
7311
|
-
* need this function for explicit control over labels or fill style.
|
|
7312
|
-
*
|
|
7313
|
-
* Features must be ordered **largest budget first** (e.g. 30 min, 20 min, 10 min).
|
|
7314
|
-
*
|
|
7315
|
-
* @param result Raw output of `calculateReachableRanges`.
|
|
7316
|
-
* @param fillStyle Fill style. Defaults to `'filled'`.
|
|
7317
|
-
* @param label Custom label generator; when omitted, labels derived from `budget` property.
|
|
7318
|
-
*
|
|
7319
|
-
* @example
|
|
7320
|
-
* ```typescript
|
|
7321
|
-
* // explicit control:
|
|
7322
|
-
* module.show(prepareReachableRangesForDisplay(result, 'inverted'));
|
|
7323
|
-
* module.show(prepareReachableRangesForDisplay(result, 'filled', (f) => myLabel(f)));
|
|
7324
|
-
* ```
|
|
7587
|
+
* Options of {@link prepareReachableRangesForDisplay}.
|
|
7325
7588
|
*
|
|
7326
7589
|
* @group Geometries
|
|
7327
7590
|
*/
|
|
7328
|
-
export
|
|
7329
|
-
|
|
7330
|
-
|
|
7591
|
+
export type ReachableRangesDisplayOptions = {
|
|
7592
|
+
/**
|
|
7593
|
+
* How each range is filled.
|
|
7594
|
+
*
|
|
7595
|
+
* @default 'filled'
|
|
7596
|
+
*/
|
|
7597
|
+
fillStyle?: GeometryFillStyle;
|
|
7598
|
+
/**
|
|
7599
|
+
* Each range's title, shown by its labels. Unset, it is the feature's `budget`, e.g. `'30 min'`.
|
|
7600
|
+
*/
|
|
7601
|
+
title?: ReachableRangeTitleFn;
|
|
7602
|
+
};
|
|
7331
7603
|
/**
|
|
7332
|
-
*
|
|
7333
|
-
*
|
|
7334
|
-
* Includes data-driven expressions so each feature's `fillStyle` property controls its
|
|
7335
|
-
* styling, line labels config, and positions layers below map labels.
|
|
7336
|
-
*
|
|
7337
|
-
* For reachable ranges, use {@link reachableRangeGeometryConfig} which extends this
|
|
7338
|
-
* with auto-generated labels.
|
|
7339
|
-
*
|
|
7340
|
-
* @param palette Color palette for polygon fills. Defaults to `'fadedRainbow'`.
|
|
7341
|
-
* @param beforeLayerConfig Layer positioning. Defaults to `'lowestLabel'`.
|
|
7604
|
+
* Options of {@link fillStyledGeometryConfig}.
|
|
7342
7605
|
*
|
|
7343
7606
|
* @group Geometries
|
|
7344
7607
|
*/
|
|
7345
|
-
export
|
|
7608
|
+
export type FillStyledGeometryConfigOptions = {
|
|
7609
|
+
/**
|
|
7610
|
+
* Color palette for polygon fills.
|
|
7611
|
+
*
|
|
7612
|
+
* @default 'fadedRainbow'
|
|
7613
|
+
*/
|
|
7614
|
+
palette?: ColorPaletteOptions;
|
|
7615
|
+
/**
|
|
7616
|
+
* Layer positioning.
|
|
7617
|
+
*
|
|
7618
|
+
* @default 'lowestLabel'
|
|
7619
|
+
*/
|
|
7620
|
+
beforeLayerConfig?: GeometryBeforeLayerConfig;
|
|
7621
|
+
};
|
|
7622
|
+
/**
|
|
7623
|
+
* Options of {@link reachableRangeGeometryConfig}: the palette and positioning of
|
|
7624
|
+
* {@link fillStyledGeometryConfig}, and how {@link prepareReachableRangesForDisplay} fills and titles
|
|
7625
|
+
* each range.
|
|
7626
|
+
*
|
|
7627
|
+
* @group Geometries
|
|
7628
|
+
*/
|
|
7629
|
+
export type ReachableRangeGeometryConfigOptions = FillStyledGeometryConfigOptions & ReachableRangesDisplayOptions;
|
|
7630
|
+
//#endregion
|
|
7631
|
+
//#region src/geometry/geometryConfigs.d.ts
|
|
7632
|
+
/**
|
|
7633
|
+
* Config that draws each polygon by its own fill style, with palette-based coloring.
|
|
7634
|
+
*
|
|
7635
|
+
* Includes data-driven expressions so each feature's `fillStyle` property controls its
|
|
7636
|
+
* styling, line labels config, and positions layers below map labels.
|
|
7637
|
+
*
|
|
7638
|
+
* For reachable ranges, use {@link reachableRangeGeometryConfig} which extends this
|
|
7639
|
+
* with auto-generated labels.
|
|
7640
|
+
*
|
|
7641
|
+
* @example
|
|
7642
|
+
* ```typescript
|
|
7643
|
+
* const zones = await GeometriesModule.create(map, fillStyledGeometryConfig({ palette: 'retro' }));
|
|
7644
|
+
* ```
|
|
7645
|
+
*
|
|
7646
|
+
* @group Geometries
|
|
7647
|
+
*/
|
|
7648
|
+
export declare const fillStyledGeometryConfig: ({ palette, beforeLayerConfig }?: FillStyledGeometryConfigOptions) => GeometriesModuleConfig;
|
|
7346
7649
|
/**
|
|
7347
7650
|
* Returns a {@link GeometriesModuleConfig} for reachable ranges.
|
|
7348
7651
|
*
|
|
7349
7652
|
* Builds on {@link fillStyledGeometryConfig} and overrides `transformFeaturesForDisplay` so the
|
|
7350
7653
|
* raw output of `calculateReachableRanges` can be passed directly to {@link GeometriesModule.show}
|
|
7351
|
-
* —
|
|
7352
|
-
*
|
|
7353
|
-
* @param palette Color palette. Defaults to `'fadedRainbow'`.
|
|
7354
|
-
* @param fillStyle Fill style. Defaults to `'filled'`.
|
|
7355
|
-
* @param beforeLayerConfig Layer positioning. Defaults to `'lowestLabel'`.
|
|
7356
|
-
* @param label Custom label generator; when omitted, labels are derived from `budget` property.
|
|
7654
|
+
* — titles are derived from each feature's `budget` property.
|
|
7357
7655
|
*
|
|
7358
7656
|
* @example
|
|
7359
7657
|
* ```typescript
|
|
7360
7658
|
* const module = await GeometriesModule.create(map, reachableRangeGeometryConfig());
|
|
7361
7659
|
* const result = await calculateReachableRanges([...]);
|
|
7362
|
-
* module.show(result); //
|
|
7660
|
+
* module.show(result); // titles and fill style applied automatically
|
|
7661
|
+
*
|
|
7662
|
+
* module.applyConfig(reachableRangeGeometryConfig({ palette: 'cold', fillStyle: 'inverted' }));
|
|
7663
|
+
* ```
|
|
7664
|
+
*
|
|
7665
|
+
* @group Geometries
|
|
7666
|
+
*/
|
|
7667
|
+
export declare const reachableRangeGeometryConfig: ({ palette, beforeLayerConfig, fillStyle, title }?: ReachableRangeGeometryConfigOptions) => GeometriesModuleConfig;
|
|
7668
|
+
//#endregion
|
|
7669
|
+
//#region src/geometry/types/geometriesKnobs.d.ts
|
|
7670
|
+
/**
|
|
7671
|
+
* The id of a geometries knob: its path into {@link GeometriesModuleConfig}, e.g. `fill.opacity` or
|
|
7672
|
+
* `lineLabel.minZoom`. See {@link geometriesKnobCatalogue} for what each one does.
|
|
7673
|
+
*
|
|
7674
|
+
* @group Geometries
|
|
7675
|
+
*/
|
|
7676
|
+
type GeometriesKnobId = 'color' | 'visible' | 'fillStyle' | `fill.${keyof GeometryFillConfig}` | `line.${Exclude<keyof GeometryLineConfig, 'layer'>}` | `label.${Exclude<keyof GeometryLabelConfig, 'text'>}` | `lineLabel.${Exclude<keyof GeometryLineLabelConfig, 'text'>}`;
|
|
7677
|
+
/**
|
|
7678
|
+
* The value type a given geometries knob takes: the plain value its path holds in
|
|
7679
|
+
* {@link GeometriesModuleConfig}. The MapLibre expressions the config also takes there are not knob
|
|
7680
|
+
* values.
|
|
7681
|
+
*
|
|
7682
|
+
* @group Geometries
|
|
7683
|
+
*/
|
|
7684
|
+
type GeometriesKnobValueOf<ID extends GeometriesKnobId> = KnobPlainValue<ValueAt<GeometriesModuleConfig, ID>>;
|
|
7685
|
+
/**
|
|
7686
|
+
* One entry of {@link geometriesKnobCatalogue}. The value in force is the one at its path in
|
|
7687
|
+
* {@link GeometriesModule.getConfig}, else its `default`; with neither, the map style, the accent
|
|
7688
|
+
* or the fill style decides.
|
|
7689
|
+
*
|
|
7690
|
+
* @group Geometries
|
|
7691
|
+
*/
|
|
7692
|
+
type GeometriesKnob = KnobEntry<GeometriesKnobId, Exclude<KnobKind, 'colors'>>;
|
|
7693
|
+
//#endregion
|
|
7694
|
+
//#region src/geometry/knobCatalogue.d.ts
|
|
7695
|
+
/**
|
|
7696
|
+
* Every geometries knob with its kind, description, range or options and, where one value holds
|
|
7697
|
+
* everywhere, its default: the module-wide knobs, the fill and border, then the center and border
|
|
7698
|
+
* labels. Static data, readable with no map loaded.
|
|
7699
|
+
*
|
|
7700
|
+
* @remarks
|
|
7701
|
+
* A knob is a plain display value in {@link GeometriesModuleConfig}, at the path its id names. Not
|
|
7702
|
+
* knobs: `beforeLayerConfig`, `line.layer`, the labels' `text` and `transformFeaturesForDisplay`,
|
|
7703
|
+
* which take structured, MapLibre or function values; and `events`.
|
|
7704
|
+
* Setting any `lineLabel` knob draws the border labels.
|
|
7705
|
+
*
|
|
7706
|
+
* @group Geometries
|
|
7707
|
+
*/
|
|
7708
|
+
export declare const geometriesKnobCatalogue: readonly GeometriesKnob[];
|
|
7709
|
+
/**
|
|
7710
|
+
* Every geometries knob id, in catalogue order.
|
|
7711
|
+
*
|
|
7712
|
+
* @group Geometries
|
|
7713
|
+
*/
|
|
7714
|
+
export declare const geometriesKnobIds: readonly GeometriesKnobId[];
|
|
7715
|
+
//#endregion
|
|
7716
|
+
//#region src/geometry/prepareReachableRangesForDisplay.d.ts
|
|
7717
|
+
/**
|
|
7718
|
+
* Attaches labels and applies fill-style-specific geometry to reachable range polygon features.
|
|
7719
|
+
*
|
|
7720
|
+
* Features must be ordered **largest budget first** (e.g. 30 min, 20 min, 10 min).
|
|
7721
|
+
* For the `inverted` fill style, polygons are converted to donuts and one extra innermost feature is appended.
|
|
7722
|
+
*
|
|
7723
|
+
* @param features Polygon features from `calculateReachableRange`, ordered largest budget first.
|
|
7724
|
+
* @param labels Label per feature in matching order (e.g. `['30 min', '20 min', '10 min']`).
|
|
7725
|
+
* @param fillStyle Fill style. Defaults to `'filled'`.
|
|
7726
|
+
*
|
|
7727
|
+
* @example
|
|
7728
|
+
* ```typescript
|
|
7729
|
+
* const features = [range30min, range20min, range10min];
|
|
7730
|
+
* const labels = ['30 min', '20 min', '10 min'];
|
|
7731
|
+
*
|
|
7732
|
+
* module.show({
|
|
7733
|
+
* type: 'FeatureCollection',
|
|
7734
|
+
* features: buildReachableRangeFeatures(features, labels, 'inverted'),
|
|
7735
|
+
* });
|
|
7736
|
+
* ```
|
|
7737
|
+
*
|
|
7738
|
+
* @group Geometries
|
|
7739
|
+
*/
|
|
7740
|
+
export declare const buildReachableRangeFeatures: (features: PolygonFeature[], labels: string[], fillStyle?: GeometryFillStyle) => PolygonFeature[];
|
|
7741
|
+
/**
|
|
7742
|
+
* Prepares the output of `calculateReachableRanges` for display with {@link GeometriesModule}.
|
|
7743
|
+
*
|
|
7744
|
+
* Derives titles from each feature's `budget` property by default, applies fill-style-specific
|
|
7745
|
+
* geometry, and preserves the bounding box. Pass the returned value directly to `module.show()`.
|
|
7746
|
+
*
|
|
7747
|
+
* Note: when using {@link reachableRangeGeometryConfig} this is called automatically — you only
|
|
7748
|
+
* need this function for explicit control over titles or fill style.
|
|
7749
|
+
*
|
|
7750
|
+
* Features must be ordered **largest budget first** (e.g. 30 min, 20 min, 10 min).
|
|
7751
|
+
*
|
|
7752
|
+
* @param result Raw output of `calculateReachableRanges`.
|
|
7753
|
+
*
|
|
7754
|
+
* @example
|
|
7755
|
+
* ```typescript
|
|
7756
|
+
* // explicit control:
|
|
7757
|
+
* module.show(prepareReachableRangesForDisplay(result, { fillStyle: 'inverted' }));
|
|
7758
|
+
* module.show(prepareReachableRangesForDisplay(result, { title: (feature) => myTitle(feature) }));
|
|
7363
7759
|
* ```
|
|
7364
7760
|
*
|
|
7365
7761
|
* @group Geometries
|
|
7366
7762
|
*/
|
|
7367
|
-
export declare const
|
|
7763
|
+
export declare const prepareReachableRangesForDisplay: (result: PolygonFeatures, { fillStyle, title }?: ReachableRangesDisplayOptions) => PolygonFeatures;
|
|
7368
7764
|
//#endregion
|
|
7369
7765
|
//#region src/geometry/types/geometryDisplayProps.d.ts
|
|
7370
7766
|
/**
|
|
@@ -7529,322 +7925,130 @@ export declare const baseMapPOICategoryValues: readonly string[];
|
|
|
7529
7925
|
*/
|
|
7530
7926
|
export declare const toBaseMapPOIGroup: (category: POICategory) => string | undefined;
|
|
7531
7927
|
//#endregion
|
|
7532
|
-
//#region src/places/types/
|
|
7928
|
+
//#region src/places/types/placesModuleConfig.d.ts
|
|
7533
7929
|
/**
|
|
7534
|
-
*
|
|
7930
|
+
* The kind of marker places are drawn with.
|
|
7535
7931
|
*
|
|
7536
7932
|
* @remarks
|
|
7537
|
-
*
|
|
7538
|
-
*
|
|
7539
|
-
*
|
|
7933
|
+
* - `pin`: Traditional map pin markers (teardrop shape)
|
|
7934
|
+
* - `circle-icon`: Simple circular markers
|
|
7935
|
+
* - `base-map`: Mimics the map's built-in POI layer style with category icons (combines `main`, `selected`, and `micro` layers). For micro-only rendering, hide the `main` layer via `layers.main.layout.visibility = 'none'`.
|
|
7936
|
+
* - `pin-clustered`: Same teardrop pins as `pin` for un-clustered places, with nearby
|
|
7937
|
+
* places aggregated into a single icon. Single-category clusters render the matching
|
|
7938
|
+
* base-map POI sprite with a small count badge in the top-right; mixed-category
|
|
7939
|
+
* clusters render a larger centred count circle in place of the icon. Cluster features
|
|
7940
|
+
* expose `clusterBaseMapIconIDs` (comma-separated, deduplicated) on their properties.
|
|
7941
|
+
* {@link PlacesModuleConfig.cluster} configures both.
|
|
7540
7942
|
*
|
|
7541
|
-
*
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
*
|
|
7546
|
-
*
|
|
7547
|
-
*
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7943
|
+
* @group Places
|
|
7944
|
+
*/
|
|
7945
|
+
type PlacesMarkerType = (typeof placesMarkerTypes)[number];
|
|
7946
|
+
/**
|
|
7947
|
+
* All valid {@link PlacesMarkerType} values.
|
|
7948
|
+
*
|
|
7949
|
+
* @group Places
|
|
7950
|
+
*/
|
|
7951
|
+
export declare const placesMarkerTypes: readonly ["pin", "circle-icon", "base-map", "pin-clustered"];
|
|
7952
|
+
/**
|
|
7953
|
+
* Configuration for EV charging station availability display.
|
|
7954
|
+
*
|
|
7955
|
+
* @remarks
|
|
7956
|
+
* **Opt-In Feature:**
|
|
7957
|
+
* - Disabled by default - set `enabled: true` to activate
|
|
7958
|
+
* - Requires fetching availability via {@link getPlacesWithEVAvailability}
|
|
7959
|
+
* - Each PlacesModule can enable/disable independently
|
|
7960
|
+
*
|
|
7961
|
+
* When enabled, displays formatted availability text (e.g., "3/10") below the station name
|
|
7962
|
+
* with color-coding based on availability ratio: green (high), orange (limited), red (none/low).
|
|
7551
7963
|
*
|
|
7552
7964
|
* @example
|
|
7553
7965
|
* ```typescript
|
|
7554
|
-
*
|
|
7555
|
-
*
|
|
7556
|
-
*
|
|
7557
|
-
*
|
|
7558
|
-
* };
|
|
7966
|
+
* // Enable with defaults
|
|
7967
|
+
* const places = await PlacesModule.create(map, {
|
|
7968
|
+
* evAvailability: { enabled: true }
|
|
7969
|
+
* });
|
|
7970
|
+
* const stations = await discoverPlaces({ filters: { poiCategories: ['CHARGING_LOCATION'] } });
|
|
7971
|
+
* places.show(await getPlacesWithEVAvailability(stations));
|
|
7559
7972
|
*
|
|
7560
|
-
*
|
|
7561
|
-
*
|
|
7562
|
-
*
|
|
7563
|
-
*
|
|
7564
|
-
*
|
|
7565
|
-
*
|
|
7566
|
-
*
|
|
7973
|
+
* // Custom threshold and format
|
|
7974
|
+
* const places = await PlacesModule.create(map, {
|
|
7975
|
+
* evAvailability: {
|
|
7976
|
+
* enabled: true,
|
|
7977
|
+
* threshold: 0.5,
|
|
7978
|
+
* formatText: (available, total) => `${available} of ${total}`
|
|
7979
|
+
* }
|
|
7980
|
+
* });
|
|
7981
|
+
*
|
|
7982
|
+
* // Combine with custom icon
|
|
7983
|
+
* const places = await PlacesModule.create(map, {
|
|
7984
|
+
* icon: {
|
|
7985
|
+
* categoryIcons: [{
|
|
7986
|
+
* id: 'CHARGING_LOCATION',
|
|
7987
|
+
* image: customEvIconSvg,
|
|
7988
|
+
* pixelRatio: 2
|
|
7989
|
+
* }]
|
|
7990
|
+
* },
|
|
7991
|
+
* evAvailability: { enabled: true }
|
|
7992
|
+
* });
|
|
7567
7993
|
* ```
|
|
7568
7994
|
*
|
|
7569
7995
|
* @group Places
|
|
7570
7996
|
*/
|
|
7571
|
-
|
|
7997
|
+
type EVAvailabilityConfig = {
|
|
7572
7998
|
/**
|
|
7573
|
-
*
|
|
7999
|
+
* Enable or disable EV availability display.
|
|
7574
8000
|
*
|
|
7575
8001
|
* @remarks
|
|
7576
|
-
*
|
|
7577
|
-
* fly or promote the one from `properties.id` via the source's `promoteId`
|
|
7578
|
-
* option. Used for feature identification in events, hit-testing, and data
|
|
7579
|
-
* updates.
|
|
7580
|
-
*
|
|
7581
|
-
* @example
|
|
7582
|
-
* ```typescript
|
|
7583
|
-
* id: 'place-123'
|
|
7584
|
-
* ```
|
|
8002
|
+
* Must be explicitly set to `true` to display availability.
|
|
7585
8003
|
*/
|
|
7586
|
-
|
|
8004
|
+
enabled?: boolean;
|
|
7587
8005
|
/**
|
|
7588
|
-
*
|
|
8006
|
+
* Availability ratio threshold for determining available vs occupied.
|
|
7589
8007
|
*
|
|
7590
8008
|
* @remarks
|
|
7591
|
-
*
|
|
7592
|
-
*
|
|
7593
|
-
* via `PlacesModuleConfig.text.title`).
|
|
8009
|
+
* - `ratio >= threshold`: Available (green)
|
|
8010
|
+
* - `ratio < threshold`: Occupied (red)
|
|
7594
8011
|
*
|
|
7595
|
-
* @
|
|
7596
|
-
* ```typescript
|
|
7597
|
-
* title: 'Amsterdam Central Station'
|
|
7598
|
-
* ```
|
|
8012
|
+
* @default 0.3
|
|
7599
8013
|
*/
|
|
7600
|
-
|
|
8014
|
+
threshold?: number;
|
|
7601
8015
|
/**
|
|
7602
|
-
*
|
|
8016
|
+
* Custom function to format the availability text.
|
|
7603
8017
|
*
|
|
7604
|
-
* @
|
|
7605
|
-
*
|
|
7606
|
-
*
|
|
7607
|
-
* the style's group-driven expression verbatim and ignores this value. The
|
|
7608
|
-
* sprite name is resolved per theme: `pin` picks a POI category image of the
|
|
7609
|
-
* `pinCategories` sprite, so its ID carries that sprite's namespace;
|
|
7610
|
-
* `circle-icon` and `base-map` pick the base map's `poi-<category>` image; a
|
|
7611
|
-
* custom `PlaceIconConfig.categoryIcons` entry overrides the default for the
|
|
7612
|
-
* main layer on any theme.
|
|
8018
|
+
* @param available - Number of available charging points
|
|
8019
|
+
* @param total - Total number of charging points
|
|
8020
|
+
* @returns Formatted availability text
|
|
7613
8021
|
*
|
|
7614
|
-
* @
|
|
7615
|
-
* ```typescript
|
|
7616
|
-
* iconID: 'pinCategories:7315' // pin theme sprite
|
|
7617
|
-
* iconID: 'poi-restaurant' // circle-icon / base-map theme sprite
|
|
7618
|
-
* iconID: 'custom-marker-0' // user-provided custom icon
|
|
7619
|
-
* ```
|
|
8022
|
+
* @default (available, total) => `${available}/${total}`
|
|
7620
8023
|
*/
|
|
7621
|
-
|
|
8024
|
+
formatText?: (available: number, total: number) => string;
|
|
8025
|
+
};
|
|
8026
|
+
/**
|
|
8027
|
+
* Configuration for the default place icon.
|
|
8028
|
+
* * This is the icon that is used for clicked locations and addresses without a specific category.
|
|
8029
|
+
*
|
|
8030
|
+
* @group Places
|
|
8031
|
+
*/
|
|
8032
|
+
type DefaultPlaceIconConfig = {
|
|
7622
8033
|
/**
|
|
7623
|
-
* Base
|
|
8034
|
+
* Base style options for the SVG default icon.
|
|
7624
8035
|
*
|
|
7625
8036
|
* @remarks
|
|
7626
|
-
*
|
|
7627
|
-
*
|
|
7628
|
-
* {@link toBaseMapPOICategory}). Drives the inherited `text-color`
|
|
7629
|
-
* expression on the main/selected POI-like layers.
|
|
8037
|
+
* Use this to set the fill color, outline color, and outline opacity for the default waypoint icon.
|
|
8038
|
+
* Without a `fillColor`, the pin takes {@link PlacesModuleConfig.color}.
|
|
7630
8039
|
*
|
|
7631
|
-
*
|
|
8040
|
+
* Example:
|
|
7632
8041
|
* ```typescript
|
|
7633
|
-
*
|
|
7634
|
-
*
|
|
7635
|
-
*
|
|
8042
|
+
* baseStyle: {
|
|
8043
|
+
* fillColor: '#007AFF',
|
|
8044
|
+
* outlineColor: '#FFFFFF',
|
|
8045
|
+
* outlineOpacity: 0.8
|
|
8046
|
+
* }
|
|
7636
8047
|
* ```
|
|
7637
8048
|
*/
|
|
7638
|
-
|
|
8049
|
+
style?: SVGIconStyleOptions;
|
|
7639
8050
|
/**
|
|
7640
|
-
*
|
|
7641
|
-
*
|
|
7642
|
-
* @remarks
|
|
7643
|
-
* Populated only for the `base-map` theme. Drives the inherited
|
|
7644
|
-
* `text-color` expression on the base map's POI layers.
|
|
7645
|
-
* Valid values are those produced by {@link toBaseMapPOIGroup} — e.g.,
|
|
7646
|
-
* `eat_and_drink`, `lodging`, `driving`, `transport`, `shopping`,
|
|
7647
|
-
* `healthcare`, `finance`, `cultural`, `leisure`, `sport`, `outdoor`,
|
|
7648
|
-
* `protected`, `public`, `religion`, `military`, `business`, `education`,
|
|
7649
|
-
* `parking`.
|
|
7650
|
-
*/
|
|
7651
|
-
group?: string;
|
|
7652
|
-
} & SupportsEvents & Anything;
|
|
7653
|
-
/**
|
|
7654
|
-
* Full property shape used by the PlacesModule when rendering a place: the
|
|
7655
|
-
* core place data ({@link CommonPlaceProps}) merged with the display-only
|
|
7656
|
-
* fields the module attaches ({@link PlaceDisplayProps}).
|
|
7657
|
-
*
|
|
7658
|
-
* @example
|
|
7659
|
-
* ```typescript
|
|
7660
|
-
* const place: DisplayPlaceProps = {
|
|
7661
|
-
* type: 'POI',
|
|
7662
|
-
* poi: {
|
|
7663
|
-
* name: 'Central Station',
|
|
7664
|
-
* categories: ['RAILWAY_STATION'],
|
|
7665
|
-
* },
|
|
7666
|
-
* address: {
|
|
7667
|
-
* streetName: 'Damrak',
|
|
7668
|
-
* municipalitySubdivision: 'Amsterdam',
|
|
7669
|
-
* countryCode: 'NL',
|
|
7670
|
-
* },
|
|
7671
|
-
* id: 'place-123',
|
|
7672
|
-
* title: 'Amsterdam Central Station',
|
|
7673
|
-
* iconID: 'poi-railway_station',
|
|
7674
|
-
* category: 'railway_station',
|
|
7675
|
-
* group: 'transport',
|
|
7676
|
-
* };
|
|
7677
|
-
* ```
|
|
7678
|
-
*
|
|
7679
|
-
* @group Places
|
|
7680
|
-
*/
|
|
7681
|
-
export type DisplayPlaceProps = CommonPlaceProps & PlaceDisplayProps;
|
|
7682
|
-
//#endregion
|
|
7683
|
-
//#region src/places/types/entryPointDisplay.d.ts
|
|
7684
|
-
/**
|
|
7685
|
-
* Properties of an entry point drawn by {@link PlacesModule}: the {@link EntryPoint} itself, whose
|
|
7686
|
-
* position is the feature geometry, plus where it came from.
|
|
7687
|
-
*
|
|
7688
|
-
* @group Places
|
|
7689
|
-
*/
|
|
7690
|
-
type PlaceEntryPointProps = Omit<EntryPoint, 'position'> & {
|
|
7691
|
-
/**
|
|
7692
|
-
* Unique identifier of the entry point feature, derived from its place.
|
|
7693
|
-
*/
|
|
7694
|
-
id: string;
|
|
7695
|
-
/**
|
|
7696
|
-
* `id` of the place the entry point belongs to, as shown by the module.
|
|
7697
|
-
*/
|
|
7698
|
-
placeID: string;
|
|
7699
|
-
/**
|
|
7700
|
-
* Index of the entry point in the `entryPoints` of its place.
|
|
7701
|
-
*/
|
|
7702
|
-
entryPointIndex: number;
|
|
7703
|
-
} & SupportsEvents;
|
|
7704
|
-
/**
|
|
7705
|
-
* What `places.events.entryPoints` handlers receive: the entry point as a point feature, whether its
|
|
7706
|
-
* circle or its line was hit, together with the place it belongs to.
|
|
7707
|
-
*
|
|
7708
|
-
* @remarks
|
|
7709
|
-
* The place is passed as shown, with its own geometry. To route to the entrance, pass this feature
|
|
7710
|
-
* as the route location.
|
|
7711
|
-
*
|
|
7712
|
-
* @group Places
|
|
7713
|
-
*/
|
|
7714
|
-
type PlaceEntryPointFeature = Feature<Point, PlaceEntryPointProps & {
|
|
7715
|
-
/**
|
|
7716
|
-
* The place the entry point belongs to. Absent only when that place left the map while the
|
|
7717
|
-
* event was being handled.
|
|
7718
|
-
*/
|
|
7719
|
-
place?: Place<DisplayPlaceProps>;
|
|
7720
|
-
}>;
|
|
7721
|
-
//#endregion
|
|
7722
|
-
//#region src/places/types/placesModuleConfig.d.ts
|
|
7723
|
-
/**
|
|
7724
|
-
* Icon style options for displaying places on the map.
|
|
7725
|
-
*
|
|
7726
|
-
* @remarks
|
|
7727
|
-
* **Available Styles:**
|
|
7728
|
-
* - `pin`: Traditional map pin markers (teardrop shape)
|
|
7729
|
-
* - `circle-icon`: Simple circular markers (previously named `circle`)
|
|
7730
|
-
* - `base-map`: Mimics the map's built-in POI layer style with category icons (combines `main`, `selected`, and `micro` layers). For micro-only rendering, hide the `main` layer via `layers.main.layout.visibility = 'none'`.
|
|
7731
|
-
* - `pin-clustered`: Same teardrop pins as `pin` for un-clustered places, with nearby
|
|
7732
|
-
* places aggregated into a single icon. Single-category clusters render the matching
|
|
7733
|
-
* base-map POI sprite with a small count badge in the top-right; mixed-category
|
|
7734
|
-
* clusters render a larger centred count circle in place of the icon. Cluster features
|
|
7735
|
-
* expose `clusterBaseMapIconIDs` (comma-separated, deduplicated) on their properties.
|
|
7736
|
-
* {@link PlacesModuleConfig.cluster} configures both.
|
|
7737
|
-
*
|
|
7738
|
-
* @group Places
|
|
7739
|
-
*/
|
|
7740
|
-
type PlacesTheme = (typeof placesThemes)[number];
|
|
7741
|
-
/**
|
|
7742
|
-
* All valid {@link PlacesTheme} values.
|
|
7743
|
-
*
|
|
7744
|
-
* @group Places
|
|
7745
|
-
*/
|
|
7746
|
-
export declare const placesThemes: readonly ["pin", "circle-icon", "base-map", "pin-clustered"];
|
|
7747
|
-
/**
|
|
7748
|
-
* Configuration for EV charging station availability display.
|
|
7749
|
-
*
|
|
7750
|
-
* @remarks
|
|
7751
|
-
* **Opt-In Feature:**
|
|
7752
|
-
* - Disabled by default - set `enabled: true` to activate
|
|
7753
|
-
* - Requires fetching availability via {@link getPlacesWithEVAvailability}
|
|
7754
|
-
* - Each PlacesModule can enable/disable independently
|
|
7755
|
-
*
|
|
7756
|
-
* When enabled, displays formatted availability text (e.g., "3/10") below the station name
|
|
7757
|
-
* with color-coding based on availability ratio: green (high), orange (limited), red (none/low).
|
|
7758
|
-
*
|
|
7759
|
-
* @example
|
|
7760
|
-
* ```typescript
|
|
7761
|
-
* // Enable with defaults
|
|
7762
|
-
* const places = await PlacesModule.create(map, {
|
|
7763
|
-
* evAvailability: { enabled: true }
|
|
7764
|
-
* });
|
|
7765
|
-
* const stations = await discoverPlaces({ filters: { poiCategories: ['CHARGING_LOCATION'] } });
|
|
7766
|
-
* places.show(await getPlacesWithEVAvailability(stations));
|
|
7767
|
-
*
|
|
7768
|
-
* // Custom threshold and format
|
|
7769
|
-
* const places = await PlacesModule.create(map, {
|
|
7770
|
-
* evAvailability: {
|
|
7771
|
-
* enabled: true,
|
|
7772
|
-
* threshold: 0.5,
|
|
7773
|
-
* formatText: (available, total) => `${available} of ${total}`
|
|
7774
|
-
* }
|
|
7775
|
-
* });
|
|
7776
|
-
*
|
|
7777
|
-
* // Combine with custom icon
|
|
7778
|
-
* const places = await PlacesModule.create(map, {
|
|
7779
|
-
* icon: {
|
|
7780
|
-
* categoryIcons: [{
|
|
7781
|
-
* id: 'CHARGING_LOCATION',
|
|
7782
|
-
* image: customEvIconSvg,
|
|
7783
|
-
* pixelRatio: 2
|
|
7784
|
-
* }]
|
|
7785
|
-
* },
|
|
7786
|
-
* evAvailability: { enabled: true }
|
|
7787
|
-
* });
|
|
7788
|
-
* ```
|
|
7789
|
-
*
|
|
7790
|
-
* @group Places
|
|
7791
|
-
*/
|
|
7792
|
-
type EVAvailabilityConfig = {
|
|
7793
|
-
/**
|
|
7794
|
-
* Enable or disable EV availability display.
|
|
7795
|
-
*
|
|
7796
|
-
* @remarks
|
|
7797
|
-
* Must be explicitly set to `true` to display availability.
|
|
7798
|
-
*/
|
|
7799
|
-
enabled?: boolean;
|
|
7800
|
-
/**
|
|
7801
|
-
* Availability ratio threshold for determining available vs occupied.
|
|
7802
|
-
*
|
|
7803
|
-
* @remarks
|
|
7804
|
-
* - `ratio >= threshold`: Available (green)
|
|
7805
|
-
* - `ratio < threshold`: Occupied (red)
|
|
7806
|
-
*
|
|
7807
|
-
* @default 0
|
|
7808
|
-
*/
|
|
7809
|
-
threshold?: number;
|
|
7810
|
-
/**
|
|
7811
|
-
* Custom function to format the availability text.
|
|
7812
|
-
*
|
|
7813
|
-
* @param available - Number of available charging points
|
|
7814
|
-
* @param total - Total number of charging points
|
|
7815
|
-
* @returns Formatted availability text
|
|
7816
|
-
*
|
|
7817
|
-
* @default (available, total) => `${available}/${total}`
|
|
7818
|
-
*/
|
|
7819
|
-
formatText?: (available: number, total: number) => string;
|
|
7820
|
-
};
|
|
7821
|
-
/**
|
|
7822
|
-
* Configuration for the default place icon.
|
|
7823
|
-
* * This is the icon that is used for clicked locations and addresses without a specific category.
|
|
7824
|
-
*
|
|
7825
|
-
* @group Places
|
|
7826
|
-
*/
|
|
7827
|
-
type DefaultPlaceIconConfig = {
|
|
7828
|
-
/**
|
|
7829
|
-
* Base style options for the SVG default icon.
|
|
7830
|
-
*
|
|
7831
|
-
* @remarks
|
|
7832
|
-
* Use this to set the fill color, outline color, and outline opacity for the default waypoint icon.
|
|
7833
|
-
* Without a `fillColor`, the pin takes the map's accent colour when a theme sets one
|
|
7834
|
-
* ({@link TomTomMap.mapColors}).
|
|
7835
|
-
*
|
|
7836
|
-
* Example:
|
|
7837
|
-
* ```typescript
|
|
7838
|
-
* baseStyle: {
|
|
7839
|
-
* fillColor: '#007AFF',
|
|
7840
|
-
* outlineColor: '#FFFFFF',
|
|
7841
|
-
* outlineOpacity: 0.8
|
|
7842
|
-
* }
|
|
7843
|
-
* ```
|
|
7844
|
-
*/
|
|
7845
|
-
style?: SVGIconStyleOptions;
|
|
7846
|
-
/**
|
|
7847
|
-
* Custom image for the default icon.
|
|
8051
|
+
* Custom image for the default icon.
|
|
7848
8052
|
*
|
|
7849
8053
|
* @remarks
|
|
7850
8054
|
* If provided, this image will be used instead of the default icon, and `style` does not apply.
|
|
@@ -7861,15 +8065,15 @@ type DefaultPlaceIconConfig = {
|
|
|
7861
8065
|
* // Custom icons for specific categories
|
|
7862
8066
|
* const iconConfig: PlaceIconConfig = {
|
|
7863
8067
|
* categoryIcons: [
|
|
7864
|
-
* {
|
|
7865
|
-
* {
|
|
8068
|
+
* { id: 'RESTAURANT', image: '/icons/food.png', pixelRatio: 2 },
|
|
8069
|
+
* { id: 'HOTEL_OR_MOTEL', image: '/icons/hotel.png', pixelRatio: 2 }
|
|
7866
8070
|
* ]
|
|
7867
8071
|
* };
|
|
7868
8072
|
* ```
|
|
7869
8073
|
*
|
|
7870
8074
|
* @group Places
|
|
7871
8075
|
*/
|
|
7872
|
-
type PlaceIconConfig = {
|
|
8076
|
+
type PlaceIconConfig<P extends CommonPlaceProps = CommonPlaceProps> = {
|
|
7873
8077
|
/**
|
|
7874
8078
|
* Configuration for the default place icon.
|
|
7875
8079
|
* * The default icon is the one used for clicked locations and addresses without a specific category, or via custom mapping.
|
|
@@ -7894,6 +8098,9 @@ type PlaceIconConfig = {
|
|
|
7894
8098
|
* - **`poiCategory`**: Returns a POI category, which is then resolved to an icon
|
|
7895
8099
|
* using the existing category-to-icon logic. This reuses the standard category mapping.
|
|
7896
8100
|
*
|
|
8101
|
+
* `fn` receives places of the shape the module was created for, so it reads your own
|
|
8102
|
+
* properties typed.
|
|
8103
|
+
*
|
|
7897
8104
|
* @example
|
|
7898
8105
|
* ```typescript
|
|
7899
8106
|
* // Direct image ID mapping
|
|
@@ -7902,41 +8109,45 @@ type PlaceIconConfig = {
|
|
|
7902
8109
|
* fn: (place) => place.properties.poi?.name?.includes('urgent') ? 'urgent-icon' : 'default-icon'
|
|
7903
8110
|
* }
|
|
7904
8111
|
*
|
|
7905
|
-
* // POI category mapping
|
|
7906
|
-
*
|
|
7907
|
-
*
|
|
7908
|
-
* fn: (place) => place.properties.
|
|
7909
|
-
* }
|
|
8112
|
+
* // POI category mapping, from a property of your own
|
|
8113
|
+
* type Venue = CommonPlaceProps & { venueCategory?: MapStylePOICategory };
|
|
8114
|
+
* await PlacesModule.create<Venue>(map, {
|
|
8115
|
+
* icon: { mapping: { to: 'poiCategory', fn: (place) => place.properties.venueCategory ?? 'RESTAURANT' } },
|
|
8116
|
+
* });
|
|
7910
8117
|
* ```
|
|
7911
8118
|
*/
|
|
7912
8119
|
mapping?: {
|
|
7913
8120
|
to: 'imageID';
|
|
7914
|
-
fn: (place: Place) => string;
|
|
8121
|
+
fn: (place: Place<P>) => string;
|
|
7915
8122
|
} | {
|
|
7916
8123
|
to: 'poiCategory';
|
|
7917
|
-
fn: (place: Place) => MapStylePOICategory;
|
|
8124
|
+
fn: (place: Place<P>) => MapStylePOICategory;
|
|
7918
8125
|
};
|
|
7919
8126
|
};
|
|
7920
8127
|
/**
|
|
7921
|
-
*
|
|
7922
|
-
*
|
|
7923
|
-
* Controls how text labels are displayed next to place markers, including
|
|
7924
|
-
* content, styling, and positioning.
|
|
8128
|
+
* The content, look and position of the labels next to place markers.
|
|
7925
8129
|
*
|
|
7926
8130
|
* @remarks
|
|
7927
|
-
*
|
|
7928
|
-
*
|
|
8131
|
+
* An unset {@link LabelConfig} field keeps the marker type's own label: under `base-map` the map
|
|
8132
|
+
* style's POI labels; otherwise `#333333` text on a `#FFFFFF` halo (the reverse on a dark map),
|
|
8133
|
+
* 14 to 16 pixels and a 1 to 1.5 pixel halo as the zoom grows, fully opaque. The label of a hovered
|
|
8134
|
+
* or clicked place takes {@link PlacesModuleConfig.color} instead.
|
|
8135
|
+
*
|
|
8136
|
+
* Set labels here rather than with MapLibre's `setPaintProperty` / `setLayoutProperty` on the
|
|
8137
|
+
* module's layers: a style change and a marker type change rebuild those layers from this config,
|
|
8138
|
+
* dropping anything written on them directly. `title` as a function of the place has no MapLibre
|
|
8139
|
+
* equivalent at all.
|
|
7929
8140
|
*
|
|
7930
8141
|
* @example
|
|
7931
8142
|
* ```typescript
|
|
7932
8143
|
* // Simple text from place name
|
|
7933
|
-
* const
|
|
7934
|
-
*
|
|
8144
|
+
* const label: PlaceLabelConfig = {
|
|
8145
|
+
* title: (place) => place.properties.poi?.name || place.properties.address.freeformAddress
|
|
7935
8146
|
* };
|
|
7936
8147
|
*
|
|
7937
8148
|
* // Using MapLibre expression with styling
|
|
7938
|
-
* const
|
|
7939
|
-
*
|
|
8149
|
+
* const styledLabel: PlaceLabelConfig = {
|
|
8150
|
+
* title: ['get', 'title'],
|
|
7940
8151
|
* size: 14,
|
|
7941
8152
|
* color: '#333',
|
|
7942
8153
|
* haloColor: '#fff',
|
|
@@ -7946,12 +8157,13 @@ type PlaceIconConfig = {
|
|
|
7946
8157
|
*
|
|
7947
8158
|
* @group Places
|
|
7948
8159
|
*/
|
|
7949
|
-
type
|
|
8160
|
+
type PlaceLabelConfig<P extends CommonPlaceProps = CommonPlaceProps> = LabelConfig & {
|
|
7950
8161
|
/**
|
|
7951
8162
|
* Text content for the label.
|
|
7952
8163
|
*
|
|
7953
8164
|
* Can be a function that extracts text from the place properties (data-based),
|
|
7954
|
-
* or a MapLibre expression for data-driven content (data-driven layer-based).
|
|
8165
|
+
* or a MapLibre expression for data-driven content (data-driven layer-based). The function
|
|
8166
|
+
* receives places of the shape the module was created for.
|
|
7955
8167
|
*
|
|
7956
8168
|
* @example
|
|
7957
8169
|
* ```typescript
|
|
@@ -7967,66 +8179,7 @@ type PlaceTextConfig = {
|
|
|
7967
8179
|
*
|
|
7968
8180
|
* @see https://maplibre.org/maplibre-style-spec/types/#formatted
|
|
7969
8181
|
*/
|
|
7970
|
-
title?: ((place: Place) => string) | DataDrivenPropertyValueSpecification<string>;
|
|
7971
|
-
/**
|
|
7972
|
-
* Font size in pixels.
|
|
7973
|
-
*
|
|
7974
|
-
* @default 12
|
|
7975
|
-
*
|
|
7976
|
-
* @example
|
|
7977
|
-
* ```typescript
|
|
7978
|
-
* size: 14
|
|
7979
|
-
*
|
|
7980
|
-
* // Data-driven size based on importance
|
|
7981
|
-
* size: ['interpolate', ['linear'], ['get', 'priority'], 1, 16, 10, 10]
|
|
7982
|
-
* ```
|
|
7983
|
-
*/
|
|
7984
|
-
size?: DataDrivenPropertyValueSpecification<number>;
|
|
7985
|
-
/**
|
|
7986
|
-
* Text color.
|
|
7987
|
-
*
|
|
7988
|
-
* @default '#000000'
|
|
7989
|
-
*
|
|
7990
|
-
* @example
|
|
7991
|
-
* ```typescript
|
|
7992
|
-
* color: '#333333'
|
|
7993
|
-
*
|
|
7994
|
-
* // Category-based colors
|
|
7995
|
-
* color: ['match', ['get', 'category'], 'RESTAURANT', '#D32F2F', '#1976D2']
|
|
7996
|
-
* ```
|
|
7997
|
-
*/
|
|
7998
|
-
color?: DataDrivenPropertyValueSpecification<string>;
|
|
7999
|
-
/**
|
|
8000
|
-
* Font face(s) to use for the text.
|
|
8001
|
-
*
|
|
8002
|
-
* @example
|
|
8003
|
-
* ```typescript
|
|
8004
|
-
* font: ['Open Sans Bold', 'Arial Unicode MS Bold']
|
|
8005
|
-
* ```
|
|
8006
|
-
*/
|
|
8007
|
-
font?: DataDrivenPropertyValueSpecification<Array<MapFont>>;
|
|
8008
|
-
/**
|
|
8009
|
-
* Text halo (outline) color for better readability.
|
|
8010
|
-
*
|
|
8011
|
-
* @default '#FFFFFF'
|
|
8012
|
-
*
|
|
8013
|
-
* @example
|
|
8014
|
-
* ```typescript
|
|
8015
|
-
* haloColor: '#fff'
|
|
8016
|
-
* ```
|
|
8017
|
-
*/
|
|
8018
|
-
haloColor?: DataDrivenPropertyValueSpecification<string>;
|
|
8019
|
-
/**
|
|
8020
|
-
* Text halo (outline) width in pixels.
|
|
8021
|
-
*
|
|
8022
|
-
* @default 1
|
|
8023
|
-
*
|
|
8024
|
-
* @example
|
|
8025
|
-
* ```typescript
|
|
8026
|
-
* haloWidth: 2 // Thicker outline for better contrast
|
|
8027
|
-
* ```
|
|
8028
|
-
*/
|
|
8029
|
-
haloWidth?: DataDrivenPropertyValueSpecification<number>;
|
|
8182
|
+
title?: ((place: Place<P>) => string) | DataDrivenPropertyValueSpecification<string>;
|
|
8030
8183
|
/**
|
|
8031
8184
|
* Text offset from the icon in ems.
|
|
8032
8185
|
*
|
|
@@ -8097,10 +8250,10 @@ type PlaceLayersConfig = {
|
|
|
8097
8250
|
*
|
|
8098
8251
|
* @remarks
|
|
8099
8252
|
* Always registered and stacked below the `main` layer, but only renders features
|
|
8100
|
-
*
|
|
8253
|
+
* under the `base-map` marker type — in that mode it mirrors the map style's
|
|
8101
8254
|
* `POI - Micro` layer so place markers blend with the base map's lower-density
|
|
8102
|
-
* POI rendering. For other
|
|
8103
|
-
* `layout.visibility = 'none'` and acts as a no-op, making
|
|
8255
|
+
* POI rendering. For other marker types the layer is hidden via
|
|
8256
|
+
* `layout.visibility = 'none'` and acts as a no-op, making marker type switches cheap
|
|
8104
8257
|
* (no add/remove layer churn).
|
|
8105
8258
|
*/
|
|
8106
8259
|
micro?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
@@ -8120,11 +8273,11 @@ type PlaceLayersConfig = {
|
|
|
8120
8273
|
*
|
|
8121
8274
|
* @remarks
|
|
8122
8275
|
* Always registered and stacked above `selected`, but only renders under the
|
|
8123
|
-
* `pin-clustered`
|
|
8276
|
+
* `pin-clustered` marker type and only for single-category clusters — every leaf in
|
|
8124
8277
|
* the cluster shares the same base-map sprite, picked via a `match` over the
|
|
8125
8278
|
* aggregated `clusterBaseMapIconIDs` property. Mixed-category clusters fall
|
|
8126
8279
|
* through to {@link clusterMixedBadge} + {@link clusterMixedCount} instead.
|
|
8127
|
-
* For other
|
|
8280
|
+
* For other marker types the layer is hidden via `layout.visibility = 'none'`.
|
|
8128
8281
|
*/
|
|
8129
8282
|
cluster?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
8130
8283
|
/**
|
|
@@ -8133,7 +8286,7 @@ type PlaceLayersConfig = {
|
|
|
8133
8286
|
* @remarks
|
|
8134
8287
|
* Circle drawn at the top-right of each single-category cluster pin.
|
|
8135
8288
|
* Acts as the background for {@link clusterCount}. Only visible under the
|
|
8136
|
-
* `pin-clustered`
|
|
8289
|
+
* `pin-clustered` marker type and gated to single-category clusters; mixed
|
|
8137
8290
|
* clusters use {@link clusterMixedBadge} instead.
|
|
8138
8291
|
*/
|
|
8139
8292
|
clusterBadge?: Partial<ToBeAddedLayerSpecTemplate<CircleLayerSpecification>>;
|
|
@@ -8143,13 +8296,13 @@ type PlaceLayersConfig = {
|
|
|
8143
8296
|
* @remarks
|
|
8144
8297
|
* Count rendered on top of {@link clusterBadge} for single-category
|
|
8145
8298
|
* clusters. Reads the `point_count_abbreviated` property MapLibre sets on
|
|
8146
|
-
* every cluster feature. Only visible under the `pin-clustered`
|
|
8299
|
+
* every cluster feature. Only visible under the `pin-clustered` marker type;
|
|
8147
8300
|
* mixed clusters use {@link clusterMixedCount} instead.
|
|
8148
8301
|
*/
|
|
8149
8302
|
clusterCount?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
8150
8303
|
/**
|
|
8151
8304
|
* Centred count badge for mixed-category clusters under the
|
|
8152
|
-
* `pin-clustered`
|
|
8305
|
+
* `pin-clustered` marker type.
|
|
8153
8306
|
*
|
|
8154
8307
|
* @remarks
|
|
8155
8308
|
* Replaces the cluster icon entirely when a cluster spans multiple POI
|
|
@@ -8182,6 +8335,10 @@ type PlaceLayerName = keyof PlaceLayersConfig;
|
|
|
8182
8335
|
* id is given, the module resolves it against its currently shown places to obtain the
|
|
8183
8336
|
* coordinates; connections referencing unknown ids are silently skipped.
|
|
8184
8337
|
*
|
|
8338
|
+
* An id resolves each time the connections are drawn — on `showConnections()`, a configuration
|
|
8339
|
+
* change and a style change. `show()` and `clear()` drop every connection, so none outlives the
|
|
8340
|
+
* places it referred to, and none comes back when those places are shown again.
|
|
8341
|
+
*
|
|
8185
8342
|
* Extra arbitrary properties are preserved on the connection and passed to the optional
|
|
8186
8343
|
* label function, making it easy to render metadata such as distance or travel time
|
|
8187
8344
|
* along the line.
|
|
@@ -8278,7 +8435,7 @@ type PlaceConnectionsConfig = {
|
|
|
8278
8435
|
layers?: PlaceConnectionsLayersConfig;
|
|
8279
8436
|
};
|
|
8280
8437
|
/**
|
|
8281
|
-
* Appearance of the cluster count badge under the `pin-clustered`
|
|
8438
|
+
* Appearance of the cluster count badge under the `pin-clustered` marker type.
|
|
8282
8439
|
*
|
|
8283
8440
|
* @remarks
|
|
8284
8441
|
* Each field applies to single-category and mixed-category clusters alike. The matching
|
|
@@ -8344,15 +8501,15 @@ type PlaceClusterBadgeConfig = {
|
|
|
8344
8501
|
textSize?: DataDrivenPropertyValueSpecification<number>;
|
|
8345
8502
|
};
|
|
8346
8503
|
/**
|
|
8347
|
-
* Configuration for the `pin-clustered`
|
|
8504
|
+
* Configuration for the `pin-clustered` marker type.
|
|
8348
8505
|
*
|
|
8349
8506
|
* @remarks
|
|
8350
|
-
* Ignored by every other {@link
|
|
8507
|
+
* Ignored by every other {@link PlacesMarkerType}.
|
|
8351
8508
|
*
|
|
8352
8509
|
* @example
|
|
8353
8510
|
* ```typescript
|
|
8354
8511
|
* const places = await PlacesModule.create(map, {
|
|
8355
|
-
*
|
|
8512
|
+
* markerType: 'pin-clustered',
|
|
8356
8513
|
* cluster: {
|
|
8357
8514
|
* badge: { color: '#3f9cd9', radius: { single: 13, mixed: 18 } }
|
|
8358
8515
|
* }
|
|
@@ -8371,14 +8528,14 @@ type PlacesClusterConfig = {
|
|
|
8371
8528
|
*
|
|
8372
8529
|
* @remarks
|
|
8373
8530
|
* - Changing them with {@link PlacesModule.applyConfig} recreates the places source.
|
|
8374
|
-
* - `cluster` itself is not settable: `
|
|
8531
|
+
* - `cluster` itself is not settable: `markerType: 'pin-clustered'` switches clustering on.
|
|
8375
8532
|
* - `clusterProperties` land on each cluster feature's properties, for layer overrides to read
|
|
8376
8533
|
* with `['get', '<key>']`. The key `clusterBaseMapIconIDs` is reserved for the module's own.
|
|
8377
8534
|
*
|
|
8378
8535
|
* @example
|
|
8379
8536
|
* ```typescript
|
|
8380
8537
|
* const places = await PlacesModule.create(map, {
|
|
8381
|
-
*
|
|
8538
|
+
* markerType: 'pin-clustered',
|
|
8382
8539
|
* cluster: {
|
|
8383
8540
|
* source: {
|
|
8384
8541
|
* clusterRadius: 100,
|
|
@@ -8472,7 +8629,7 @@ type PlaceEntryPointsConfig = {
|
|
|
8472
8629
|
* Zoom level below which no entry point is drawn.
|
|
8473
8630
|
*
|
|
8474
8631
|
* @remarks
|
|
8475
|
-
* Under the `pin-clustered`
|
|
8632
|
+
* Under the `pin-clustered` marker type it is never lower than the first zoom without clusters:
|
|
8476
8633
|
* `cluster.source.clusterMaxZoom` plus one, 18 by default.
|
|
8477
8634
|
*
|
|
8478
8635
|
* @default 15
|
|
@@ -8492,25 +8649,24 @@ type PlaceEntryPointsConfig = {
|
|
|
8492
8649
|
* ```typescript
|
|
8493
8650
|
* // Basic configuration
|
|
8494
8651
|
* const config: PlacesModuleConfig = {
|
|
8495
|
-
*
|
|
8496
|
-
*
|
|
8497
|
-
*
|
|
8498
|
-
*
|
|
8499
|
-
* field: (place) => place.properties.poi?.name || 'Unknown',
|
|
8652
|
+
* markerType: 'pin',
|
|
8653
|
+
* color: '#E4572E',
|
|
8654
|
+
* label: {
|
|
8655
|
+
* title: (place) => place.properties.poi?.name || 'Unknown',
|
|
8500
8656
|
* size: 12
|
|
8501
8657
|
* }
|
|
8502
8658
|
* };
|
|
8503
8659
|
*
|
|
8504
8660
|
* // Advanced configuration with custom properties
|
|
8505
8661
|
* const config: PlacesModuleConfig = {
|
|
8662
|
+
* markerType: 'base-map',
|
|
8506
8663
|
* icon: {
|
|
8507
|
-
* style: 'base-map',
|
|
8508
8664
|
* categoryIcons: [
|
|
8509
|
-
* {
|
|
8665
|
+
* { id: 'RESTAURANT', image: '/icons/restaurant.png' }
|
|
8510
8666
|
* ]
|
|
8511
8667
|
* },
|
|
8512
|
-
*
|
|
8513
|
-
*
|
|
8668
|
+
* label: {
|
|
8669
|
+
* title: ['get', 'title'],
|
|
8514
8670
|
* size: 14,
|
|
8515
8671
|
* color: '#333',
|
|
8516
8672
|
* haloColor: '#fff',
|
|
@@ -8523,54 +8679,62 @@ type PlaceEntryPointsConfig = {
|
|
|
8523
8679
|
* };
|
|
8524
8680
|
* ```
|
|
8525
8681
|
*
|
|
8682
|
+
* @see {@link PlacesModuleSerializableConfig} for the part that survives JSON.
|
|
8683
|
+
*
|
|
8526
8684
|
* @group Places
|
|
8527
8685
|
*/
|
|
8528
8686
|
type PlacesModuleConfig<P extends CommonPlaceProps = CommonPlaceProps> = MapModuleCommonConfig & {
|
|
8529
8687
|
/**
|
|
8530
|
-
*
|
|
8688
|
+
* The kind of marker all places are drawn with.
|
|
8531
8689
|
*
|
|
8532
8690
|
* @remarks
|
|
8533
|
-
*
|
|
8691
|
+
* {@link PlaceIconConfig.categoryIcons} replace its icon for the categories they name, under
|
|
8692
|
+
* every marker type.
|
|
8534
8693
|
*
|
|
8535
8694
|
* @default 'pin'
|
|
8536
8695
|
*/
|
|
8537
|
-
|
|
8696
|
+
markerType?: PlacesMarkerType;
|
|
8697
|
+
/**
|
|
8698
|
+
* The colour of this module's own drawing: the default pin fill, the label of a hovered or
|
|
8699
|
+
* clicked place, connection lines and entry points. Connection labels, and entry points on a
|
|
8700
|
+
* light map, take a darker shade of it.
|
|
8701
|
+
*
|
|
8702
|
+
* @remarks
|
|
8703
|
+
* A more specific setting wins for its element: `icon.default.style.fillColor` for the pin,
|
|
8704
|
+
* `label.color` or a `layers.*` paint override for a label or layer. Unset, it is the map's
|
|
8705
|
+
* accent colour ({@link TomTomMap.mapColors}), and without one the SDK's own colours. Cluster
|
|
8706
|
+
* badges do not take it: {@link PlaceClusterBadgeConfig.color} sets them.
|
|
8707
|
+
*/
|
|
8708
|
+
color?: string;
|
|
8538
8709
|
/**
|
|
8539
8710
|
* Whether the module draws anything: places, connections and entry points.
|
|
8540
8711
|
*
|
|
8541
8712
|
* @remarks
|
|
8542
8713
|
* `show()` and `clear()` never change it — a hidden module keeps its data until
|
|
8543
|
-
* {@link PlacesModule.setVisible} shows it again. Layers the
|
|
8714
|
+
* {@link PlacesModule.setVisible} shows it again. Layers the marker type does not use, and any hidden
|
|
8544
8715
|
* through {@link PlacesModuleConfig.layers | layers}, stay hidden while the module is shown.
|
|
8545
8716
|
*
|
|
8546
8717
|
* @default true
|
|
8547
8718
|
*/
|
|
8548
8719
|
visible?: boolean;
|
|
8549
8720
|
/**
|
|
8550
|
-
*
|
|
8551
|
-
*
|
|
8552
|
-
* Controls marker style and custom icons for different place categories.
|
|
8721
|
+
* The default pin, and custom icons per place category.
|
|
8553
8722
|
*/
|
|
8554
|
-
icon?: PlaceIconConfig
|
|
8723
|
+
icon?: PlaceIconConfig<P>;
|
|
8555
8724
|
/**
|
|
8556
|
-
* How the `pin-clustered`
|
|
8725
|
+
* How the `pin-clustered` marker type clusters places and draws the cluster badge.
|
|
8557
8726
|
*/
|
|
8558
8727
|
cluster?: PlacesClusterConfig;
|
|
8559
8728
|
/**
|
|
8560
|
-
*
|
|
8561
|
-
*
|
|
8562
|
-
* Controls label content, styling, and positioning.
|
|
8729
|
+
* The labels next to place markers: their content, styling and position.
|
|
8563
8730
|
*/
|
|
8564
|
-
|
|
8731
|
+
label?: PlaceLabelConfig<P>;
|
|
8565
8732
|
/**
|
|
8566
|
-
*
|
|
8733
|
+
* MapLibre overrides for the places layers, for control the other settings do not offer.
|
|
8567
8734
|
*
|
|
8568
8735
|
* @remarks
|
|
8569
|
-
*
|
|
8570
|
-
*
|
|
8571
|
-
* * You can still reuse the default configurations if you want incremental changes. See: buildPlacesLayerSpecs.
|
|
8572
|
-
* * Any layer not specified will continue to use its default styling.
|
|
8573
|
-
* * Use this only if you need fine MapLibre control on how places are displayed.
|
|
8736
|
+
* Each override lays its `layout` and `paint` properties over the layer's own, one by one, and
|
|
8737
|
+
* wins over `label` and `color` for the properties it names.
|
|
8574
8738
|
*/
|
|
8575
8739
|
layers?: PlaceLayersConfig;
|
|
8576
8740
|
/**
|
|
@@ -8619,7 +8783,7 @@ type PlacesModuleConfig<P extends CommonPlaceProps = CommonPlaceProps> = MapModu
|
|
|
8619
8783
|
*
|
|
8620
8784
|
* // Computed property
|
|
8621
8785
|
* category: (place) => place.properties.poi?.categories?.[0],
|
|
8622
|
-
*
|
|
8786
|
+
* brand: (place) => place.properties.poi?.brands?.[0] ?? '',
|
|
8623
8787
|
* hasOpeningHours: (place) => !!place.properties.poi?.openingHours,
|
|
8624
8788
|
*
|
|
8625
8789
|
* // Complex computation
|
|
@@ -8650,6 +8814,287 @@ type FeaturePropValue = string | number | boolean | null | undefined | FeaturePr
|
|
|
8650
8814
|
* @group Places
|
|
8651
8815
|
*/
|
|
8652
8816
|
type ExtraFeatureProp<P extends CommonPlaceProps = CommonPlaceProps> = FeaturePropValue | ((place: Place<P>) => FeaturePropValue);
|
|
8817
|
+
/**
|
|
8818
|
+
* The part of a {@link PlacesModuleConfig} that survives JSON, for saving
|
|
8819
|
+
* `getConfig()` and replaying it with `applyConfig()`.
|
|
8820
|
+
*
|
|
8821
|
+
* @remarks
|
|
8822
|
+
* It leaves out what JSON cannot carry, which a replay adds back in code:
|
|
8823
|
+
* - `label.title` as a function — a MapLibre expression serializes.
|
|
8824
|
+
* - `connections.label`, `evAvailability.formatText` and `icon.mapping`, all functions.
|
|
8825
|
+
* - `extraFeatureProps` entries that are functions — fixed values serialize.
|
|
8826
|
+
* - `icon.default.image` and `icon.categoryIcons[].image` as an `HTMLImageElement` — see {@link SerializableCustomImage}.
|
|
8827
|
+
*
|
|
8828
|
+
* @example
|
|
8829
|
+
* ```typescript
|
|
8830
|
+
* const saved = JSON.stringify(places.getConfig());
|
|
8831
|
+
*
|
|
8832
|
+
* const state: PlacesModuleSerializableConfig = JSON.parse(saved);
|
|
8833
|
+
* places.applyConfig({
|
|
8834
|
+
* ...state,
|
|
8835
|
+
* connections: { ...state.connections, label: (connection) => `${connection.distanceMeters} m` },
|
|
8836
|
+
* });
|
|
8837
|
+
* ```
|
|
8838
|
+
*
|
|
8839
|
+
* @group Places
|
|
8840
|
+
*/
|
|
8841
|
+
type PlacesModuleSerializableConfig = Omit<PlacesModuleConfig, 'label' | 'icon' | 'evAvailability' | 'connections' | 'extraFeatureProps'> & {
|
|
8842
|
+
label?: Omit<PlaceLabelConfig, 'title'> & {
|
|
8843
|
+
title?: Exclude<PlaceLabelConfig['title'], (place: Place) => string>;
|
|
8844
|
+
};
|
|
8845
|
+
icon?: Omit<PlaceIconConfig, 'default' | 'categoryIcons' | 'mapping'> & {
|
|
8846
|
+
default?: Omit<DefaultPlaceIconConfig, 'image'> & {
|
|
8847
|
+
image?: Omit<SerializableCustomImage, 'id'>;
|
|
8848
|
+
};
|
|
8849
|
+
categoryIcons?: SerializableCustomImage<MapStylePOICategory>[];
|
|
8850
|
+
};
|
|
8851
|
+
evAvailability?: Omit<EVAvailabilityConfig, 'formatText'>;
|
|
8852
|
+
connections?: Omit<PlaceConnectionsConfig, 'label'>;
|
|
8853
|
+
extraFeatureProps?: Record<string, FeaturePropValue>;
|
|
8854
|
+
};
|
|
8855
|
+
//#endregion
|
|
8856
|
+
//#region src/places/types/placesKnobs.d.ts
|
|
8857
|
+
/**
|
|
8858
|
+
* The id of a places knob: its path into {@link PlacesModuleConfig}, e.g. `markerType` or
|
|
8859
|
+
* `cluster.badge.color`. See {@link placesKnobCatalogue} for what each one does.
|
|
8860
|
+
*
|
|
8861
|
+
* @remarks
|
|
8862
|
+
* Only settings that take a plain value: `label.title`, `cluster.source.clusterProperties`,
|
|
8863
|
+
* `evAvailability.formatText` and anything holding an image, a callback or MapLibre layers are not
|
|
8864
|
+
* knobs.
|
|
8865
|
+
*
|
|
8866
|
+
* @group Places
|
|
8867
|
+
*/
|
|
8868
|
+
type PlacesKnobId = 'markerType' | 'color' | 'visible' | `icon.default.style.${keyof SVGIconStyleOptions}` | `label.${Exclude<keyof PlaceLabelConfig, 'title'>}` | `cluster.badge.${Exclude<keyof PlaceClusterBadgeConfig, 'radius'>}` | `cluster.badge.radius.${keyof NonNullable<PlaceClusterBadgeConfig['radius']>}` | `cluster.source.${Exclude<keyof NonNullable<PlacesClusterConfig['source']>, 'clusterProperties'>}` | `evAvailability.${Exclude<keyof EVAvailabilityConfig, 'formatText'>}` | `entryPoints.${Exclude<keyof PlaceEntryPointsConfig, 'layers'>}`;
|
|
8869
|
+
/**
|
|
8870
|
+
* The value type a given places knob takes: the plain value its path holds in
|
|
8871
|
+
* {@link PlacesModuleConfig}. The MapLibre expressions the config also takes there are not knob
|
|
8872
|
+
* values.
|
|
8873
|
+
*
|
|
8874
|
+
* @group Places
|
|
8875
|
+
*/
|
|
8876
|
+
type PlacesKnobValueOf<ID extends PlacesKnobId> = KnobPlainValue<ValueAt<PlacesModuleConfig, ID>>;
|
|
8877
|
+
/**
|
|
8878
|
+
* One entry of {@link placesKnobCatalogue}. The value in force is the one at its path in
|
|
8879
|
+
* {@link PlacesModule.getConfig}, else its `default`; with neither, the marker type, the map's
|
|
8880
|
+
* accent or its light/dark theme decides.
|
|
8881
|
+
*
|
|
8882
|
+
* @group Places
|
|
8883
|
+
*/
|
|
8884
|
+
type PlacesKnob = KnobEntry<PlacesKnobId, Exclude<KnobKind, 'factor' | 'colors' | 'image'>>;
|
|
8885
|
+
//#endregion
|
|
8886
|
+
//#region src/places/knobCatalogue.d.ts
|
|
8887
|
+
/**
|
|
8888
|
+
* Every places knob with its kind, description, range or options and, where one value holds
|
|
8889
|
+
* everywhere, its default. Static data, readable with no map loaded.
|
|
8890
|
+
*
|
|
8891
|
+
* @remarks
|
|
8892
|
+
* A knob is a plain display value in {@link PlacesModuleConfig}, at the path its id names.
|
|
8893
|
+
* - Not knobs: the label `title`, `clusterProperties`, `evAvailability.formatText`,
|
|
8894
|
+
* `icon.default.image`, `icon.categoryIcons`, `icon.mapping`, `connections`, `layers`,
|
|
8895
|
+
* `extraFeatureProps` and `events`, which take callbacks, images or MapLibre values.
|
|
8896
|
+
* - `entryPoints` draws nothing until it is set, and `evAvailability` until `enabled` is `true`.
|
|
8897
|
+
* `cluster` applies under the `pin-clustered` marker type only.
|
|
8898
|
+
*
|
|
8899
|
+
* @group Places
|
|
8900
|
+
*/
|
|
8901
|
+
export declare const placesKnobCatalogue: readonly PlacesKnob[];
|
|
8902
|
+
/**
|
|
8903
|
+
* Every places knob id, in catalogue order.
|
|
8904
|
+
*
|
|
8905
|
+
* @group Places
|
|
8906
|
+
*/
|
|
8907
|
+
export declare const placesKnobIds: readonly PlacesKnobId[];
|
|
8908
|
+
//#endregion
|
|
8909
|
+
//#region src/places/types/placeDisplayProps.d.ts
|
|
8910
|
+
/**
|
|
8911
|
+
* Properties attached to a place feature for rendering on the map.
|
|
8912
|
+
*
|
|
8913
|
+
* @remarks
|
|
8914
|
+
* Extends the source place with display-only fields consumed by the places
|
|
8915
|
+
* layer stack. Which fields are populated depends on the active
|
|
8916
|
+
* {@link PlacesMarkerType | marker type}:
|
|
8917
|
+
*
|
|
8918
|
+
* - Every marker type uses {@link PlaceDisplayProps.iconID | iconID} — the sprite name
|
|
8919
|
+
* the main layer's `icon-image` expression binds to via `['get', 'iconID']`.
|
|
8920
|
+
* The base map's POI-Micro-like layer inherits the style's `['get','group']`
|
|
8921
|
+
* expression verbatim, so custom `PlaceIconConfig.categoryIcons` sprites only
|
|
8922
|
+
* apply to the `main` layer.
|
|
8923
|
+
* - The `base-map` marker type additionally populates
|
|
8924
|
+
* {@link PlaceDisplayProps.category | category} and
|
|
8925
|
+
* {@link PlaceDisplayProps.group | group} so the base map style's own
|
|
8926
|
+
* `text-color` expression — and the POI-Micro layer's `icon-image` expression
|
|
8927
|
+
* — resolve against the place feature just as they do for native POIs.
|
|
8928
|
+
*
|
|
8929
|
+
* @example
|
|
8930
|
+
* ```typescript
|
|
8931
|
+
* const pinPlaceProps: PlaceDisplayProps = {
|
|
8932
|
+
* id: 'place-123',
|
|
8933
|
+
* title: 'Central Station',
|
|
8934
|
+
* iconID: 'poi-transit',
|
|
8935
|
+
* };
|
|
8936
|
+
*
|
|
8937
|
+
* const baseMapPlaceProps: PlaceDisplayProps = {
|
|
8938
|
+
* id: 'place-123',
|
|
8939
|
+
* title: 'Central Station',
|
|
8940
|
+
* iconID: 'poi-railway_station',
|
|
8941
|
+
* category: 'railway_station',
|
|
8942
|
+
* group: 'transport',
|
|
8943
|
+
* };
|
|
8944
|
+
* ```
|
|
8945
|
+
*
|
|
8946
|
+
* @group Places
|
|
8947
|
+
*/
|
|
8948
|
+
export type PlaceDisplayProps = {
|
|
8949
|
+
/**
|
|
8950
|
+
* Unique identifier for the place feature.
|
|
8951
|
+
*
|
|
8952
|
+
* @remarks
|
|
8953
|
+
* MapLibre does not reuse the feature IDs, so we either generate one on the
|
|
8954
|
+
* fly or promote the one from `properties.id` via the source's `promoteId`
|
|
8955
|
+
* option. Used for feature identification in events, hit-testing, and data
|
|
8956
|
+
* updates.
|
|
8957
|
+
*
|
|
8958
|
+
* @example
|
|
8959
|
+
* ```typescript
|
|
8960
|
+
* id: 'place-123'
|
|
8961
|
+
* ```
|
|
8962
|
+
*/
|
|
8963
|
+
id: string;
|
|
8964
|
+
/**
|
|
8965
|
+
* Text label rendered next to the place marker.
|
|
8966
|
+
*
|
|
8967
|
+
* @remarks
|
|
8968
|
+
* Optional — when absent no label is drawn. Typically sourced from the POI
|
|
8969
|
+
* name or free-form address, but can be any custom string (e.g., configured
|
|
8970
|
+
* via `PlacesModuleConfig.label.title`).
|
|
8971
|
+
*
|
|
8972
|
+
* @example
|
|
8973
|
+
* ```typescript
|
|
8974
|
+
* title: 'Amsterdam Central Station'
|
|
8975
|
+
* ```
|
|
8976
|
+
*/
|
|
8977
|
+
title?: string;
|
|
8978
|
+
/**
|
|
8979
|
+
* Sprite image ID used to draw the place marker.
|
|
8980
|
+
*
|
|
8981
|
+
* @remarks
|
|
8982
|
+
* The main layer binds `icon-image` to `['get', 'iconID']`, so the sprite
|
|
8983
|
+
* named here is what renders. The base map's POI-Micro-like layer inherits
|
|
8984
|
+
* the style's group-driven expression verbatim and ignores this value. The
|
|
8985
|
+
* sprite name is resolved per marker type: `pin` picks a POI category image of the
|
|
8986
|
+
* `pinCategories` sprite, so its ID carries that sprite's namespace;
|
|
8987
|
+
* `circle-icon` and `base-map` pick the base map's `poi-<category>` image; a
|
|
8988
|
+
* custom `PlaceIconConfig.categoryIcons` entry overrides the default for the
|
|
8989
|
+
* main layer on any marker type.
|
|
8990
|
+
*
|
|
8991
|
+
* @example
|
|
8992
|
+
* ```typescript
|
|
8993
|
+
* iconID: 'pinCategories:7315' // pin sprite
|
|
8994
|
+
* iconID: 'poi-restaurant' // circle-icon / base-map sprite
|
|
8995
|
+
* iconID: 'custom-marker-0' // user-provided custom icon
|
|
8996
|
+
* ```
|
|
8997
|
+
*/
|
|
8998
|
+
iconID: string;
|
|
8999
|
+
/**
|
|
9000
|
+
* Base map style POI category the place should be rendered as.
|
|
9001
|
+
*
|
|
9002
|
+
* @remarks
|
|
9003
|
+
* Populated only for the `base-map` marker type. Values are the lowercased
|
|
9004
|
+
* identifiers used by the base map style (derived via
|
|
9005
|
+
* {@link toBaseMapPOICategory}). Drives the inherited `text-color`
|
|
9006
|
+
* expression on the main/selected POI-like layers.
|
|
9007
|
+
*
|
|
9008
|
+
* @example
|
|
9009
|
+
* ```typescript
|
|
9010
|
+
* category: 'restaurant'
|
|
9011
|
+
* category: 'hotel_or_motel'
|
|
9012
|
+
* category: 'charging_location'
|
|
9013
|
+
* ```
|
|
9014
|
+
*/
|
|
9015
|
+
category?: string;
|
|
9016
|
+
/**
|
|
9017
|
+
* Base map style POI group the place belongs to.
|
|
9018
|
+
*
|
|
9019
|
+
* @remarks
|
|
9020
|
+
* Populated only for the `base-map` marker type. Drives the inherited
|
|
9021
|
+
* `text-color` expression on the base map's POI layers.
|
|
9022
|
+
* Valid values are those produced by {@link toBaseMapPOIGroup} — e.g.,
|
|
9023
|
+
* `eat_and_drink`, `lodging`, `driving`, `transport`, `shopping`,
|
|
9024
|
+
* `healthcare`, `finance`, `cultural`, `leisure`, `sport`, `outdoor`,
|
|
9025
|
+
* `protected`, `public`, `religion`, `military`, `business`, `education`,
|
|
9026
|
+
* `parking`.
|
|
9027
|
+
*/
|
|
9028
|
+
group?: string;
|
|
9029
|
+
} & SupportsEvents & Anything;
|
|
9030
|
+
/**
|
|
9031
|
+
* Full property shape used by the PlacesModule when rendering a place: the
|
|
9032
|
+
* core place data ({@link CommonPlaceProps}) merged with the display-only
|
|
9033
|
+
* fields the module attaches ({@link PlaceDisplayProps}).
|
|
9034
|
+
*
|
|
9035
|
+
* @example
|
|
9036
|
+
* ```typescript
|
|
9037
|
+
* const place: DisplayPlaceProps = {
|
|
9038
|
+
* type: 'POI',
|
|
9039
|
+
* poi: {
|
|
9040
|
+
* name: 'Central Station',
|
|
9041
|
+
* categories: ['RAILWAY_STATION'],
|
|
9042
|
+
* },
|
|
9043
|
+
* address: {
|
|
9044
|
+
* streetName: 'Damrak',
|
|
9045
|
+
* municipalitySubdivision: 'Amsterdam',
|
|
9046
|
+
* countryCode: 'NL',
|
|
9047
|
+
* },
|
|
9048
|
+
* id: 'place-123',
|
|
9049
|
+
* title: 'Amsterdam Central Station',
|
|
9050
|
+
* iconID: 'poi-railway_station',
|
|
9051
|
+
* category: 'railway_station',
|
|
9052
|
+
* group: 'transport',
|
|
9053
|
+
* };
|
|
9054
|
+
* ```
|
|
9055
|
+
*
|
|
9056
|
+
* @group Places
|
|
9057
|
+
*/
|
|
9058
|
+
export type DisplayPlaceProps = CommonPlaceProps & PlaceDisplayProps;
|
|
9059
|
+
//#endregion
|
|
9060
|
+
//#region src/places/types/entryPointDisplay.d.ts
|
|
9061
|
+
/**
|
|
9062
|
+
* Properties of an entry point drawn by {@link PlacesModule}: the {@link EntryPoint} itself, whose
|
|
9063
|
+
* position is the feature geometry, plus where it came from.
|
|
9064
|
+
*
|
|
9065
|
+
* @group Places
|
|
9066
|
+
*/
|
|
9067
|
+
type PlaceEntryPointProps = Omit<EntryPoint, 'position'> & {
|
|
9068
|
+
/**
|
|
9069
|
+
* Unique identifier of the entry point feature, derived from its place.
|
|
9070
|
+
*/
|
|
9071
|
+
id: string;
|
|
9072
|
+
/**
|
|
9073
|
+
* `id` of the place the entry point belongs to, as shown by the module.
|
|
9074
|
+
*/
|
|
9075
|
+
placeID: string;
|
|
9076
|
+
/**
|
|
9077
|
+
* Index of the entry point in the `entryPoints` of its place.
|
|
9078
|
+
*/
|
|
9079
|
+
entryPointIndex: number;
|
|
9080
|
+
} & SupportsEvents;
|
|
9081
|
+
/**
|
|
9082
|
+
* What `places.events.entryPoints` handlers receive: the entry point as a point feature, whether its
|
|
9083
|
+
* circle or its line was hit, together with the place it belongs to.
|
|
9084
|
+
*
|
|
9085
|
+
* @remarks
|
|
9086
|
+
* The place is passed as shown, with its own geometry. To route to the entrance, pass this feature
|
|
9087
|
+
* as the route location.
|
|
9088
|
+
*
|
|
9089
|
+
* @group Places
|
|
9090
|
+
*/
|
|
9091
|
+
type PlaceEntryPointFeature = Feature<Point, PlaceEntryPointProps & {
|
|
9092
|
+
/**
|
|
9093
|
+
* The place the entry point belongs to. Absent only when that place left the map while the
|
|
9094
|
+
* event was being handled.
|
|
9095
|
+
*/
|
|
9096
|
+
place?: Place<DisplayPlaceProps>;
|
|
9097
|
+
}>;
|
|
8653
9098
|
//#endregion
|
|
8654
9099
|
//#region src/places/utils/prepareConnectionsForDisplay.d.ts
|
|
8655
9100
|
/**
|
|
@@ -8679,7 +9124,7 @@ type EntryPointFeatureCollection = FeatureCollection<Point | LineString, PlaceEn
|
|
|
8679
9124
|
type PlacesSourcesAndLayers = {
|
|
8680
9125
|
/**
|
|
8681
9126
|
* Places source id with corresponding layers ids. Carries every layer the
|
|
8682
|
-
* module owns under non-clustered
|
|
9127
|
+
* module owns under non-clustered marker types; under `pin-clustered` it carries
|
|
8683
9128
|
* everything except `micro` and is configured with `cluster: true` so the
|
|
8684
9129
|
* pin / cluster pin / cluster-badge / cluster-count / mixed-cluster
|
|
8685
9130
|
* badge + count layers all see aggregated cluster features.
|
|
@@ -8704,6 +9149,17 @@ type PlacesSourcesAndLayers = {
|
|
|
8704
9149
|
/**
|
|
8705
9150
|
* What {@link PlacesModule.show} accepts, and what `shown-features` handlers receive back.
|
|
8706
9151
|
*
|
|
9152
|
+
* @remarks
|
|
9153
|
+
* Search, geocoding, reverse geocoding and place details return places, which `show()` takes as
|
|
9154
|
+
* they are; {@link preparePlacesForDisplay} is what it does to them. Three places services return
|
|
9155
|
+
* something else, and no converter turns it into places:
|
|
9156
|
+
*
|
|
9157
|
+
* | Result | Not showable because | Show instead |
|
|
9158
|
+
* | --- | --- | --- |
|
|
9159
|
+
* | {@link getSearchSuggestions} | Suggestions to choose from, without geometry; the autocomplete arm inside returns `{ context, results }` segments | A place suggestion's `resolve()`, or a brand or category's `refine()` — the follow-up search |
|
|
9160
|
+
* | {@link geometryData} | Polygons | With {@link GeometriesModule} |
|
|
9161
|
+
* | {@link evChargingStationsAvailability} | Availability alone | {@link getPlacesWithEVAvailability} |
|
|
9162
|
+
*
|
|
8707
9163
|
* @group Places
|
|
8708
9164
|
*/
|
|
8709
9165
|
export type ShownPlaces = Place | Place[] | Places;
|
|
@@ -8732,34 +9188,115 @@ export type PlacesEvents = CombinedEvents<MapGeoJSONFeature, PlacesModuleConfig,
|
|
|
8732
9188
|
/** The entry points of places, when {@link PlacesModuleConfig.entryPoints} draws them. */
|
|
8733
9189
|
entryPoints: UserEvents<PlaceEntryPointFeature>;
|
|
8734
9190
|
};
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
9191
|
+
/**
|
|
9192
|
+
* Map module for displaying and managing place markers.
|
|
9193
|
+
*
|
|
9194
|
+
* The PlacesModule provides functionality to display location markers (pins) on the map
|
|
9195
|
+
* for points of interest, search results, or custom locations. It supports various marker
|
|
9196
|
+
* styles, custom icons, text labels, and interactive events.
|
|
9197
|
+
*
|
|
9198
|
+
* @remarks
|
|
9199
|
+
* **Features:**
|
|
9200
|
+
* - Marker types ({@link PlacesMarkerType}): pins, circles, base-map POI look-alikes and clustered pins
|
|
9201
|
+
* - One colour for the module's own drawing ({@link PlacesModuleConfig.color})
|
|
9202
|
+
* - Custom icons per POI category
|
|
9203
|
+
* - Text labels with styling options
|
|
9204
|
+
* - Data-driven styling via MapLibre expressions
|
|
9205
|
+
* - Interactive events (click, hover, etc.)
|
|
9206
|
+
* - Support for custom feature properties
|
|
9207
|
+
* - EV charging station availability display (opt-in)
|
|
9208
|
+
* - Entry points of places, for all of them or only hovered or clicked ones (opt-in)
|
|
9209
|
+
*
|
|
9210
|
+
* **EV Charging Station Availability:**
|
|
9211
|
+
* When displaying EV charging stations with availability data from
|
|
9212
|
+
* {@link getPlacesWithEVAvailability}, the module can:
|
|
9213
|
+
* - Show available/total charging points (e.g., "3/10")
|
|
9214
|
+
* - Color-code availability (green = good, orange = limited, red = none/low)
|
|
9215
|
+
* - Display as formatted text within the station's label
|
|
9216
|
+
*
|
|
9217
|
+
* This feature is disabled by default. To enable it, set `evAvailability.enabled` to `true`
|
|
9218
|
+
* in the configuration.
|
|
9219
|
+
*
|
|
9220
|
+
* **Common Use Cases:**
|
|
9221
|
+
* - Search result visualization
|
|
9222
|
+
* - Custom location markers
|
|
9223
|
+
* - Store locators
|
|
9224
|
+
* - EV charging station maps with real-time availability
|
|
9225
|
+
* - Delivery/pickup points
|
|
9226
|
+
* - Saved locations display
|
|
9227
|
+
*
|
|
9228
|
+
* @example
|
|
9229
|
+
* ```typescript
|
|
9230
|
+
* // Create places module with pin markers
|
|
9231
|
+
* const placesModule = await PlacesModule.create(map, {
|
|
9232
|
+
* icon: {
|
|
9233
|
+
* categoryIcons: []
|
|
9234
|
+
* },
|
|
9235
|
+
* label: {
|
|
9236
|
+
* title: (place) => place.properties.poi?.name || 'Unknown'
|
|
9237
|
+
* },
|
|
9238
|
+
* markerType: 'pin'
|
|
9239
|
+
* });
|
|
9240
|
+
*
|
|
9241
|
+
* // Display places from search
|
|
9242
|
+
* await placesModule.show(searchResults);
|
|
9243
|
+
*
|
|
9244
|
+
* // EV Charging Stations - Opt-in to availability display
|
|
9245
|
+
* const evStations = await PlacesModule.create(map, {
|
|
9246
|
+
* evAvailability: { enabled: true }
|
|
9247
|
+
* });
|
|
9248
|
+
* const results = await discoverPlaces({ filters: { poiCategories: ['CHARGING_LOCATION'] } });
|
|
9249
|
+
* evStations.show(await getPlacesWithEVAvailability(results)); // Shows availability
|
|
9250
|
+
*
|
|
9251
|
+
* // Granular control: Enable for searched stations only, background stations without
|
|
9252
|
+
* const bgStations = await PlacesModule.create(map); // EV availability disabled
|
|
9253
|
+
* const searched = await PlacesModule.create(map, {
|
|
9254
|
+
* evAvailability: { enabled: true }
|
|
9255
|
+
* });
|
|
9256
|
+
*
|
|
9257
|
+
* // Handle clicks
|
|
9258
|
+
* placesModule.events.on('click', (feature) => {
|
|
9259
|
+
* console.log('Clicked:', feature.properties);
|
|
9260
|
+
* });
|
|
9261
|
+
*
|
|
9262
|
+
* placesModule.events.on('hover', (feature) => {
|
|
9263
|
+
* showTooltip(feature.properties.poi?.name);
|
|
9264
|
+
* });
|
|
9265
|
+
* ```
|
|
9266
|
+
*
|
|
9267
|
+
* @see [Places Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/places)
|
|
9268
|
+
*
|
|
9269
|
+
* @group Places
|
|
9270
|
+
*/
|
|
9271
|
+
export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourcesAndLayers, PlacesModuleConfig> {
|
|
9272
|
+
private layerSpecs;
|
|
9273
|
+
private connectionLayerSpecs;
|
|
9274
|
+
private entryPointLayerSpecs;
|
|
9275
|
+
private refreshingEntryPoints;
|
|
9276
|
+
private currentClusterOptions?;
|
|
9277
|
+
private sourceID;
|
|
9278
|
+
private unclusteredSourceID;
|
|
9279
|
+
private connectionSourceID;
|
|
9280
|
+
private entryPointSourceID;
|
|
9281
|
+
private layerIDPrefix;
|
|
9282
|
+
private defaultPlaceIconID;
|
|
9283
|
+
private paintedPinStyle?;
|
|
9284
|
+
private shownConnections;
|
|
9285
|
+
private readonly shownFeaturesHandlers;
|
|
9286
|
+
/**
|
|
9287
|
+
* Creates a new module instance on the given map, waiting until the map is ready first.
|
|
9288
|
+
*
|
|
9289
|
+
* `PlacesModule` owns the sources, layers and images it adds, all suffixed per instance. Every
|
|
9290
|
+
* call therefore returns a **new, independent** instance, and stacking several of them on one
|
|
9291
|
+
* map is a supported thing to do.
|
|
9292
|
+
*
|
|
9293
|
+
* @param tomtomMap The TomTomMap instance.
|
|
9294
|
+
* @param config The module optional configuration
|
|
9295
|
+
* @returns {Promise} Returns a promise with a new instance of this module
|
|
9296
|
+
*/
|
|
9297
|
+
static create<P extends CommonPlaceProps = CommonPlaceProps>(tomtomMap: TomTomMap, config?: PlacesModuleConfig<P>): Promise<PlacesModule>;
|
|
8762
9298
|
private constructor();
|
|
9299
|
+
private colorOf;
|
|
8763
9300
|
/**
|
|
8764
9301
|
* @ignore
|
|
8765
9302
|
*/
|
|
@@ -8784,33 +9321,12 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
8784
9321
|
*/
|
|
8785
9322
|
protected restoreDataAndConfigImpl(): void;
|
|
8786
9323
|
/**
|
|
8787
|
-
*
|
|
8788
|
-
*
|
|
8789
|
-
* @param theme - The theme style to apply to place markers.
|
|
9324
|
+
* Changes the {@link PlacesMarkerType | kind of marker} places are drawn with.
|
|
8790
9325
|
*
|
|
8791
9326
|
* @remarks
|
|
8792
|
-
*
|
|
8793
|
-
* - `pin`: Traditional teardrop-shaped map pins
|
|
8794
|
-
* - `circle-icon`: Simple circular markers (previously named `circle`)
|
|
8795
|
-
* - `base-map`: Mimics the map's built-in POI layer style with category icons (combines `main`, `selected`, and `micro`). For micro-only rendering, hide the `main` layer via `layers.main.layout.visibility = 'none'`.
|
|
8796
|
-
* - `pin-clustered`: `pin` markers that merge into counted clusters while zoomed out, configured by {@link PlacesModuleConfig.cluster}.
|
|
8797
|
-
*
|
|
8798
|
-
* Changes apply immediately to all currently shown places. Other configuration
|
|
8799
|
-
* properties (icon config, text config) remain unchanged.
|
|
8800
|
-
*
|
|
8801
|
-
* @example
|
|
8802
|
-
* ```typescript
|
|
8803
|
-
* // Switch to pin markers
|
|
8804
|
-
* placesModule.applyTheme('pin');
|
|
8805
|
-
*
|
|
8806
|
-
* // Use simple circles
|
|
8807
|
-
* placesModule.applyTheme('circle-icon');
|
|
8808
|
-
*
|
|
8809
|
-
* // Match map's POI style (ideal to blend in)
|
|
8810
|
-
* placesModule.applyTheme('base-map');
|
|
8811
|
-
* ```
|
|
9327
|
+
* Redraws the places already shown, and leaves the rest of the configuration as it is.
|
|
8812
9328
|
*/
|
|
8813
|
-
|
|
9329
|
+
applyMarkerType(markerType: PlacesMarkerType): void;
|
|
8814
9330
|
/**
|
|
8815
9331
|
* Updates the icon configuration for displayed places.
|
|
8816
9332
|
*
|
|
@@ -8825,16 +9341,14 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
8825
9341
|
* ```typescript
|
|
8826
9342
|
* placesModule.applyIconConfig({
|
|
8827
9343
|
* categoryIcons: [
|
|
8828
|
-
* {
|
|
9344
|
+
* { id: 'RESTAURANT', image: '/icons/food.png' }
|
|
8829
9345
|
* ]
|
|
8830
9346
|
* });
|
|
8831
9347
|
* ```
|
|
8832
9348
|
*/
|
|
8833
|
-
applyIconConfig(iconConfig: PlaceIconConfig): void;
|
|
9349
|
+
applyIconConfig<P extends CommonPlaceProps = CommonPlaceProps>(iconConfig: PlaceIconConfig<P>): void;
|
|
8834
9350
|
/**
|
|
8835
|
-
*
|
|
8836
|
-
*
|
|
8837
|
-
* @param textConfig - New text configuration settings.
|
|
9351
|
+
* Replaces the {@link PlacesModuleConfig.label | label} configuration of the displayed places.
|
|
8838
9352
|
*
|
|
8839
9353
|
* @remarks
|
|
8840
9354
|
* Supports both functions and MapLibre expressions for dynamic text.
|
|
@@ -8842,19 +9356,19 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
8842
9356
|
* @example
|
|
8843
9357
|
* ```typescript
|
|
8844
9358
|
* // Use function
|
|
8845
|
-
* placesModule.
|
|
8846
|
-
*
|
|
9359
|
+
* placesModule.applyLabelConfig({
|
|
9360
|
+
* title: (place) => place.properties.poi?.name || 'Unknown'
|
|
8847
9361
|
* });
|
|
8848
9362
|
*
|
|
8849
9363
|
* // Use MapLibre expression
|
|
8850
|
-
* placesModule.
|
|
8851
|
-
*
|
|
9364
|
+
* placesModule.applyLabelConfig({
|
|
9365
|
+
* title: ['get', 'title'],
|
|
8852
9366
|
* size: 14,
|
|
8853
9367
|
* color: '#333'
|
|
8854
9368
|
* });
|
|
8855
9369
|
* ```
|
|
8856
9370
|
*/
|
|
8857
|
-
|
|
9371
|
+
applyLabelConfig<P extends CommonPlaceProps = CommonPlaceProps>(label: PlaceLabelConfig<P>): void;
|
|
8858
9372
|
private applyConfigPart;
|
|
8859
9373
|
/**
|
|
8860
9374
|
* Applies additional feature properties to displayed places.
|
|
@@ -8868,34 +9382,16 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
8868
9382
|
* ```typescript
|
|
8869
9383
|
* placesModule.applyExtraFeatureProps({
|
|
8870
9384
|
* category: (place) => place.properties.poi?.localizedCategories?.[0],
|
|
8871
|
-
*
|
|
9385
|
+
* brand: (place) => place.properties.poi?.brands?.[0] ?? '',
|
|
8872
9386
|
* isOpen: true
|
|
8873
9387
|
* });
|
|
8874
9388
|
* ```
|
|
8875
9389
|
*/
|
|
8876
9390
|
applyExtraFeatureProps<P extends CommonPlaceProps = CommonPlaceProps>(extraFeatureProps: NonNullable<PlacesModuleConfig<P>['extraFeatureProps']>): void;
|
|
8877
|
-
/**
|
|
8878
|
-
|
|
8879
|
-
*
|
|
8880
|
-
* @remarks
|
|
8881
|
-
* `show()` and `clear()` never change it: a hidden module keeps its data and draws it again on
|
|
8882
|
-
* `setVisible(true)`. Showing leaves hidden what the theme does not use, and any layer hidden
|
|
8883
|
-
* through `layers.*.layout.visibility`.
|
|
8884
|
-
*
|
|
8885
|
-
* @example
|
|
8886
|
-
* ```typescript
|
|
8887
|
-
* places.setVisible(false);
|
|
8888
|
-
* await places.show(results); // stays hidden
|
|
8889
|
-
* places.setVisible(true);
|
|
8890
|
-
* ```
|
|
8891
|
-
*/
|
|
8892
|
-
setVisible(visible: boolean): void;
|
|
8893
|
-
/**
|
|
8894
|
-
* Whether the module is set to be shown ({@link PlacesModuleConfig.visible}). A shown module
|
|
8895
|
-
* with no places draws nothing.
|
|
8896
|
-
*/
|
|
8897
|
-
isVisible(): boolean;
|
|
9391
|
+
/** @ignore */
|
|
9392
|
+
protected applyVisibility(config: PlacesModuleConfig | undefined): void;
|
|
8898
9393
|
private updateLayersAndData;
|
|
9394
|
+
private updatePlacesLayers;
|
|
8899
9395
|
private rebuildSourcesAndLayers;
|
|
8900
9396
|
private updateConnectionsData;
|
|
8901
9397
|
private updateEntryPointsData;
|
|
@@ -8913,9 +9409,13 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
8913
9409
|
*
|
|
8914
9410
|
* @remarks
|
|
8915
9411
|
* **Behavior:**
|
|
8916
|
-
* - Replaces any previously shown places
|
|
9412
|
+
* - Replaces any previously shown places, and never merges with them
|
|
9413
|
+
* - Drops the event states of the places it replaces, even of a place shown again under the same
|
|
9414
|
+
* id: an event state lives on the shown feature, so re-select with {@link putEventState} by id.
|
|
9415
|
+
* Places that carry `properties.eventState`, such as `getShown().places`, keep theirs
|
|
9416
|
+
* - Drops the shown connections (see {@link PlaceConnectionDisplay})
|
|
8917
9417
|
* - Applies current module styling configuration
|
|
8918
|
-
* - Automatically generates labels if
|
|
9418
|
+
* - Automatically generates labels if label config is set
|
|
8919
9419
|
* - Waits for module to be ready before displaying
|
|
8920
9420
|
*
|
|
8921
9421
|
* **Data Sources:**
|
|
@@ -8923,6 +9423,8 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
8923
9423
|
* - Custom place objects matching the Place interface
|
|
8924
9424
|
* - GeoJSON Point features
|
|
8925
9425
|
*
|
|
9426
|
+
* {@link ShownPlaces} names the places services whose results are not places, and what shows them.
|
|
9427
|
+
*
|
|
8926
9428
|
* @example
|
|
8927
9429
|
* Display search results:
|
|
8928
9430
|
* ```typescript
|
|
@@ -8956,7 +9458,7 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
8956
9458
|
* Removes all places from the map.
|
|
8957
9459
|
*
|
|
8958
9460
|
* @remarks
|
|
8959
|
-
* - Clears all displayed places
|
|
9461
|
+
* - Clears all displayed places, their event states and the shown connections
|
|
8960
9462
|
* - Does not reset styling configuration
|
|
8961
9463
|
* - Module remains initialized and ready for new data
|
|
8962
9464
|
*
|
|
@@ -9018,7 +9520,9 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
9018
9520
|
* @returns The places currently displayed on the map.
|
|
9019
9521
|
*
|
|
9020
9522
|
* @remarks
|
|
9021
|
-
*
|
|
9523
|
+
* `places` are the places given to `show()` as drawn: each carries the {@link PlaceDisplayProps}
|
|
9524
|
+
* and its current `eventState`. `connections` are the ones given to `showConnections()`, including
|
|
9525
|
+
* any skipped for an id no shown place has.
|
|
9022
9526
|
*
|
|
9023
9527
|
* @example
|
|
9024
9528
|
* ```typescript
|
|
@@ -9038,6 +9542,10 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
9038
9542
|
* @remarks
|
|
9039
9543
|
* Use this to make places appear clicked or hovered programmatically.
|
|
9040
9544
|
*
|
|
9545
|
+
* The state lives on the shown place: a style change, `applyConfig` and a marker type change keep
|
|
9546
|
+
* it, while {@link show} of new results, {@link clear} and a `setStyle` with `resetState` drop
|
|
9547
|
+
* it, whatever the ids.
|
|
9548
|
+
*
|
|
9041
9549
|
* @example
|
|
9042
9550
|
* ```typescript
|
|
9043
9551
|
* // Make first place appear clicked
|
|
@@ -9080,9 +9588,18 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
9080
9588
|
//#endregion
|
|
9081
9589
|
//#region src/places/utils/preparePlacesForDisplay.d.ts
|
|
9082
9590
|
/**
|
|
9083
|
-
*
|
|
9084
|
-
*
|
|
9085
|
-
*
|
|
9591
|
+
* The label {@link PlacesModule} gives a place when {@link PlaceLabelConfig.title} is not a function:
|
|
9592
|
+
* the POI name, else the free-form address.
|
|
9593
|
+
*
|
|
9594
|
+
* @example
|
|
9595
|
+
* ```typescript
|
|
9596
|
+
* // Brand first, the default label otherwise
|
|
9597
|
+
* const places = await PlacesModule.create(map, {
|
|
9598
|
+
* label: { title: (place) => place.properties.poi?.brands?.[0] ?? buildPlaceTitle(place) },
|
|
9599
|
+
* });
|
|
9600
|
+
* ```
|
|
9601
|
+
*
|
|
9602
|
+
* @group Places
|
|
9086
9603
|
*/
|
|
9087
9604
|
export declare const buildPlaceTitle: (place: Place) => string;
|
|
9088
9605
|
/**
|
|
@@ -9102,22 +9619,49 @@ export declare const getPOILayerCategoryForPlace: (place: Place, config?: Places
|
|
|
9102
9619
|
*/
|
|
9103
9620
|
export declare const getPOIGroupForPlace: (place: Place, config?: PlacesModuleConfig) => string | undefined;
|
|
9104
9621
|
/**
|
|
9105
|
-
*
|
|
9106
|
-
*
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
*
|
|
9111
|
-
*
|
|
9622
|
+
* Turns any of the shapes {@link PlacesModule.show} accepts into one {@link Places} collection.
|
|
9623
|
+
*
|
|
9624
|
+
* @remarks
|
|
9625
|
+
* A `shown-features` handler receives the input of `show()` as it was given, in any of those shapes.
|
|
9626
|
+
*
|
|
9627
|
+
* @example
|
|
9628
|
+
* ```typescript
|
|
9629
|
+
* places.events.on('shown-features', (shown) => {
|
|
9630
|
+
* if ('places' in shown) renderResultList(toPlaces(shown.places).features);
|
|
9631
|
+
* });
|
|
9632
|
+
* ```
|
|
9633
|
+
*
|
|
9634
|
+
* @group Places
|
|
9112
9635
|
*/
|
|
9113
|
-
export declare const
|
|
9114
|
-
//#endregion
|
|
9115
|
-
//#region src/pois/layers/poisLayers.d.ts
|
|
9636
|
+
export declare const toPlaces: (places: ShownPlaces) => Places;
|
|
9116
9637
|
/**
|
|
9117
|
-
*
|
|
9118
|
-
*
|
|
9638
|
+
* What {@link PlacesModule.show} does to the places it is given before drawing them.
|
|
9639
|
+
*
|
|
9640
|
+
* @remarks
|
|
9641
|
+
* `show()` calls it itself; call it to see what the layers, `layers.*` overrides and click handlers
|
|
9642
|
+
* read. Each place keeps its properties and gains the {@link PlaceDisplayProps}:
|
|
9643
|
+
*
|
|
9644
|
+
* - `id`: the place's, or a generated one, copied into `properties` for MapLibre's `promoteId`
|
|
9645
|
+
* - `title`: {@link PlaceLabelConfig.title} when it is a function, else {@link buildPlaceTitle}
|
|
9646
|
+
* - `iconID`: the image the marker type and {@link PlaceIconConfig} pick
|
|
9647
|
+
* - `category` and `group` under the `base-map` and `pin-clustered` marker types
|
|
9648
|
+
* - every {@link PlacesModuleConfig.extraFeatureProps} entry, and the EV availability ones when
|
|
9649
|
+
* {@link EVAvailabilityConfig.enabled} is set
|
|
9650
|
+
*
|
|
9651
|
+
* An `iconID` naming an image the module adds itself, the default pin or a
|
|
9652
|
+
* {@link PlaceIconConfig.categoryIcons} entry, is the first module's name for it.
|
|
9653
|
+
* {@link PlacesModule.getShown} returns a given module's places as it drew them.
|
|
9654
|
+
*
|
|
9655
|
+
* @example
|
|
9656
|
+
* ```typescript
|
|
9657
|
+
* const [first] = preparePlacesForDisplay(await discoverPlaces({ query: 'coffee' }), { markerType: 'base-map' }).features;
|
|
9658
|
+
* first.properties.title; // what the label shows
|
|
9659
|
+
* first.properties.category; // what the base-map look keys its colour on
|
|
9660
|
+
* ```
|
|
9661
|
+
*
|
|
9662
|
+
* @group Places
|
|
9119
9663
|
*/
|
|
9120
|
-
export declare const
|
|
9664
|
+
export declare const preparePlacesForDisplay: <P extends CommonPlaceProps = CommonPlaceProps>(shownPlaces: ShownPlaces, config?: PlacesModuleConfig<P>) => Places<DisplayPlaceProps>;
|
|
9121
9665
|
//#endregion
|
|
9122
9666
|
//#region src/pois/types/poiCategoryGroups.d.ts
|
|
9123
9667
|
/**
|
|
@@ -9156,12 +9700,7 @@ export declare const poiLayerIDs: string[];
|
|
|
9156
9700
|
* @example
|
|
9157
9701
|
* Use with POI module filtering:
|
|
9158
9702
|
* ```ts
|
|
9159
|
-
* poisModule.
|
|
9160
|
-
* categoryFilter: {
|
|
9161
|
-
* mode: 'show',
|
|
9162
|
-
* values: ['FOOD_DRINKS_GROUP', 'ENTERTAINMENT_GROUP']
|
|
9163
|
-
* }
|
|
9164
|
-
* });
|
|
9703
|
+
* poisModule.filterCategories({ show: 'only', values: ['FOOD_DRINKS_GROUP', 'ENTERTAINMENT_GROUP'] });
|
|
9165
9704
|
* ```
|
|
9166
9705
|
*
|
|
9167
9706
|
* @see {@link POICategoryGroup} - Type representing all available group names
|
|
@@ -9169,7 +9708,21 @@ export declare const poiLayerIDs: string[];
|
|
|
9169
9708
|
*
|
|
9170
9709
|
* @group POIs
|
|
9171
9710
|
*/
|
|
9172
|
-
export declare const poiCategoryGroups:
|
|
9711
|
+
export declare const poiCategoryGroups: {
|
|
9712
|
+
FOOD_DRINKS_GROUP: ("CAFE_PUB" | "DELICATESSEN" | "FAST_FOOD" | "PUB" | "RESTAURANT" | "SOUL_FOOD" | "WINERY")[];
|
|
9713
|
+
SHOPPING_GROUP: ("CLOTHING_SHOP" | "CONVENIENCE_STORE" | "DEPARTMENT_STORE" | "ELECTRICAL_APPLIANCES_SHOP" | "FOOD_MARKET" | "GROCERY_STORE" | "HARDWARE_STORE" | "MALL" | "MARKETPLACE" | "SHOP_OR_STORE" | "SUPERMARKET")[];
|
|
9714
|
+
TRANSPORTATION_GROUP: ("AIRPORT" | "BUS_STOP" | "FERRY_TERMINAL" | "HELIPORT_OR_HELIPAD" | "PUBLIC_TRANSPORT_STOP" | "RAILWAY_STATION" | "TAXI_STAND")[];
|
|
9715
|
+
HEALTH_GROUP: ("DENTIST" | "DOCTOR" | "EMERGENCY_MEDICAL_SERVICE" | "EMERGENCY_ROOM" | "HEALTHCARE_SERVICE" | "HOSPITAL" | "PHARMACY" | "WELFARE_ORGANIZATION")[];
|
|
9716
|
+
PARKING_GROUP: ("OPEN_CAR_PARKING_AREA" | "PARKING_GARAGE")[];
|
|
9717
|
+
HOLIDAY_TOURISM_GROUP: ("AMUSEMENT_PARK" | "BEACH" | "HOLIDAY_RENTAL" | "LEISURE_CENTER" | "MOUNTAIN_PASS" | "MOUNTAIN_PEAK" | "MUSEUM" | "NATURAL_FEATURE" | "TOURIST_ATTRACTION" | "TOURIST_INFORMATION" | "VIEWPOINT")[];
|
|
9718
|
+
EV_CHARGING_STATIONS_GROUP: "CHARGING_LOCATION"[];
|
|
9719
|
+
GAS_STATIONS_GROUP: "FUEL_STATION"[];
|
|
9720
|
+
ACCOMMODATION_GROUP: ("CAMPING_GROUND" | "HOLIDAY_RENTAL" | "HOTEL_OR_MOTEL")[];
|
|
9721
|
+
ENTERTAINMENT_GROUP: ("CASINO_AND_GAMBLING" | "CINEMA" | "CLUB_AND_ASSOCIATION" | "CONCERT_HALL" | "ENTERTAINMENT" | "MOVIE_THEATER" | "NIGHTLIFE" | "THEATER")[];
|
|
9722
|
+
SPORTS_LEISURE_GROUP: ("BEACH" | "GOLF_COURSE" | "ICE_RINK" | "LEISURE_CENTER" | "MOUNTAIN_PASS" | "MOUNTAIN_PEAK" | "SPORTS_CENTER" | "STADIUM" | "SWIMMING_POOL" | "WATER_SPORT")[];
|
|
9723
|
+
EDUCATION_GROUP: ("COLLEGE_OR_UNIVERSITY" | "CULTURAL_CENTER" | "PUBLIC_LIBRARY" | "SCHOOL")[];
|
|
9724
|
+
GOVERNMENT_GROUP: ("COURTHOUSE" | "EMBASSY" | "FIRE_STATION" | "GOVERNMENT_OFFICE" | "POLICE_STATION")[];
|
|
9725
|
+
};
|
|
9173
9726
|
/**
|
|
9174
9727
|
* POI category group type.
|
|
9175
9728
|
*
|
|
@@ -9356,6 +9909,55 @@ type POIsModuleConfig = MapModuleCommonConfig & {
|
|
|
9356
9909
|
};
|
|
9357
9910
|
};
|
|
9358
9911
|
//#endregion
|
|
9912
|
+
//#region src/pois/types/poisKnobs.d.ts
|
|
9913
|
+
/**
|
|
9914
|
+
* The id of a POIs knob: its path into {@link POIsModuleConfig}. See {@link poisKnobCatalogue} for
|
|
9915
|
+
* what each one does.
|
|
9916
|
+
*
|
|
9917
|
+
* @group POIs
|
|
9918
|
+
*/
|
|
9919
|
+
type POIsKnobId = 'visible' | `filters.categories.${keyof ValuesFilter<unknown>}`;
|
|
9920
|
+
/**
|
|
9921
|
+
* The value type a given POIs knob takes: the plain value its path holds in {@link POIsModuleConfig}.
|
|
9922
|
+
*
|
|
9923
|
+
* @group POIs
|
|
9924
|
+
*/
|
|
9925
|
+
type POIsKnobValueOf<ID extends POIsKnobId> = KnobPlainValue<ValueAt<POIsModuleConfig, ID>>;
|
|
9926
|
+
/**
|
|
9927
|
+
* One entry of {@link poisKnobCatalogue}. The value in force is the one at its path in
|
|
9928
|
+
* {@link POIsModule.getConfig}, else its `default`.
|
|
9929
|
+
*
|
|
9930
|
+
* @group POIs
|
|
9931
|
+
*/
|
|
9932
|
+
type POIsKnob = KnobEntry<POIsKnobId, 'toggle' | 'enum' | 'enums'>;
|
|
9933
|
+
//#endregion
|
|
9934
|
+
//#region src/pois/knobCatalogue.d.ts
|
|
9935
|
+
/**
|
|
9936
|
+
* Every POIs knob with its kind, description, options and, where one value holds everywhere, its
|
|
9937
|
+
* default. Static data, readable with no map loaded.
|
|
9938
|
+
*
|
|
9939
|
+
* @remarks
|
|
9940
|
+
* A knob is a plain display value in {@link POIsModuleConfig}, at the path its id names: whether
|
|
9941
|
+
* POIs show, and which categories. Not knobs: `events`. How the POIs look — size, zoom, label
|
|
9942
|
+
* colours, micro markers — is the `pois.*` {@link StylingModule} knobs'.
|
|
9943
|
+
*
|
|
9944
|
+
* @group POIs
|
|
9945
|
+
*/
|
|
9946
|
+
export declare const poisKnobCatalogue: readonly POIsKnob[];
|
|
9947
|
+
/**
|
|
9948
|
+
* Every POIs knob id, in catalogue order.
|
|
9949
|
+
*
|
|
9950
|
+
* @group POIs
|
|
9951
|
+
*/
|
|
9952
|
+
export declare const poisKnobIds: readonly POIsKnobId[];
|
|
9953
|
+
//#endregion
|
|
9954
|
+
//#region src/pois/layers/poisLayers.d.ts
|
|
9955
|
+
/**
|
|
9956
|
+
* Layer IDs for POIs on the map.
|
|
9957
|
+
* @ignore
|
|
9958
|
+
*/
|
|
9959
|
+
export declare const poiLayerIDs: string[];
|
|
9960
|
+
//#endregion
|
|
9359
9961
|
//#region src/pois/types/poisModuleFeature.d.ts
|
|
9360
9962
|
/**
|
|
9361
9963
|
* A GeoJSON feature representing a POI from the vector tile map.
|
|
@@ -9462,6 +10064,7 @@ type PoIsSourcesAndLayers = {
|
|
|
9462
10064
|
* `pois.microMarkers` hides the micro markers within the POIs this module shows, and never shows
|
|
9463
10065
|
* them while this module hides the POIs.
|
|
9464
10066
|
* See [Who owns what](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#who-owns-what).
|
|
10067
|
+
* {@link poisKnobCatalogue} lists the settings of its configuration a knob holds.
|
|
9465
10068
|
*
|
|
9466
10069
|
* **Features:**
|
|
9467
10070
|
* - Toggle POI visibility on/off
|
|
@@ -9591,9 +10194,9 @@ export declare class POIsModule extends AbstractStyleOwnedMapModule<PoIsSourcesA
|
|
|
9591
10194
|
*/
|
|
9592
10195
|
protected _applyConfig(config: POIsModuleConfig | undefined): POIsModuleConfig | undefined;
|
|
9593
10196
|
/**
|
|
9594
|
-
*
|
|
10197
|
+
* Whether the POIs are set to be shown.
|
|
9595
10198
|
*
|
|
9596
|
-
* @returns `
|
|
10199
|
+
* @returns The `visible` setting; while nothing has set it, whether the style draws any POI layer.
|
|
9597
10200
|
*
|
|
9598
10201
|
* @example
|
|
9599
10202
|
* ```typescript
|
|
@@ -10349,16 +10952,13 @@ type ChargingStopIconConfig = {
|
|
|
10349
10952
|
mapping?: ChargingStopIconMapping;
|
|
10350
10953
|
};
|
|
10351
10954
|
/**
|
|
10352
|
-
*
|
|
10353
|
-
*
|
|
10354
|
-
* @remarks
|
|
10355
|
-
* Controls the visibility and content of text labels associated with charging stop markers.
|
|
10955
|
+
* The labels beside the charging stop markers along the route: whether they show, and their text.
|
|
10356
10956
|
*
|
|
10357
10957
|
* @group Routing
|
|
10358
10958
|
*/
|
|
10359
|
-
type
|
|
10959
|
+
type ChargingStopLabelConfig = {
|
|
10360
10960
|
/**
|
|
10361
|
-
* Controls the visibility of
|
|
10961
|
+
* Controls the visibility of the charging stop labels.
|
|
10362
10962
|
*
|
|
10363
10963
|
* @defaultValue true
|
|
10364
10964
|
*/
|
|
@@ -10389,12 +10989,9 @@ type ChargingStopsConfig = {
|
|
|
10389
10989
|
*/
|
|
10390
10990
|
visible?: boolean;
|
|
10391
10991
|
/**
|
|
10392
|
-
*
|
|
10393
|
-
*
|
|
10394
|
-
* @remarks
|
|
10395
|
-
* Can control both content and display properties of the text shown next to charging stop icons.
|
|
10992
|
+
* The labels beside the charging stop icons: whether they show, and their text.
|
|
10396
10993
|
*/
|
|
10397
|
-
|
|
10994
|
+
label?: ChargingStopLabelConfig;
|
|
10398
10995
|
/**
|
|
10399
10996
|
* Display configuration for charging stop icons.
|
|
10400
10997
|
*/
|
|
@@ -10470,8 +11067,9 @@ type RouteWidth = 's' | 'm' | 'l';
|
|
|
10470
11067
|
* Route waypoint icon size preset.
|
|
10471
11068
|
*
|
|
10472
11069
|
* @remarks
|
|
10473
|
-
* Controls the scale of waypoint
|
|
10474
|
-
* 1.25 × `"m"`. {@link RoutingModuleConfig.waypointSizeFactor}
|
|
11070
|
+
* Controls the scale of waypoint pins, and of the stop number inside them, at all zoom levels:
|
|
11071
|
+
* `"s"` is 0.75 × `"m"` and `"l"` is 1.25 × `"m"`. {@link RoutingModuleConfig.waypointSizeFactor}
|
|
11072
|
+
* multiplies whichever preset applies.
|
|
10475
11073
|
*
|
|
10476
11074
|
* Available options:
|
|
10477
11075
|
* - `"s"` - Small icons
|
|
@@ -10481,6 +11079,15 @@ type RouteWidth = 's' | 'm' | 'l';
|
|
|
10481
11079
|
* @group Routing
|
|
10482
11080
|
*/
|
|
10483
11081
|
type RouteWaypointSize = 's' | 'm' | 'l';
|
|
11082
|
+
/**
|
|
11083
|
+
* Where a section's icon sits on it.
|
|
11084
|
+
*
|
|
11085
|
+
* - `center`: one icon at the middle of each section.
|
|
11086
|
+
* - `along`: icons repeated along the section.
|
|
11087
|
+
*
|
|
11088
|
+
* @group Routing
|
|
11089
|
+
*/
|
|
11090
|
+
type SectionIconPlacement = 'center' | 'along';
|
|
10484
11091
|
/**
|
|
10485
11092
|
* The icon drawn on a route section.
|
|
10486
11093
|
*
|
|
@@ -10499,18 +11106,15 @@ type SectionIconConfig = {
|
|
|
10499
11106
|
/**
|
|
10500
11107
|
* Where the icon sits on the section.
|
|
10501
11108
|
*
|
|
10502
|
-
* @remarks
|
|
10503
|
-
* - `center`: one icon at the middle of each section.
|
|
10504
|
-
* - `along`: icons repeated along the section.
|
|
10505
|
-
*
|
|
10506
11109
|
* @defaultValue `"center"` on the generated types; the bespoke types that draw an icon keep their own placement.
|
|
10507
11110
|
*/
|
|
10508
|
-
placement?:
|
|
11111
|
+
placement?: SectionIconPlacement;
|
|
10509
11112
|
/**
|
|
10510
|
-
*
|
|
10511
|
-
*
|
|
11113
|
+
* Multiplier over the size the type draws its icon at: the sprite image's own size on the
|
|
11114
|
+
* generated types, the zoom-ramped size on `ferry`, `tollRoad`, `tunnel` and
|
|
11115
|
+
* `vehicleRestricted`. Clamped to {@link SECTION_ICON_SIZE_FACTOR_RANGE}, 0.25 to 2.
|
|
10512
11116
|
*
|
|
10513
|
-
* @defaultValue `1`
|
|
11117
|
+
* @defaultValue `1`
|
|
10514
11118
|
*/
|
|
10515
11119
|
sizeFactor?: number;
|
|
10516
11120
|
};
|
|
@@ -10806,21 +11410,32 @@ type RoutingBeforeLayerConfig = PartsBeforeLayerConfig<'mainLines' | 'instructio
|
|
|
10806
11410
|
* Provides customization options for route visualization and behavior,
|
|
10807
11411
|
* including display units, waypoint handling, and layer styling.
|
|
10808
11412
|
*
|
|
11413
|
+
* @see {@link RoutingModuleSerializableConfig} for the part that survives JSON.
|
|
11414
|
+
*
|
|
10809
11415
|
* @group Routing
|
|
10810
11416
|
*/
|
|
10811
11417
|
type RoutingModuleConfig = MapModuleCommonConfig & {
|
|
10812
11418
|
/**
|
|
10813
|
-
*
|
|
11419
|
+
* Whether the module draws anything: route lines, waypoints, sections, guidance, charging stops,
|
|
11420
|
+
* summary bubbles and border crossings.
|
|
10814
11421
|
*
|
|
10815
11422
|
* @remarks
|
|
10816
|
-
*
|
|
10817
|
-
*
|
|
11423
|
+
* `showRoutes()`, `showWaypoints()` and the clear methods never change it — a hidden module keeps
|
|
11424
|
+
* its data until {@link RoutingModule.setVisible} shows it again. While shown, each part's own
|
|
11425
|
+
* `visible` (`sections.<type>.visible`, `summaryBubbles.visible`, …) still decides whether it draws.
|
|
10818
11426
|
*
|
|
10819
|
-
*
|
|
10820
|
-
|
|
10821
|
-
|
|
11427
|
+
* @default true
|
|
11428
|
+
*/
|
|
11429
|
+
visible?: boolean;
|
|
11430
|
+
/**
|
|
11431
|
+
* Units of the distances and durations the module writes on the map.
|
|
11432
|
+
*
|
|
11433
|
+
* @remarks
|
|
11434
|
+
* Laid over the global configuration's display units field by field: a field left unset keeps
|
|
11435
|
+
* the global value. `distance.type` picks the unit system (`metric`, `imperial_us` or
|
|
11436
|
+
* `imperial_uk`); the other fields relabel the units.
|
|
10822
11437
|
*
|
|
10823
|
-
* @defaultValue `
|
|
11438
|
+
* @defaultValue the global configuration's `displayUnits`
|
|
10824
11439
|
*/
|
|
10825
11440
|
displayUnits?: DisplayUnits;
|
|
10826
11441
|
/**
|
|
@@ -10845,7 +11460,7 @@ type RoutingModuleConfig = MapModuleCommonConfig & {
|
|
|
10845
11460
|
*
|
|
10846
11461
|
* @remarks
|
|
10847
11462
|
* Clamped to {@link ROUTE_WIDTH_FACTOR_RANGE}, 0.5 to 2. Sections without a `widthFactor` of
|
|
10848
|
-
* their own follow it.
|
|
11463
|
+
* their own follow it, and so do the instruction arrows, which no preset resizes.
|
|
10849
11464
|
*
|
|
10850
11465
|
* @defaultValue `1`
|
|
10851
11466
|
*/
|
|
@@ -10937,6 +11552,82 @@ type RoutingModuleConfig = MapModuleCommonConfig & {
|
|
|
10937
11552
|
*/
|
|
10938
11553
|
layers?: RouteLayersConfig;
|
|
10939
11554
|
};
|
|
11555
|
+
/**
|
|
11556
|
+
* The part of a {@link RoutingModuleConfig} that survives JSON, for saving
|
|
11557
|
+
* `getConfig()` and replaying it with `applyConfig()`.
|
|
11558
|
+
*
|
|
11559
|
+
* @remarks
|
|
11560
|
+
* It leaves out what JSON cannot carry, which a replay adds back in code:
|
|
11561
|
+
* - `chargingStops.icon.mapping` with `basedOn: 'custom'`, whose `fn` is a function.
|
|
11562
|
+
* - `chargingStops.icon.customIcons[].image` as an `HTMLImageElement` — see {@link SerializableCustomImage}.
|
|
11563
|
+
*
|
|
11564
|
+
* @group Routing
|
|
11565
|
+
*/
|
|
11566
|
+
type RoutingModuleSerializableConfig = Omit<RoutingModuleConfig, 'chargingStops'> & {
|
|
11567
|
+
chargingStops?: Omit<ChargingStopsConfig, 'icon'> & {
|
|
11568
|
+
icon?: Omit<ChargingStopIconConfig, 'customIcons' | 'mapping'> & {
|
|
11569
|
+
customIcons?: SerializableCustomImage[];
|
|
11570
|
+
mapping?: Extract<ChargingStopIconMapping, {
|
|
11571
|
+
basedOn: 'chargingSpeed';
|
|
11572
|
+
}>;
|
|
11573
|
+
};
|
|
11574
|
+
};
|
|
11575
|
+
};
|
|
11576
|
+
//#endregion
|
|
11577
|
+
//#region src/routing/types/routingKnobs.d.ts
|
|
11578
|
+
type LeafPathOf<T> = { [KEY in keyof T & string]-?: NonNullable<T[KEY]> extends object ? `${KEY}.${keyof NonNullable<T[KEY]> & string}` : KEY; }[keyof T & string];
|
|
11579
|
+
/**
|
|
11580
|
+
* The id of a routing knob: its path into {@link RoutingModuleConfig}, e.g. `widthFactor` or
|
|
11581
|
+
* `sections.tunnel.color`. See {@link routingKnobCatalogue} for what each one does.
|
|
11582
|
+
*
|
|
11583
|
+
* @remarks
|
|
11584
|
+
* Each section type contributes only the knobs {@link SectionKnobOf} lists for it.
|
|
11585
|
+
*
|
|
11586
|
+
* @group Routing
|
|
11587
|
+
*/
|
|
11588
|
+
type RoutingKnobId = 'visible' | 'color' | 'width' | 'widthFactor' | 'waypointSize' | 'waypointSizeFactor' | `waypoints.icon.style.${keyof SVGIconStyleOptions}` | 'waypoints.entryPoints' | `displayUnits.distance.${keyof DistanceDisplayUnits}` | `displayUnits.time.${keyof TimeDisplayUnits}` | 'chargingStops.visible' | 'chargingStops.label.visible' | 'summaryBubbles.visible' | `countryCrossings.${keyof CountryCrossingConfig}` | { [T in DrawnSectionType]: `sections.${T}.${LeafPathOf<SectionDisplayConfig<T>>}`; }[DrawnSectionType];
|
|
11589
|
+
/**
|
|
11590
|
+
* The value type a given routing knob takes: the plain value its path holds in {@link RoutingModuleConfig}.
|
|
11591
|
+
*
|
|
11592
|
+
* @group Routing
|
|
11593
|
+
*/
|
|
11594
|
+
type RoutingKnobValueOf<ID extends RoutingKnobId> = KnobPlainValue<ValueAt<RoutingModuleConfig, ID>>;
|
|
11595
|
+
/**
|
|
11596
|
+
* One entry of {@link routingKnobCatalogue}. The value in force is the one at its path in
|
|
11597
|
+
* {@link RoutingModule.getConfig}, else its `default`; with neither, the style or the global config
|
|
11598
|
+
* decides.
|
|
11599
|
+
*
|
|
11600
|
+
* @group Routing
|
|
11601
|
+
*/
|
|
11602
|
+
type RoutingKnob = KnobEntry<RoutingKnobId, Exclude<KnobKind, 'offset' | 'enums' | 'colors'>>;
|
|
11603
|
+
//#endregion
|
|
11604
|
+
//#region src/routing/knobCatalogue.d.ts
|
|
11605
|
+
/**
|
|
11606
|
+
* Every routing knob with its kind, description, range or options and, where one value holds
|
|
11607
|
+
* everywhere, its default: the route-wide knobs first, then each drawn section type's. Static data,
|
|
11608
|
+
* readable with no map loaded.
|
|
11609
|
+
*
|
|
11610
|
+
* @remarks
|
|
11611
|
+
* A knob is a plain display value in {@link RoutingModuleConfig}, at the path its id names. Not
|
|
11612
|
+
* knobs: `layers`, `beforeLayerConfig` and the charging stop icons and title, which take structured
|
|
11613
|
+
* or MapLibre values, and `events`. A `displayUnits` knob left unset follows the global config.
|
|
11614
|
+
*
|
|
11615
|
+
* @group Routing
|
|
11616
|
+
*/
|
|
11617
|
+
export declare const routingKnobCatalogue: readonly RoutingKnob[];
|
|
11618
|
+
/**
|
|
11619
|
+
* Every routing knob id, in catalogue order.
|
|
11620
|
+
*
|
|
11621
|
+
* @group Routing
|
|
11622
|
+
*/
|
|
11623
|
+
export declare const routingKnobIds: readonly RoutingKnobId[];
|
|
11624
|
+
//#endregion
|
|
11625
|
+
//#region src/routing/layers/routeTrafficSectionLayers.d.ts
|
|
11626
|
+
/**
|
|
11627
|
+
* The colour of each delay magnitude a route's traffic section is drawn in.
|
|
11628
|
+
* @ignore
|
|
11629
|
+
*/
|
|
11630
|
+
type TrafficDelayColors = Record<Extract<DelayMagnitude, 'minor' | 'moderate' | 'major'>, string>;
|
|
10940
11631
|
//#endregion
|
|
10941
11632
|
//#region src/routing/layers/routingLayers.d.ts
|
|
10942
11633
|
/**
|
|
@@ -10947,9 +11638,10 @@ type RoutingModuleConfig = MapModuleCommonConfig & {
|
|
|
10947
11638
|
* @param lightDark - The map style's light/dark theme, which the country crossing plaque colours follow.
|
|
10948
11639
|
* @param existingLayerID - The anchor a configured `beforeLayerConfig` target resolves to, given the
|
|
10949
11640
|
* layer it names: that layer when the style has it, else undefined for the top of the stack.
|
|
11641
|
+
* @param trafficColors - The colours traffic sections draw each delay magnitude in.
|
|
10950
11642
|
* @ignore
|
|
10951
11643
|
*/
|
|
10952
|
-
export declare const buildRoutingLayers: (config?: RoutingModuleConfig, layerIDPrefix?: string, instanceIndex?: number, lightDark?: LightDark, existingLayerID?: (layerID: string | undefined) => string | undefined) => Required<RouteLayersConfig>;
|
|
11644
|
+
export declare const buildRoutingLayers: (config?: RoutingModuleConfig, layerIDPrefix?: string, instanceIndex?: number, lightDark?: LightDark, existingLayerID?: (layerID: string | undefined) => string | undefined, trafficColors?: TrafficDelayColors) => Required<RouteLayersConfig>;
|
|
10953
11645
|
/**
|
|
10954
11646
|
* Default routing layers configuration. Calls routingLayers with no parameters.
|
|
10955
11647
|
*
|
|
@@ -11053,11 +11745,17 @@ export declare const ROUTE_WAYPOINT_SIZE_FACTOR_RANGE: KnobRange;
|
|
|
11053
11745
|
* The values {@link SectionIconConfig.sizeFactor} is clamped to.
|
|
11054
11746
|
*
|
|
11055
11747
|
* @remarks
|
|
11056
|
-
*
|
|
11057
|
-
* to half that, and up to twice the image.
|
|
11748
|
+
* From a quarter of the size the section type draws its icon at, to twice that size.
|
|
11058
11749
|
* @group Routing
|
|
11059
11750
|
*/
|
|
11060
11751
|
export declare const SECTION_ICON_SIZE_FACTOR_RANGE: KnobRange;
|
|
11752
|
+
type IconSize = NonNullable<SymbolLayerSpecification['layout']>['icon-size'];
|
|
11753
|
+
/**
|
|
11754
|
+
* The icon size of a section layer under the given {@link SectionIconConfig.sizeFactor}: the size
|
|
11755
|
+
* the layer draws, MapLibre's `1` where it sets none, times the clamped factor.
|
|
11756
|
+
* @ignore
|
|
11757
|
+
*/
|
|
11758
|
+
export declare const getSectionIconSize: (layerIconSize: IconSize, sizeFactor: number) => IconSize;
|
|
11061
11759
|
/**
|
|
11062
11760
|
* How thick a route line is drawn: a preset and a multiplier over it.
|
|
11063
11761
|
* @ignore
|
|
@@ -11078,6 +11776,15 @@ export declare const getLineOutlineWidth: (lineWidth?: RouteLineWidth) => Expres
|
|
|
11078
11776
|
* @ignore
|
|
11079
11777
|
*/
|
|
11080
11778
|
export declare const getWaypointIconSize: (size?: RouteWaypointSize, sizeFactor?: number) => ExpressionSpecification;
|
|
11779
|
+
/**
|
|
11780
|
+
* Returns the text size expression of the stop number drawn inside a waypoint pin.
|
|
11781
|
+
*
|
|
11782
|
+
* @remarks
|
|
11783
|
+
* Scales with the pin by {@link getWaypointIconSize}'s factor: the number's offset is in ems, so
|
|
11784
|
+
* it stays inside the pin head at every size.
|
|
11785
|
+
* @ignore
|
|
11786
|
+
*/
|
|
11787
|
+
export declare const getWaypointIndexTextSize: (size?: RouteWaypointSize, sizeFactor?: number) => ExpressionSpecification;
|
|
11081
11788
|
/**
|
|
11082
11789
|
* Returns the width expression of a section halo for the given width.
|
|
11083
11790
|
*
|
|
@@ -11097,6 +11804,14 @@ export declare const getInstructionLineWidth: (lineWidth?: RouteLineWidth) => Ex
|
|
|
11097
11804
|
* @ignore
|
|
11098
11805
|
*/
|
|
11099
11806
|
export declare const getInstructionOutlineWidth: (lineWidth?: RouteLineWidth) => ExpressionSpecification;
|
|
11807
|
+
/**
|
|
11808
|
+
* Returns the instruction arrow icon size expression for the given width.
|
|
11809
|
+
*
|
|
11810
|
+
* @remarks
|
|
11811
|
+
* Only `widthFactor` scales it, not the preset.
|
|
11812
|
+
* @ignore
|
|
11813
|
+
*/
|
|
11814
|
+
export declare const getInstructionArrowSize: (lineWidth?: RouteLineWidth) => ExpressionSpecification;
|
|
11100
11815
|
/**
|
|
11101
11816
|
* @ignore
|
|
11102
11817
|
*/
|
|
@@ -11992,6 +12707,7 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
11992
12707
|
private layersSpecs;
|
|
11993
12708
|
private layerIDPrefix;
|
|
11994
12709
|
private appliedRouteColor?;
|
|
12710
|
+
private appliedDisplayUnits?;
|
|
11995
12711
|
private readonly shownFeaturesHandlers;
|
|
11996
12712
|
/**
|
|
11997
12713
|
* Make sure the map is ready before create an instance of the module and any other interaction with the map
|
|
@@ -12006,9 +12722,8 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
12006
12722
|
* map is a supported thing to do.
|
|
12007
12723
|
*
|
|
12008
12724
|
* **Configuration Options:**
|
|
12009
|
-
* - `
|
|
12010
|
-
*
|
|
12011
|
-
* - `layers`: Complete layer styling configuration
|
|
12725
|
+
* {@link routingKnobCatalogue} lists every plain-valued display setting; `layers` takes complete
|
|
12726
|
+
* MapLibre layer specs.
|
|
12012
12727
|
*
|
|
12013
12728
|
* **Default Styling:**
|
|
12014
12729
|
* If no custom layers are provided, uses {@link defaultRoutingLayers}.
|
|
@@ -12023,8 +12738,8 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
12023
12738
|
* With custom configuration:
|
|
12024
12739
|
* ```typescript
|
|
12025
12740
|
* const routingModule = await RoutingModule.create(map, {
|
|
12026
|
-
* displayUnits: '
|
|
12027
|
-
*
|
|
12741
|
+
* displayUnits: { distance: { type: 'imperial_us' } },
|
|
12742
|
+
* waypoints: {
|
|
12028
12743
|
* entryPoints: 'main-when-available'
|
|
12029
12744
|
* }
|
|
12030
12745
|
* });
|
|
@@ -12032,6 +12747,7 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
12032
12747
|
*/
|
|
12033
12748
|
static create(tomtomMap: TomTomMap, config?: RoutingModuleConfig): Promise<RoutingModule>;
|
|
12034
12749
|
private constructor();
|
|
12750
|
+
private repaintTrafficSections;
|
|
12035
12751
|
private routeColorOf;
|
|
12036
12752
|
private buildLayersSpecs;
|
|
12037
12753
|
private createSourcesWithLayers;
|
|
@@ -12042,7 +12758,7 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
12042
12758
|
/**
|
|
12043
12759
|
* @ignore
|
|
12044
12760
|
*/
|
|
12045
|
-
protected _applyConfig(config?: RoutingModuleConfig): RoutingModuleConfig;
|
|
12761
|
+
protected _applyConfig(config?: RoutingModuleConfig): RoutingModuleConfig | undefined;
|
|
12046
12762
|
/**
|
|
12047
12763
|
* Shows the speed limit sections, each carrying the sign that posts it.
|
|
12048
12764
|
*
|
|
@@ -12086,16 +12802,19 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
12086
12802
|
*/
|
|
12087
12803
|
private reshowSpeedLimitSigns;
|
|
12088
12804
|
/**
|
|
12089
|
-
*
|
|
12805
|
+
* Draws each part while its source holds features and the module is visible, and a section type
|
|
12806
|
+
* only while its `sections.<type>.visible` is on as well.
|
|
12090
12807
|
*
|
|
12091
12808
|
* @remarks
|
|
12092
|
-
*
|
|
12093
|
-
*
|
|
12094
|
-
*
|
|
12095
|
-
*
|
|
12096
|
-
* shows features and after any config change, in the same
|
|
12809
|
+
* "Has features" alone is not enough for sections. Almost every route has urban stretches, a
|
|
12810
|
+
* tunnel or a country crossing somewhere along it, so it would draw all fifteen types the moment
|
|
12811
|
+
* a route is shown, whatever the caller asked for.
|
|
12812
|
+
*
|
|
12813
|
+
* This runs right after anything that shows features and after any config change, in the same
|
|
12814
|
+
* tick, so nothing renders in between.
|
|
12815
|
+
* @ignore
|
|
12097
12816
|
*/
|
|
12098
|
-
|
|
12817
|
+
protected applyVisibility(config: RoutingModuleConfig | undefined): void;
|
|
12099
12818
|
/** The id of the layer posting this type's signs, for a type that posts them. */
|
|
12100
12819
|
private signLayerID;
|
|
12101
12820
|
/**
|
|
@@ -12385,6 +13104,47 @@ type TerrainModuleConfig = MapModuleCommonConfig & {
|
|
|
12385
13104
|
elevationExaggeration?: number;
|
|
12386
13105
|
};
|
|
12387
13106
|
//#endregion
|
|
13107
|
+
//#region src/terrain/types/terrainKnobs.d.ts
|
|
13108
|
+
/**
|
|
13109
|
+
* The id of a terrain knob: its path into {@link TerrainModuleConfig}, e.g. `hillshade` or
|
|
13110
|
+
* `elevationExaggeration`. See {@link terrainKnobCatalogue} for what each one does.
|
|
13111
|
+
*
|
|
13112
|
+
* @group Terrain
|
|
13113
|
+
*/
|
|
13114
|
+
type TerrainKnobId = Exclude<keyof TerrainModuleConfig, keyof MapModuleCommonConfig>;
|
|
13115
|
+
/**
|
|
13116
|
+
* The value type a given terrain knob takes: the plain value its path holds in {@link TerrainModuleConfig}.
|
|
13117
|
+
*
|
|
13118
|
+
* @group Terrain
|
|
13119
|
+
*/
|
|
13120
|
+
type TerrainKnobValueOf<ID extends TerrainKnobId> = KnobPlainValue<ValueAt<TerrainModuleConfig, ID>>;
|
|
13121
|
+
/**
|
|
13122
|
+
* One entry of {@link terrainKnobCatalogue}. The value in force is the one at its path in
|
|
13123
|
+
* {@link TerrainModule.getConfig}, else its `default`; with neither, the map's own terrain decides.
|
|
13124
|
+
*
|
|
13125
|
+
* @group Terrain
|
|
13126
|
+
*/
|
|
13127
|
+
type TerrainKnob = KnobEntry<TerrainKnobId, 'toggle' | 'number'>;
|
|
13128
|
+
//#endregion
|
|
13129
|
+
//#region src/terrain/knobCatalogue.d.ts
|
|
13130
|
+
/**
|
|
13131
|
+
* Every terrain knob with its kind, description, range and, where one value holds everywhere, its
|
|
13132
|
+
* default. Static data, readable with no map loaded.
|
|
13133
|
+
*
|
|
13134
|
+
* @remarks
|
|
13135
|
+
* A knob is a plain display value in {@link TerrainModuleConfig}, at the path its id names. Not
|
|
13136
|
+
* knobs: `events`.
|
|
13137
|
+
*
|
|
13138
|
+
* @group Terrain
|
|
13139
|
+
*/
|
|
13140
|
+
export declare const terrainKnobCatalogue: readonly TerrainKnob[];
|
|
13141
|
+
/**
|
|
13142
|
+
* Every terrain knob id, in catalogue order.
|
|
13143
|
+
*
|
|
13144
|
+
* @group Terrain
|
|
13145
|
+
*/
|
|
13146
|
+
export declare const terrainKnobIds: readonly TerrainKnobId[];
|
|
13147
|
+
//#endregion
|
|
12388
13148
|
//#region src/terrain/TerrainModule.d.ts
|
|
12389
13149
|
/**
|
|
12390
13150
|
* The style source this module draws from: the raster-dem elevation source of the hillshade
|
|
@@ -12401,6 +13161,7 @@ type TerrainSourcesWithLayers = {
|
|
|
12401
13161
|
* **What this module owns:** whether the hillshade is shown, and whether and how high the surface is raised.
|
|
12402
13162
|
* Shading method, light direction, strength, zoom range and colours are `hillshade.*` {@link StylingModule} knobs.
|
|
12403
13163
|
* See [Who owns what](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#who-owns-what).
|
|
13164
|
+
* {@link terrainKnobCatalogue} lists every setting of its configuration.
|
|
12404
13165
|
*
|
|
12405
13166
|
* - **Hillshade** shades slopes on the flat map, so the relief reads at any pitch.
|
|
12406
13167
|
* - **Elevation** raises the map surface in 3D, which a pitched camera shows. Combined with the
|
|
@@ -12453,7 +13214,9 @@ export declare class TerrainModule extends AbstractStyleOwnedMapModule<TerrainSo
|
|
|
12453
13214
|
*/
|
|
12454
13215
|
setHillshadeVisible(visible: boolean): void;
|
|
12455
13216
|
/**
|
|
12456
|
-
* Whether the hillshade shading is shown.
|
|
13217
|
+
* Whether the hillshade shading is set to be shown.
|
|
13218
|
+
*
|
|
13219
|
+
* @returns The `hillshade` setting; `false` while nothing has set it, as the hillshade is hidden until shown.
|
|
12457
13220
|
*/
|
|
12458
13221
|
isHillshadeVisible(): boolean;
|
|
12459
13222
|
/**
|
|
@@ -12461,7 +13224,9 @@ export declare class TerrainModule extends AbstractStyleOwnedMapModule<TerrainSo
|
|
|
12461
13224
|
*/
|
|
12462
13225
|
setElevationEnabled(enabled: boolean): void;
|
|
12463
13226
|
/**
|
|
12464
|
-
* Whether the map surface is raised in 3D.
|
|
13227
|
+
* Whether the map surface is set to be raised in 3D.
|
|
13228
|
+
*
|
|
13229
|
+
* @returns The `elevation` setting; while nothing has set it, whether the map's own terrain raises it.
|
|
12465
13230
|
*/
|
|
12466
13231
|
isElevationEnabled(): boolean;
|
|
12467
13232
|
/**
|
|
@@ -12957,6 +13722,636 @@ type TrafficAreaAnalyticsModuleConfig = MapModuleCommonConfig & {
|
|
|
12957
13722
|
regionPolygon?: AreaAnalyticsRegionPolygonConfig;
|
|
12958
13723
|
};
|
|
12959
13724
|
//#endregion
|
|
13725
|
+
//#region src/traffic/types/trafficCommonConfig.d.ts
|
|
13726
|
+
/**
|
|
13727
|
+
* Available road hierarchy category identifiers.
|
|
13728
|
+
*
|
|
13729
|
+
* @remarks
|
|
13730
|
+
* These categories represent different levels in the road network hierarchy,
|
|
13731
|
+
* from major highways to local streets.
|
|
13732
|
+
*
|
|
13733
|
+
* @group Traffic
|
|
13734
|
+
*/
|
|
13735
|
+
export declare const roadCategories: readonly ["motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link", "secondary", "secondary_link", "tertiary", "tertiary_link", "street", "service", "track"];
|
|
13736
|
+
/**
|
|
13737
|
+
* Road hierarchy category type.
|
|
13738
|
+
*
|
|
13739
|
+
* @remarks
|
|
13740
|
+
* Classifies roads by their importance and capacity in the transportation network.
|
|
13741
|
+
* Used for filtering traffic data display based on road significance.
|
|
13742
|
+
*
|
|
13743
|
+
* Road hierarchy (from highest to lowest):
|
|
13744
|
+
* - `motorway` / `motorway_link` - High-capacity highways with restricted access
|
|
13745
|
+
* - `trunk` / `trunk_link` - Major inter-city roads
|
|
13746
|
+
* - `primary` / `primary_link` - Primary through routes
|
|
13747
|
+
* - `secondary` / `secondary_link` - Secondary through routes
|
|
13748
|
+
* - `tertiary` / `tertiary_link` - Connecting roads
|
|
13749
|
+
* - `street` - Local streets (see {@link StreetRoadSubCategory})
|
|
13750
|
+
* - `service` - Service roads (see {@link ServiceRoadSubCategory})
|
|
13751
|
+
* - `track` - Unpaved or agricultural tracks
|
|
13752
|
+
*
|
|
13753
|
+
* @group Traffic
|
|
13754
|
+
*/
|
|
13755
|
+
export type RoadCategory = (typeof roadCategories)[number];
|
|
13756
|
+
/**
|
|
13757
|
+
* Available street road sub-category identifiers.
|
|
13758
|
+
*
|
|
13759
|
+
* @remarks
|
|
13760
|
+
* Provides finer granularity for classifying local streets.
|
|
13761
|
+
*
|
|
13762
|
+
* @group Traffic
|
|
13763
|
+
*/
|
|
13764
|
+
export declare const streetRoadSubCategories: readonly ["unclassified", "residential", "living_street"];
|
|
13765
|
+
/**
|
|
13766
|
+
* Street road sub-category type.
|
|
13767
|
+
*
|
|
13768
|
+
* @remarks
|
|
13769
|
+
* Further classifies `street` roads into specific sub-types.
|
|
13770
|
+
*
|
|
13771
|
+
* Sub-categories:
|
|
13772
|
+
* - `unclassified` - Unclassified local roads
|
|
13773
|
+
* - `residential` - Roads in residential areas
|
|
13774
|
+
* - `living_street` - Pedestrian-priority shared streets
|
|
13775
|
+
*
|
|
13776
|
+
* @group Traffic
|
|
13777
|
+
*/
|
|
13778
|
+
export type StreetRoadSubCategory = (typeof streetRoadSubCategories)[number];
|
|
13779
|
+
/**
|
|
13780
|
+
* Available service road sub-category identifiers.
|
|
13781
|
+
*
|
|
13782
|
+
* @remarks
|
|
13783
|
+
* Provides finer granularity for classifying service roads.
|
|
13784
|
+
*
|
|
13785
|
+
* @group Traffic
|
|
13786
|
+
*/
|
|
13787
|
+
export declare const serviceRoadSubCategories: readonly ["parking", "driveway", "alley"];
|
|
13788
|
+
/**
|
|
13789
|
+
* Service road sub-category type.
|
|
13790
|
+
*
|
|
13791
|
+
* @remarks
|
|
13792
|
+
* Further classifies `service` roads into specific sub-types.
|
|
13793
|
+
*
|
|
13794
|
+
* Sub-categories:
|
|
13795
|
+
* - `parking` - Roads within parking areas
|
|
13796
|
+
* - `driveway` - Private access roads
|
|
13797
|
+
* - `alley` - Narrow back-access lanes
|
|
13798
|
+
*
|
|
13799
|
+
* @group Traffic
|
|
13800
|
+
*/
|
|
13801
|
+
export type ServiceRoadSubCategory = (typeof serviceRoadSubCategories)[number];
|
|
13802
|
+
/**
|
|
13803
|
+
* Road sub-category type.
|
|
13804
|
+
*
|
|
13805
|
+
* @remarks
|
|
13806
|
+
* Combines street and service sub-categories. Only `street` and `service` road categories have sub-categories.
|
|
13807
|
+
*
|
|
13808
|
+
* @group Traffic
|
|
13809
|
+
*/
|
|
13810
|
+
export type RoadSubCategory = StreetRoadSubCategory | ServiceRoadSubCategory;
|
|
13811
|
+
/**
|
|
13812
|
+
* Common filter configuration shared between traffic incidents and flow visualization.
|
|
13813
|
+
*
|
|
13814
|
+
* @remarks
|
|
13815
|
+
* Provides road category filtering capabilities used by both incident and flow modules.
|
|
13816
|
+
*
|
|
13817
|
+
* @group Traffic
|
|
13818
|
+
*/
|
|
13819
|
+
export type TrafficCommonFilter = {
|
|
13820
|
+
/**
|
|
13821
|
+
* Filters traffic data by road hierarchy categories.
|
|
13822
|
+
*
|
|
13823
|
+
* @remarks
|
|
13824
|
+
* Controls which road types display traffic information.
|
|
13825
|
+
* Use the `mode` field to specify whether to show or hide the selected categories.
|
|
13826
|
+
*
|
|
13827
|
+
* @example
|
|
13828
|
+
* ```ts
|
|
13829
|
+
* // Show only motorways and trunk roads
|
|
13830
|
+
* roadCategories: { show: 'only', values: ['motorway', 'trunk'] }
|
|
13831
|
+
* ```
|
|
13832
|
+
*/
|
|
13833
|
+
roadCategories?: ValuesFilter<RoadCategory>;
|
|
13834
|
+
/**
|
|
13835
|
+
* Filters traffic data by road sub-categories.
|
|
13836
|
+
*
|
|
13837
|
+
* @remarks
|
|
13838
|
+
* Provides finer-grained control for street and service roads.
|
|
13839
|
+
* Applies to sub-categories of {@link StreetRoadSubCategory} and {@link ServiceRoadSubCategory}.
|
|
13840
|
+
*
|
|
13841
|
+
* @example
|
|
13842
|
+
* ```ts
|
|
13843
|
+
* // Hide minor local streets
|
|
13844
|
+
* roadSubCategories: { show: 'all-except', values: ['living_street'] }
|
|
13845
|
+
* ```
|
|
13846
|
+
*/
|
|
13847
|
+
roadSubCategories?: ValuesFilter<RoadSubCategory>;
|
|
13848
|
+
};
|
|
13849
|
+
//#endregion
|
|
13850
|
+
//#region src/traffic/types/trafficFlowConfig.d.ts
|
|
13851
|
+
/**
|
|
13852
|
+
* Filter configuration for traffic flow visualization.
|
|
13853
|
+
*
|
|
13854
|
+
* @remarks
|
|
13855
|
+
* Extends common traffic filters with flow-specific options,
|
|
13856
|
+
* particularly for highlighting road closures in the flow layer.
|
|
13857
|
+
*
|
|
13858
|
+
* @group Traffic Flow
|
|
13859
|
+
*/
|
|
13860
|
+
export type TrafficFlowFilter = TrafficCommonFilter & {
|
|
13861
|
+
/**
|
|
13862
|
+
* Controls road closure display in the traffic flow layer.
|
|
13863
|
+
*
|
|
13864
|
+
* @remarks
|
|
13865
|
+
* Determines whether to exclusively show road closures or exclude them from display.
|
|
13866
|
+
*
|
|
13867
|
+
* - `'only'` - Display only road closures
|
|
13868
|
+
* - `'all-except'` - Display everything except road closures
|
|
13869
|
+
*
|
|
13870
|
+
* @example
|
|
13871
|
+
* ```ts
|
|
13872
|
+
* // Highlight only road closures
|
|
13873
|
+
* showRoadClosures: 'only'
|
|
13874
|
+
* ```
|
|
13875
|
+
*/
|
|
13876
|
+
showRoadClosures?: FilterShowMode;
|
|
13877
|
+
};
|
|
13878
|
+
/**
|
|
13879
|
+
* Collection of traffic flow filters with OR logic.
|
|
13880
|
+
*
|
|
13881
|
+
* @remarks
|
|
13882
|
+
* Combines multiple flow filter configurations where traffic flow data is shown
|
|
13883
|
+
* if it matches **any** of the provided filter criteria (logical OR).
|
|
13884
|
+
*
|
|
13885
|
+
* @example
|
|
13886
|
+
* ```ts
|
|
13887
|
+
* // Show flow on motorways OR show road closures on any road
|
|
13888
|
+
* filters: {
|
|
13889
|
+
* any: [
|
|
13890
|
+
* { roadCategories: { show: 'only', values: ['motorway'] } },
|
|
13891
|
+
* { showRoadClosures: 'only' }
|
|
13892
|
+
* ]
|
|
13893
|
+
* }
|
|
13894
|
+
* ```
|
|
13895
|
+
*
|
|
13896
|
+
* @group Traffic Flow
|
|
13897
|
+
*/
|
|
13898
|
+
export type TrafficFlowFilters = {
|
|
13899
|
+
/**
|
|
13900
|
+
* Array of flow filters combined with OR logic.
|
|
13901
|
+
*
|
|
13902
|
+
* @remarks
|
|
13903
|
+
* Traffic flow data is displayed if it satisfies at least one of the filter configurations.
|
|
13904
|
+
*/
|
|
13905
|
+
any: TrafficFlowFilter[];
|
|
13906
|
+
};
|
|
13907
|
+
/**
|
|
13908
|
+
* Configuration for traffic flow visualization module.
|
|
13909
|
+
*
|
|
13910
|
+
* @remarks
|
|
13911
|
+
* Controls the display of real-time traffic flow data on road segments,
|
|
13912
|
+
* including styling and filtering options.
|
|
13913
|
+
*
|
|
13914
|
+
* @group Traffic Flow
|
|
13915
|
+
*/
|
|
13916
|
+
export type TrafficFlowModuleConfig = MapModuleCommonConfig & {
|
|
13917
|
+
/**
|
|
13918
|
+
* Controls the visibility of the traffic flow layers.
|
|
13919
|
+
*
|
|
13920
|
+
* @default false
|
|
13921
|
+
*/
|
|
13922
|
+
visible?: boolean;
|
|
13923
|
+
/**
|
|
13924
|
+
* Filter configuration for traffic flow data.
|
|
13925
|
+
*
|
|
13926
|
+
* @remarks
|
|
13927
|
+
* Controls which road segments display traffic flow information
|
|
13928
|
+
* based on road category and closure status.
|
|
13929
|
+
*/
|
|
13930
|
+
filters?: TrafficFlowFilters;
|
|
13931
|
+
};
|
|
13932
|
+
//#endregion
|
|
13933
|
+
//#region src/traffic/types/trafficIncidentOverlayConfig.d.ts
|
|
13934
|
+
/**
|
|
13935
|
+
* The values {@link IncidentFocusStyle.widthFactor} is clamped to.
|
|
13936
|
+
*
|
|
13937
|
+
* @remarks
|
|
13938
|
+
* `1` leaves focused incidents at their normal width; above `1.8` the widened stripe would cover
|
|
13939
|
+
* the focus outline at high zoom.
|
|
13940
|
+
* @group Traffic
|
|
13941
|
+
*/
|
|
13942
|
+
export declare const INCIDENT_FOCUS_WIDTH_FACTOR_RANGE: KnobRange;
|
|
13943
|
+
/**
|
|
13944
|
+
* Visual treatment applied to the focused subset by
|
|
13945
|
+
* {@link TrafficIncidentOverlayModule.setFocus}.
|
|
13946
|
+
*
|
|
13947
|
+
* @group Traffic
|
|
13948
|
+
*/
|
|
13949
|
+
export type IncidentFocusStyle = {
|
|
13950
|
+
/**
|
|
13951
|
+
* Colour of the outline painted beneath the focused stripe.
|
|
13952
|
+
*
|
|
13953
|
+
* @defaultValue `#000` on light map styles, `#FFF` on dark styles
|
|
13954
|
+
*/
|
|
13955
|
+
outlineColor?: string;
|
|
13956
|
+
/**
|
|
13957
|
+
* Multiplier applied to the line width of focused features, clamped to
|
|
13958
|
+
* {@link INCIDENT_FOCUS_WIDTH_FACTOR_RANGE} (`1`–`1.8`); a value that is not a finite number
|
|
13959
|
+
* falls back to the default. `1` disables the width pop while keeping the outline.
|
|
13960
|
+
*
|
|
13961
|
+
* @defaultValue `1.6`
|
|
13962
|
+
*/
|
|
13963
|
+
widthFactor?: number;
|
|
13964
|
+
};
|
|
13965
|
+
/**
|
|
13966
|
+
* Configuration for {@link TrafficIncidentOverlayModule}.
|
|
13967
|
+
*
|
|
13968
|
+
* @group Traffic
|
|
13969
|
+
*/
|
|
13970
|
+
export type TrafficIncidentOverlayModuleConfig = MapModuleCommonConfig & {
|
|
13971
|
+
/**
|
|
13972
|
+
* Whether the incident layers are shown. Defaults to `true`.
|
|
13973
|
+
* `show()` never flips this flag — if `false`, the module loads data but
|
|
13974
|
+
* keeps layers hidden until `setVisible(true)` is called.
|
|
13975
|
+
*/
|
|
13976
|
+
visible?: boolean;
|
|
13977
|
+
/**
|
|
13978
|
+
* Position incident layers before this map-style layer. Pass `'top'` to
|
|
13979
|
+
* pin them above every other layer. Defaults to `'lowestLabel'`, which
|
|
13980
|
+
* keeps incidents below map labels (roads, places, POIs) so labels stay
|
|
13981
|
+
* readable — the same default the routing module and the flat area
|
|
13982
|
+
* analytics layers use.
|
|
13983
|
+
*/
|
|
13984
|
+
beforeLayerConfig?: BeforeLayerConfig;
|
|
13985
|
+
/**
|
|
13986
|
+
* Visual treatment for {@link TrafficIncidentOverlayModule.setFocus}.
|
|
13987
|
+
*
|
|
13988
|
+
* - Omit (or `undefined`) — use the SDK default treatment: an outline beneath
|
|
13989
|
+
* the focused stripe (black on light map styles, white on dark) and a `1.6×` width pop.
|
|
13990
|
+
* - `false` — disable the visual treatment. `setFocus(ids)` still writes
|
|
13991
|
+
* MapLibre `feature-state.focused`, so callers can drive their own
|
|
13992
|
+
* styling (extra layers, sidebar overlays, …) off that state.
|
|
13993
|
+
* - `{ outlineColor?, widthFactor? }` — override individual fields of the
|
|
13994
|
+
* default treatment.
|
|
13995
|
+
*/
|
|
13996
|
+
focus?: false | IncidentFocusStyle;
|
|
13997
|
+
};
|
|
13998
|
+
//#endregion
|
|
13999
|
+
//#region src/traffic/types/trafficIncidentsConfig.d.ts
|
|
14000
|
+
/**
|
|
14001
|
+
* Configuration for filtering traffic incidents by delay duration.
|
|
14002
|
+
*
|
|
14003
|
+
* @remarks
|
|
14004
|
+
* Allows filtering incidents based on whether they cause delays and the severity of those delays.
|
|
14005
|
+
* Useful for focusing on incidents with the most significant traffic impact.
|
|
14006
|
+
*
|
|
14007
|
+
* @group Traffic Incidents
|
|
14008
|
+
*/
|
|
14009
|
+
export type DelayFilter = {
|
|
14010
|
+
/**
|
|
14011
|
+
* Requires incidents to have an associated delay.
|
|
14012
|
+
*
|
|
14013
|
+
* @remarks
|
|
14014
|
+
* When `true`, incidents without delay information will be hidden from the map.
|
|
14015
|
+
* When `false` or omitted, incidents are shown regardless of delay data availability.
|
|
14016
|
+
*
|
|
14017
|
+
* @defaultValue `false`
|
|
14018
|
+
*/
|
|
14019
|
+
mustHaveDelay?: boolean;
|
|
14020
|
+
/**
|
|
14021
|
+
* Minimum delay threshold in minutes.
|
|
14022
|
+
*
|
|
14023
|
+
* @remarks
|
|
14024
|
+
* Only incidents causing delays of at least this duration will be shown.
|
|
14025
|
+
*
|
|
14026
|
+
* **Behavior:**
|
|
14027
|
+
* - If `mustHaveDelay` is `false` or not set, this filter only applies to incidents that have delay data
|
|
14028
|
+
* - Incidents without delay data are still shown (unless `mustHaveDelay` is `true`)
|
|
14029
|
+
*
|
|
14030
|
+
* @example
|
|
14031
|
+
* ```ts
|
|
14032
|
+
* // Show only incidents with delays of 5 minutes or more
|
|
14033
|
+
* delays: { minDelayMinutes: 5 }
|
|
14034
|
+
* ```
|
|
14035
|
+
*/
|
|
14036
|
+
minDelayMinutes?: number;
|
|
14037
|
+
};
|
|
14038
|
+
/**
|
|
14039
|
+
* Filter configuration for traffic incidents visualization.
|
|
14040
|
+
*
|
|
14041
|
+
* @remarks
|
|
14042
|
+
* Extends common traffic filters with incident-specific filtering options
|
|
14043
|
+
* including category, severity, and delay-based filtering.
|
|
14044
|
+
*
|
|
14045
|
+
* @group Traffic Incidents
|
|
14046
|
+
*/
|
|
14047
|
+
export type TrafficIncidentsFilter = TrafficCommonFilter & {
|
|
14048
|
+
/**
|
|
14049
|
+
* Filters incidents by category type.
|
|
14050
|
+
*
|
|
14051
|
+
* @remarks
|
|
14052
|
+
* Controls which types of incidents are displayed on the map.
|
|
14053
|
+
*
|
|
14054
|
+
* @example
|
|
14055
|
+
* ```ts
|
|
14056
|
+
* // Show only accidents and road closures
|
|
14057
|
+
* incidentCategories: { show: 'only', values: ['accident', 'road-closed'] }
|
|
14058
|
+
* ```
|
|
14059
|
+
*/
|
|
14060
|
+
incidentCategories?: ValuesFilter<TrafficIncidentCategory>;
|
|
14061
|
+
/**
|
|
14062
|
+
* Filters incidents by delay severity magnitude.
|
|
14063
|
+
*
|
|
14064
|
+
* @remarks
|
|
14065
|
+
* Controls display based on the severity of traffic delays caused by incidents.
|
|
14066
|
+
*
|
|
14067
|
+
* Available magnitude values:
|
|
14068
|
+
* - `'unknown'` - Unknown delay severity
|
|
14069
|
+
* - `'minor'` - Minor delays
|
|
14070
|
+
* - `'moderate'` - Moderate delays
|
|
14071
|
+
* - `'major'` - Major delays
|
|
14072
|
+
* - `'indefinite'` - Indefinite delays (e.g., road closures)
|
|
14073
|
+
*
|
|
14074
|
+
* @example
|
|
14075
|
+
* ```ts
|
|
14076
|
+
* // Show only major incidents
|
|
14077
|
+
* magnitudes: { show: 'only', values: ['major'] }
|
|
14078
|
+
*
|
|
14079
|
+
* // Show moderate and major incidents
|
|
14080
|
+
* magnitudes: { show: 'only', values: ['moderate', 'major'] }
|
|
14081
|
+
*
|
|
14082
|
+
* // Hide minor incidents
|
|
14083
|
+
* magnitudes: { show: 'all-except', values: ['minor'] }
|
|
14084
|
+
* ```
|
|
14085
|
+
*/
|
|
14086
|
+
magnitudes?: ValuesFilter<DelayMagnitude>;
|
|
14087
|
+
/**
|
|
14088
|
+
* Filters incidents by delay duration.
|
|
14089
|
+
*
|
|
14090
|
+
* @remarks
|
|
14091
|
+
* Allows filtering based on whether incidents have delays and minimum delay thresholds.
|
|
14092
|
+
*/
|
|
14093
|
+
delays?: DelayFilter;
|
|
14094
|
+
};
|
|
14095
|
+
/**
|
|
14096
|
+
* Collection of traffic incident filters with OR logic.
|
|
14097
|
+
*
|
|
14098
|
+
* @remarks
|
|
14099
|
+
* Combines multiple incident filter configurations where an incident is shown
|
|
14100
|
+
* if it matches **any** of the provided filter criteria (logical OR).
|
|
14101
|
+
*
|
|
14102
|
+
* This allows for complex filtering scenarios where incidents from different
|
|
14103
|
+
* categories or with different characteristics can all be displayed.
|
|
14104
|
+
*
|
|
14105
|
+
* @example
|
|
14106
|
+
* ```ts
|
|
14107
|
+
* // Show major incidents OR road closures
|
|
14108
|
+
* filters: {
|
|
14109
|
+
* any: [
|
|
14110
|
+
* { magnitudes: { show: 'only', values: ['major'] } },
|
|
14111
|
+
* { incidentCategories: { show: 'only', values: ['road-closed'] } }
|
|
14112
|
+
* ]
|
|
14113
|
+
* }
|
|
14114
|
+
* ```
|
|
14115
|
+
*
|
|
14116
|
+
* @group Traffic Incidents
|
|
14117
|
+
*/
|
|
14118
|
+
export type TrafficIncidentsFilters = {
|
|
14119
|
+
/**
|
|
14120
|
+
* Array of incident filters combined with OR logic.
|
|
14121
|
+
*
|
|
14122
|
+
* @remarks
|
|
14123
|
+
* An incident is displayed if it satisfies at least one of the filter configurations.
|
|
14124
|
+
*/
|
|
14125
|
+
any: TrafficIncidentsFilter[];
|
|
14126
|
+
};
|
|
14127
|
+
/**
|
|
14128
|
+
* Configuration for the incident icons.
|
|
14129
|
+
*
|
|
14130
|
+
* @group Traffic Incidents
|
|
14131
|
+
*/
|
|
14132
|
+
export type IncidentIconsConfig = {
|
|
14133
|
+
/**
|
|
14134
|
+
* Shows or hides the incident icons, independently of the incident lines.
|
|
14135
|
+
*
|
|
14136
|
+
* @remarks
|
|
14137
|
+
* When omitted, the icons follow the module's `visible`.
|
|
14138
|
+
*/
|
|
14139
|
+
visible?: boolean;
|
|
14140
|
+
};
|
|
14141
|
+
/**
|
|
14142
|
+
* Configuration for traffic incidents module.
|
|
14143
|
+
*
|
|
14144
|
+
* @remarks
|
|
14145
|
+
* One set of `filters` narrows both the incident lines and their icons; `icons` only decides whether
|
|
14146
|
+
* the icons are shown.
|
|
14147
|
+
*
|
|
14148
|
+
* @group Traffic Incidents
|
|
14149
|
+
*/
|
|
14150
|
+
export type TrafficIncidentsModuleConfig = MapModuleCommonConfig & {
|
|
14151
|
+
/**
|
|
14152
|
+
* Controls the visibility of the traffic incident layers, icons included.
|
|
14153
|
+
*
|
|
14154
|
+
* @default false
|
|
14155
|
+
*/
|
|
14156
|
+
visible?: boolean;
|
|
14157
|
+
/**
|
|
14158
|
+
* Which incidents are shown, by category, severity, delay and road type — lines and icons alike.
|
|
14159
|
+
*/
|
|
14160
|
+
filters?: TrafficIncidentsFilters;
|
|
14161
|
+
/**
|
|
14162
|
+
* Configuration specific to the incident icons.
|
|
14163
|
+
*/
|
|
14164
|
+
icons?: IncidentIconsConfig;
|
|
14165
|
+
};
|
|
14166
|
+
//#endregion
|
|
14167
|
+
//#region src/traffic/types/trafficKnobs.d.ts
|
|
14168
|
+
type TrafficKnobKind = Exclude<KnobKind, 'offset' | 'colors' | 'text'>;
|
|
14169
|
+
type ValuesFilterKnobPath<KEY extends string> = `${KEY}.${keyof ValuesFilter<unknown>}`;
|
|
14170
|
+
type KeyOfEither<T> = T extends unknown ? keyof T : never;
|
|
14171
|
+
/**
|
|
14172
|
+
* The id of a traffic flow knob: its path into {@link TrafficFlowModuleConfig}, e.g. `visible` or
|
|
14173
|
+
* `filters.any.0.roadCategories.values`. See {@link trafficFlowKnobCatalogue} for what each one does.
|
|
14174
|
+
*
|
|
14175
|
+
* @remarks
|
|
14176
|
+
* The filter knobs set the first of the `filters.any` alternatives.
|
|
14177
|
+
*
|
|
14178
|
+
* @group Traffic Flow
|
|
14179
|
+
*/
|
|
14180
|
+
type TrafficFlowKnobId = 'visible' | `filters.any.0.${ValuesFilterKnobPath<Exclude<keyof TrafficFlowFilter, 'showRoadClosures'>>}` | 'filters.any.0.showRoadClosures';
|
|
14181
|
+
/**
|
|
14182
|
+
* The value type a given traffic flow knob takes: the plain value its path holds in
|
|
14183
|
+
* {@link TrafficFlowModuleConfig}.
|
|
14184
|
+
*
|
|
14185
|
+
* @group Traffic Flow
|
|
14186
|
+
*/
|
|
14187
|
+
type TrafficFlowKnobValueOf<ID extends TrafficFlowKnobId> = KnobPlainValue<ValueAt<TrafficFlowModuleConfig, ID>>;
|
|
14188
|
+
/**
|
|
14189
|
+
* One entry of {@link trafficFlowKnobCatalogue}. The value in force is the one at its path in
|
|
14190
|
+
* {@link TrafficFlowModule.getConfig}, else its `default`.
|
|
14191
|
+
*
|
|
14192
|
+
* @group Traffic Flow
|
|
14193
|
+
*/
|
|
14194
|
+
type TrafficFlowKnob = KnobEntry<TrafficFlowKnobId, TrafficKnobKind>;
|
|
14195
|
+
/**
|
|
14196
|
+
* The id of a traffic incidents knob: its path into {@link TrafficIncidentsModuleConfig}, e.g.
|
|
14197
|
+
* `icons.visible` or `filters.any.0.magnitudes.values`. See {@link trafficIncidentsKnobCatalogue}
|
|
14198
|
+
* for what each one does.
|
|
14199
|
+
*
|
|
14200
|
+
* @remarks
|
|
14201
|
+
* The filter knobs set the first of the `filters.any` alternatives.
|
|
14202
|
+
*
|
|
14203
|
+
* @group Traffic Incidents
|
|
14204
|
+
*/
|
|
14205
|
+
type TrafficIncidentsKnobId = 'visible' | `icons.${keyof IncidentIconsConfig}` | `filters.any.0.${ValuesFilterKnobPath<Exclude<keyof TrafficIncidentsFilter, 'delays'>>}` | `filters.any.0.delays.${keyof DelayFilter}`;
|
|
14206
|
+
/**
|
|
14207
|
+
* The value type a given traffic incidents knob takes: the plain value its path holds in
|
|
14208
|
+
* {@link TrafficIncidentsModuleConfig}.
|
|
14209
|
+
*
|
|
14210
|
+
* @group Traffic Incidents
|
|
14211
|
+
*/
|
|
14212
|
+
type TrafficIncidentsKnobValueOf<ID extends TrafficIncidentsKnobId> = KnobPlainValue<ValueAt<TrafficIncidentsModuleConfig, ID>>;
|
|
14213
|
+
/**
|
|
14214
|
+
* One entry of {@link trafficIncidentsKnobCatalogue}. The value in force is the one at its path in
|
|
14215
|
+
* {@link TrafficIncidentsModule.getConfig}, else its `default`; with neither, the entry says what
|
|
14216
|
+
* it follows.
|
|
14217
|
+
*
|
|
14218
|
+
* @group Traffic Incidents
|
|
14219
|
+
*/
|
|
14220
|
+
type TrafficIncidentsKnob = KnobEntry<TrafficIncidentsKnobId, TrafficKnobKind>;
|
|
14221
|
+
/**
|
|
14222
|
+
* The id of an incident overlay knob: its path into {@link TrafficIncidentOverlayModuleConfig}.
|
|
14223
|
+
* See {@link trafficIncidentOverlayKnobCatalogue} for what each one does.
|
|
14224
|
+
*
|
|
14225
|
+
* @group Traffic
|
|
14226
|
+
*/
|
|
14227
|
+
type TrafficIncidentOverlayKnobId = 'visible' | `focus.${keyof IncidentFocusStyle}`;
|
|
14228
|
+
/**
|
|
14229
|
+
* The value type a given incident overlay knob takes: the plain value its path holds in
|
|
14230
|
+
* {@link TrafficIncidentOverlayModuleConfig}.
|
|
14231
|
+
*
|
|
14232
|
+
* @group Traffic
|
|
14233
|
+
*/
|
|
14234
|
+
type TrafficIncidentOverlayKnobValueOf<ID extends TrafficIncidentOverlayKnobId> = KnobPlainValue<ValueAt<TrafficIncidentOverlayModuleConfig, ID>>;
|
|
14235
|
+
/**
|
|
14236
|
+
* One entry of {@link trafficIncidentOverlayKnobCatalogue}. The value in force is the one at its
|
|
14237
|
+
* path in {@link TrafficIncidentOverlayModule.getConfig}, else its `default`; with neither, the
|
|
14238
|
+
* map's light/dark theme decides.
|
|
14239
|
+
*
|
|
14240
|
+
* @group Traffic
|
|
14241
|
+
*/
|
|
14242
|
+
type TrafficIncidentOverlayKnob = KnobEntry<TrafficIncidentOverlayKnobId, TrafficKnobKind>;
|
|
14243
|
+
/**
|
|
14244
|
+
* An area analytics knob's path below `metricConfig.<metric>.`, whichever metric takes it.
|
|
14245
|
+
* @ignore
|
|
14246
|
+
*/
|
|
14247
|
+
type AreaAnalyticsMetricKnobLeaf = 'color' | `height.${KeyOfEither<AreaAnalyticsHeightConfig>}` | `filters.${keyof AreaAnalyticsMetricFilter}`;
|
|
14248
|
+
/**
|
|
14249
|
+
* The id of an area analytics knob: its path into {@link TrafficAreaAnalyticsModuleConfig}, e.g.
|
|
14250
|
+
* `displayMode` or `metricConfig.speed.color`. See {@link trafficAreaAnalyticsKnobCatalogue} for
|
|
14251
|
+
* what each one does.
|
|
14252
|
+
*
|
|
14253
|
+
* @remarks
|
|
14254
|
+
* Every metric of {@link AreaAnalyticsMetricKey} takes the same knobs below `metricConfig.<metric>.`.
|
|
14255
|
+
*
|
|
14256
|
+
* @group Traffic Area Analytics
|
|
14257
|
+
*/
|
|
14258
|
+
type TrafficAreaAnalyticsKnobId = 'visible' | 'displayMode' | 'activeMetric' | `regionPolygon.${keyof AreaAnalyticsRegionPolygonConfig}` | `metricConfig.${AreaAnalyticsMetricKey}.${AreaAnalyticsMetricKnobLeaf}`;
|
|
14259
|
+
/**
|
|
14260
|
+
* The value type a given area analytics knob takes: the plain value its path holds in
|
|
14261
|
+
* {@link TrafficAreaAnalyticsModuleConfig}.
|
|
14262
|
+
*
|
|
14263
|
+
* @remarks
|
|
14264
|
+
* `metricConfig.<metric>.color` is a theme name: the custom colour stops the config also takes there
|
|
14265
|
+
* are not a knob value.
|
|
14266
|
+
*
|
|
14267
|
+
* @group Traffic Area Analytics
|
|
14268
|
+
*/
|
|
14269
|
+
type TrafficAreaAnalyticsKnobValueOf<ID extends TrafficAreaAnalyticsKnobId> = KnobPlainValue<ValueAt<TrafficAreaAnalyticsModuleConfig, ID>>;
|
|
14270
|
+
/**
|
|
14271
|
+
* One entry of {@link trafficAreaAnalyticsKnobCatalogue}. The value in force is the one at its path
|
|
14272
|
+
* in {@link TrafficAreaAnalyticsModule.getConfig}, else its `default`; with neither, the entry says
|
|
14273
|
+
* what decides.
|
|
14274
|
+
*
|
|
14275
|
+
* @group Traffic Area Analytics
|
|
14276
|
+
*/
|
|
14277
|
+
type TrafficAreaAnalyticsKnob = KnobEntry<TrafficAreaAnalyticsKnobId, TrafficKnobKind>;
|
|
14278
|
+
//#endregion
|
|
14279
|
+
//#region src/traffic/knobCatalogue.d.ts
|
|
14280
|
+
/**
|
|
14281
|
+
* Every {@link TrafficFlowModule} knob with its kind, description and default. Static data,
|
|
14282
|
+
* readable with no map loaded.
|
|
14283
|
+
*
|
|
14284
|
+
* @remarks
|
|
14285
|
+
* The module owns whether flow is shown and which roads show it; the look of the flow lines is
|
|
14286
|
+
* `StylingModule`'s `traffic.flow.*` knobs. The `filters.any.0.*` knobs set the first of the
|
|
14287
|
+
* `filters.any` alternatives; the further ones a road may match instead are config only, and so
|
|
14288
|
+
* are `events`.
|
|
14289
|
+
*
|
|
14290
|
+
* @group Traffic Flow
|
|
14291
|
+
*/
|
|
14292
|
+
export declare const trafficFlowKnobCatalogue: readonly TrafficFlowKnob[];
|
|
14293
|
+
/**
|
|
14294
|
+
* Every traffic flow knob id, in catalogue order.
|
|
14295
|
+
*
|
|
14296
|
+
* @group Traffic Flow
|
|
14297
|
+
*/
|
|
14298
|
+
export declare const trafficFlowKnobIds: readonly TrafficFlowKnobId[];
|
|
14299
|
+
/**
|
|
14300
|
+
* Every {@link TrafficIncidentsModule} knob with its kind, description and, where one value holds
|
|
14301
|
+
* everywhere, its default. Static data, readable with no map loaded.
|
|
14302
|
+
*
|
|
14303
|
+
* @remarks
|
|
14304
|
+
* The module owns whether incidents are shown and which; their look is `StylingModule`'s
|
|
14305
|
+
* `traffic.incidents.*` knobs. The `filters.any.0.*` knobs set the first of the `filters.any`
|
|
14306
|
+
* alternatives; the further ones an incident may match instead are config only, and so are
|
|
14307
|
+
* `events`.
|
|
14308
|
+
*
|
|
14309
|
+
* @group Traffic Incidents
|
|
14310
|
+
*/
|
|
14311
|
+
export declare const trafficIncidentsKnobCatalogue: readonly TrafficIncidentsKnob[];
|
|
14312
|
+
/**
|
|
14313
|
+
* Every traffic incidents knob id, in catalogue order.
|
|
14314
|
+
*
|
|
14315
|
+
* @group Traffic Incidents
|
|
14316
|
+
*/
|
|
14317
|
+
export declare const trafficIncidentsKnobIds: readonly TrafficIncidentsKnobId[];
|
|
14318
|
+
/**
|
|
14319
|
+
* Every {@link TrafficIncidentOverlayModule} knob with its kind, description, range and, where one
|
|
14320
|
+
* value holds everywhere, its default. Static data, readable with no map loaded.
|
|
14321
|
+
*
|
|
14322
|
+
* @remarks
|
|
14323
|
+
* The incident lines take the colours of the style's own incident layers, which are
|
|
14324
|
+
* `StylingModule`'s `traffic.incidents.*` knobs. Not knobs: `beforeLayerConfig`, `focus: false`,
|
|
14325
|
+
* which turns the focus treatment off, and `events`.
|
|
14326
|
+
*
|
|
14327
|
+
* @group Traffic
|
|
14328
|
+
*/
|
|
14329
|
+
export declare const trafficIncidentOverlayKnobCatalogue: readonly TrafficIncidentOverlayKnob[];
|
|
14330
|
+
/**
|
|
14331
|
+
* Every incident overlay knob id, in catalogue order.
|
|
14332
|
+
*
|
|
14333
|
+
* @group Traffic
|
|
14334
|
+
*/
|
|
14335
|
+
export declare const trafficIncidentOverlayKnobIds: readonly TrafficIncidentOverlayKnobId[];
|
|
14336
|
+
/**
|
|
14337
|
+
* Every {@link TrafficAreaAnalyticsModule} knob with its kind, description, range or options and,
|
|
14338
|
+
* where one value holds everywhere, its default: the module-wide knobs first, then each metric's.
|
|
14339
|
+
* Static data, readable with no map loaded.
|
|
14340
|
+
*
|
|
14341
|
+
* @remarks
|
|
14342
|
+
* Not knobs: custom colour stops, `beforeLayerConfig` and `events`, which take structured values.
|
|
14343
|
+
* The module bounds no height: a height knob's range is the span a UI offers.
|
|
14344
|
+
*
|
|
14345
|
+
* @group Traffic Area Analytics
|
|
14346
|
+
*/
|
|
14347
|
+
export declare const trafficAreaAnalyticsKnobCatalogue: readonly TrafficAreaAnalyticsKnob[];
|
|
14348
|
+
/**
|
|
14349
|
+
* Every area analytics knob id, in catalogue order.
|
|
14350
|
+
*
|
|
14351
|
+
* @group Traffic Area Analytics
|
|
14352
|
+
*/
|
|
14353
|
+
export declare const trafficAreaAnalyticsKnobIds: readonly TrafficAreaAnalyticsKnobId[];
|
|
14354
|
+
//#endregion
|
|
12960
14355
|
//#region src/traffic/layers/areaAnalyticsLayers.d.ts
|
|
12961
14356
|
/**
|
|
12962
14357
|
* Resolves the effective color stops for a given color configuration.
|
|
@@ -13055,6 +14450,8 @@ export declare class TrafficAreaAnalyticsModule extends AbstractDataOwnedMapModu
|
|
|
13055
14450
|
* instance. Every call therefore returns a **new, independent** instance, and stacking several
|
|
13056
14451
|
* of them on one map is a supported thing to do.
|
|
13057
14452
|
*
|
|
14453
|
+
* {@link trafficAreaAnalyticsKnobCatalogue} lists the plain-valued settings of `config` as data.
|
|
14454
|
+
*
|
|
13058
14455
|
* @param tomtomMap - The TomTomMap instance.
|
|
13059
14456
|
* @param config - Optional initial configuration. Omit to use all defaults.
|
|
13060
14457
|
* @returns A promise that resolves with the initialised module.
|
|
@@ -13196,15 +14593,6 @@ export declare class TrafficAreaAnalyticsModule extends AbstractDataOwnedMapModu
|
|
|
13196
14593
|
* @param metrics - Optional list of metrics to clear. When omitted, clears filters for **all** metrics.
|
|
13197
14594
|
*/
|
|
13198
14595
|
clearFilter(metrics?: AreaAnalyticsMetricKey[]): void;
|
|
13199
|
-
/**
|
|
13200
|
-
* Shows or hides all area analytics layers.
|
|
13201
|
-
*/
|
|
13202
|
-
setVisible(visible: boolean): void;
|
|
13203
|
-
/**
|
|
13204
|
-
* Whether the module is set to be shown ({@link TrafficAreaAnalyticsModuleConfig.visible}). A shown
|
|
13205
|
-
* module with no data draws nothing; {@link getShown} holds what is shown.
|
|
13206
|
-
*/
|
|
13207
|
-
isVisible(): boolean;
|
|
13208
14596
|
/**
|
|
13209
14597
|
* Returns the currently displayed data for all visualisation modes.
|
|
13210
14598
|
*/
|
|
@@ -13246,224 +14634,17 @@ export declare class TrafficAreaAnalyticsModule extends AbstractDataOwnedMapModu
|
|
|
13246
14634
|
get events(): CombinedEvents<AreaAnalyticsTileFeature, TrafficAreaAnalyticsModuleConfig, TrafficAreaAnalytics>;
|
|
13247
14635
|
private get mode();
|
|
13248
14636
|
private get activeMetric();
|
|
13249
|
-
private get lightDark();
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
private
|
|
13253
|
-
private
|
|
13254
|
-
private
|
|
13255
|
-
private
|
|
13256
|
-
private
|
|
13257
|
-
private
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
//#region src/traffic/types/trafficCommonConfig.d.ts
|
|
13261
|
-
/**
|
|
13262
|
-
* Available road hierarchy category identifiers.
|
|
13263
|
-
*
|
|
13264
|
-
* @remarks
|
|
13265
|
-
* These categories represent different levels in the road network hierarchy,
|
|
13266
|
-
* from major highways to local streets.
|
|
13267
|
-
*
|
|
13268
|
-
* @group Traffic
|
|
13269
|
-
*/
|
|
13270
|
-
export declare const roadCategories: readonly ["motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link", "secondary", "secondary_link", "tertiary", "tertiary_link", "street", "service", "track"];
|
|
13271
|
-
/**
|
|
13272
|
-
* Road hierarchy category type.
|
|
13273
|
-
*
|
|
13274
|
-
* @remarks
|
|
13275
|
-
* Classifies roads by their importance and capacity in the transportation network.
|
|
13276
|
-
* Used for filtering traffic data display based on road significance.
|
|
13277
|
-
*
|
|
13278
|
-
* Road hierarchy (from highest to lowest):
|
|
13279
|
-
* - `motorway` / `motorway_link` - High-capacity highways with restricted access
|
|
13280
|
-
* - `trunk` / `trunk_link` - Major inter-city roads
|
|
13281
|
-
* - `primary` / `primary_link` - Primary through routes
|
|
13282
|
-
* - `secondary` / `secondary_link` - Secondary through routes
|
|
13283
|
-
* - `tertiary` / `tertiary_link` - Connecting roads
|
|
13284
|
-
* - `street` - Local streets (see {@link StreetRoadSubCategory})
|
|
13285
|
-
* - `service` - Service roads (see {@link ServiceRoadSubCategory})
|
|
13286
|
-
* - `track` - Unpaved or agricultural tracks
|
|
13287
|
-
*
|
|
13288
|
-
* @group Traffic
|
|
13289
|
-
*/
|
|
13290
|
-
export type RoadCategory = (typeof roadCategories)[number];
|
|
13291
|
-
/**
|
|
13292
|
-
* Available street road sub-category identifiers.
|
|
13293
|
-
*
|
|
13294
|
-
* @remarks
|
|
13295
|
-
* Provides finer granularity for classifying local streets.
|
|
13296
|
-
*
|
|
13297
|
-
* @group Traffic
|
|
13298
|
-
*/
|
|
13299
|
-
export declare const streetRoadSubCategories: readonly ["unclassified", "residential", "living_street"];
|
|
13300
|
-
/**
|
|
13301
|
-
* Street road sub-category type.
|
|
13302
|
-
*
|
|
13303
|
-
* @remarks
|
|
13304
|
-
* Further classifies `street` roads into specific sub-types.
|
|
13305
|
-
*
|
|
13306
|
-
* Sub-categories:
|
|
13307
|
-
* - `unclassified` - Unclassified local roads
|
|
13308
|
-
* - `residential` - Roads in residential areas
|
|
13309
|
-
* - `living_street` - Pedestrian-priority shared streets
|
|
13310
|
-
*
|
|
13311
|
-
* @group Traffic
|
|
13312
|
-
*/
|
|
13313
|
-
export type StreetRoadSubCategory = (typeof streetRoadSubCategories)[number];
|
|
13314
|
-
/**
|
|
13315
|
-
* Available service road sub-category identifiers.
|
|
13316
|
-
*
|
|
13317
|
-
* @remarks
|
|
13318
|
-
* Provides finer granularity for classifying service roads.
|
|
13319
|
-
*
|
|
13320
|
-
* @group Traffic
|
|
13321
|
-
*/
|
|
13322
|
-
export declare const serviceRoadSubCategories: readonly ["parking", "driveway", "alley"];
|
|
13323
|
-
/**
|
|
13324
|
-
* Service road sub-category type.
|
|
13325
|
-
*
|
|
13326
|
-
* @remarks
|
|
13327
|
-
* Further classifies `service` roads into specific sub-types.
|
|
13328
|
-
*
|
|
13329
|
-
* Sub-categories:
|
|
13330
|
-
* - `parking` - Roads within parking areas
|
|
13331
|
-
* - `driveway` - Private access roads
|
|
13332
|
-
* - `alley` - Narrow back-access lanes
|
|
13333
|
-
*
|
|
13334
|
-
* @group Traffic
|
|
13335
|
-
*/
|
|
13336
|
-
export type ServiceRoadSubCategory = (typeof serviceRoadSubCategories)[number];
|
|
13337
|
-
/**
|
|
13338
|
-
* Road sub-category type.
|
|
13339
|
-
*
|
|
13340
|
-
* @remarks
|
|
13341
|
-
* Combines street and service sub-categories. Only `street` and `service` road categories have sub-categories.
|
|
13342
|
-
*
|
|
13343
|
-
* @group Traffic
|
|
13344
|
-
*/
|
|
13345
|
-
export type RoadSubCategory = StreetRoadSubCategory | ServiceRoadSubCategory;
|
|
13346
|
-
/**
|
|
13347
|
-
* Common filter configuration shared between traffic incidents and flow visualization.
|
|
13348
|
-
*
|
|
13349
|
-
* @remarks
|
|
13350
|
-
* Provides road category filtering capabilities used by both incident and flow modules.
|
|
13351
|
-
*
|
|
13352
|
-
* @group Traffic
|
|
13353
|
-
*/
|
|
13354
|
-
export type TrafficCommonFilter = {
|
|
13355
|
-
/**
|
|
13356
|
-
* Filters traffic data by road hierarchy categories.
|
|
13357
|
-
*
|
|
13358
|
-
* @remarks
|
|
13359
|
-
* Controls which road types display traffic information.
|
|
13360
|
-
* Use the `mode` field to specify whether to show or hide the selected categories.
|
|
13361
|
-
*
|
|
13362
|
-
* @example
|
|
13363
|
-
* ```ts
|
|
13364
|
-
* // Show only motorways and trunk roads
|
|
13365
|
-
* roadCategories: { show: 'only', values: ['motorway', 'trunk'] }
|
|
13366
|
-
* ```
|
|
13367
|
-
*/
|
|
13368
|
-
roadCategories?: ValuesFilter<RoadCategory>;
|
|
13369
|
-
/**
|
|
13370
|
-
* Filters traffic data by road sub-categories.
|
|
13371
|
-
*
|
|
13372
|
-
* @remarks
|
|
13373
|
-
* Provides finer-grained control for street and service roads.
|
|
13374
|
-
* Applies to sub-categories of {@link StreetRoadSubCategory} and {@link ServiceRoadSubCategory}.
|
|
13375
|
-
*
|
|
13376
|
-
* @example
|
|
13377
|
-
* ```ts
|
|
13378
|
-
* // Hide minor local streets
|
|
13379
|
-
* roadSubCategories: { show: 'all-except', values: ['living_street'] }
|
|
13380
|
-
* ```
|
|
13381
|
-
*/
|
|
13382
|
-
roadSubCategories?: ValuesFilter<RoadSubCategory>;
|
|
13383
|
-
};
|
|
13384
|
-
//#endregion
|
|
13385
|
-
//#region src/traffic/types/trafficFlowConfig.d.ts
|
|
13386
|
-
/**
|
|
13387
|
-
* Filter configuration for traffic flow visualization.
|
|
13388
|
-
*
|
|
13389
|
-
* @remarks
|
|
13390
|
-
* Extends common traffic filters with flow-specific options,
|
|
13391
|
-
* particularly for highlighting road closures in the flow layer.
|
|
13392
|
-
*
|
|
13393
|
-
* @group Traffic Flow
|
|
13394
|
-
*/
|
|
13395
|
-
export type TrafficFlowFilter = TrafficCommonFilter & {
|
|
13396
|
-
/**
|
|
13397
|
-
* Controls road closure display in the traffic flow layer.
|
|
13398
|
-
*
|
|
13399
|
-
* @remarks
|
|
13400
|
-
* Determines whether to exclusively show road closures or exclude them from display.
|
|
13401
|
-
*
|
|
13402
|
-
* - `'show'` - Display only road closures
|
|
13403
|
-
* - `'hide'` - Display everything except road closures
|
|
13404
|
-
*
|
|
13405
|
-
* @example
|
|
13406
|
-
* ```ts
|
|
13407
|
-
* // Highlight only road closures
|
|
13408
|
-
* showRoadClosures: 'show'
|
|
13409
|
-
* ```
|
|
13410
|
-
*/
|
|
13411
|
-
showRoadClosures?: FilterShowMode;
|
|
13412
|
-
};
|
|
13413
|
-
/**
|
|
13414
|
-
* Collection of traffic flow filters with OR logic.
|
|
13415
|
-
*
|
|
13416
|
-
* @remarks
|
|
13417
|
-
* Combines multiple flow filter configurations where traffic flow data is shown
|
|
13418
|
-
* if it matches **any** of the provided filter criteria (logical OR).
|
|
13419
|
-
*
|
|
13420
|
-
* @example
|
|
13421
|
-
* ```ts
|
|
13422
|
-
* // Show flow on motorways OR show road closures on any road
|
|
13423
|
-
* filters: {
|
|
13424
|
-
* any: [
|
|
13425
|
-
* { roadCategories: { show: 'only', values: ['motorway'] } },
|
|
13426
|
-
* { showRoadClosures: 'only' }
|
|
13427
|
-
* ]
|
|
13428
|
-
* }
|
|
13429
|
-
* ```
|
|
13430
|
-
*
|
|
13431
|
-
* @group Traffic Flow
|
|
13432
|
-
*/
|
|
13433
|
-
export type TrafficFlowFilters = {
|
|
13434
|
-
/**
|
|
13435
|
-
* Array of flow filters combined with OR logic.
|
|
13436
|
-
*
|
|
13437
|
-
* @remarks
|
|
13438
|
-
* Traffic flow data is displayed if it satisfies at least one of the filter configurations.
|
|
13439
|
-
*/
|
|
13440
|
-
any: TrafficFlowFilter[];
|
|
13441
|
-
};
|
|
13442
|
-
/**
|
|
13443
|
-
* Configuration for traffic flow visualization module.
|
|
13444
|
-
*
|
|
13445
|
-
* @remarks
|
|
13446
|
-
* Controls the display of real-time traffic flow data on road segments,
|
|
13447
|
-
* including styling and filtering options.
|
|
13448
|
-
*
|
|
13449
|
-
* @group Traffic Flow
|
|
13450
|
-
*/
|
|
13451
|
-
export type TrafficFlowModuleConfig = MapModuleCommonConfig & {
|
|
13452
|
-
/**
|
|
13453
|
-
* Controls the visibility of the traffic flow layers.
|
|
13454
|
-
*
|
|
13455
|
-
* @default false
|
|
13456
|
-
*/
|
|
13457
|
-
visible?: boolean;
|
|
13458
|
-
/**
|
|
13459
|
-
* Filter configuration for traffic flow data.
|
|
13460
|
-
*
|
|
13461
|
-
* @remarks
|
|
13462
|
-
* Controls which road segments display traffic flow information
|
|
13463
|
-
* based on road category and closure status.
|
|
13464
|
-
*/
|
|
13465
|
-
filters?: TrafficFlowFilters;
|
|
13466
|
-
};
|
|
14637
|
+
private get lightDark();
|
|
14638
|
+
/** @ignore */
|
|
14639
|
+
protected applyVisibility(config: TrafficAreaAnalyticsModuleConfig | undefined): void;
|
|
14640
|
+
private hideAllDataLayers;
|
|
14641
|
+
private addHighlightLayersToMap;
|
|
14642
|
+
private setHighlightLayerVisible;
|
|
14643
|
+
private applyLayerConfig;
|
|
14644
|
+
private applyRegionConfig;
|
|
14645
|
+
private applyFiltersToLayers;
|
|
14646
|
+
private buildRegionFC;
|
|
14647
|
+
}
|
|
13467
14648
|
//#endregion
|
|
13468
14649
|
//#region src/traffic/types/trafficFlowFeature.d.ts
|
|
13469
14650
|
/**
|
|
@@ -13617,6 +14798,8 @@ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<Traff
|
|
|
13617
14798
|
* - `ensureAddedToStyle`: Auto-add traffic flow to style if missing
|
|
13618
14799
|
* - `filters`: Road category and type filters
|
|
13619
14800
|
*
|
|
14801
|
+
* {@link trafficFlowKnobCatalogue} lists the plain-valued settings as data.
|
|
14802
|
+
*
|
|
13620
14803
|
* **Style Requirement:**
|
|
13621
14804
|
* Traffic flow must be included in the map style or added via `ensureAddedToStyle`.
|
|
13622
14805
|
*
|
|
@@ -13749,7 +14932,9 @@ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<Traff
|
|
|
13749
14932
|
setVisible(visible: boolean): void;
|
|
13750
14933
|
private _setVisible;
|
|
13751
14934
|
/**
|
|
13752
|
-
*
|
|
14935
|
+
* Whether traffic flow is set to be shown.
|
|
14936
|
+
*
|
|
14937
|
+
* @returns The `visible` setting; `false` while nothing has set it, as traffic is hidden until shown.
|
|
13753
14938
|
*/
|
|
13754
14939
|
isVisible(): boolean;
|
|
13755
14940
|
/**
|
|
@@ -13787,72 +14972,6 @@ export declare class TrafficFlowModule extends AbstractStyleOwnedMapModule<Traff
|
|
|
13787
14972
|
get events(): CombinedEvents<TrafficFlowModuleFeature, TrafficFlowModuleConfig, never>;
|
|
13788
14973
|
}
|
|
13789
14974
|
//#endregion
|
|
13790
|
-
//#region src/traffic/types/trafficIncidentOverlayConfig.d.ts
|
|
13791
|
-
/**
|
|
13792
|
-
* The values {@link IncidentFocusStyle.widthFactor} is clamped to.
|
|
13793
|
-
*
|
|
13794
|
-
* @remarks
|
|
13795
|
-
* `1` leaves focused incidents at their normal width; above `1.8` the widened stripe would cover
|
|
13796
|
-
* the focus outline at high zoom.
|
|
13797
|
-
* @group Traffic
|
|
13798
|
-
*/
|
|
13799
|
-
export declare const INCIDENT_FOCUS_WIDTH_FACTOR_RANGE: KnobRange;
|
|
13800
|
-
/**
|
|
13801
|
-
* Visual treatment applied to the focused subset by
|
|
13802
|
-
* {@link TrafficIncidentOverlayModule.setFocus}.
|
|
13803
|
-
*
|
|
13804
|
-
* @group Traffic
|
|
13805
|
-
*/
|
|
13806
|
-
export type IncidentFocusStyle = {
|
|
13807
|
-
/**
|
|
13808
|
-
* Colour of the outline painted beneath the focused stripe.
|
|
13809
|
-
*
|
|
13810
|
-
* @defaultValue `#000` on light map styles, `#FFF` on dark styles
|
|
13811
|
-
*/
|
|
13812
|
-
outlineColor?: string;
|
|
13813
|
-
/**
|
|
13814
|
-
* Multiplier applied to the line width of focused features, clamped to
|
|
13815
|
-
* {@link INCIDENT_FOCUS_WIDTH_FACTOR_RANGE} (`1`–`1.8`); a value that is not a finite number
|
|
13816
|
-
* falls back to the default. `1` disables the width pop while keeping the outline.
|
|
13817
|
-
*
|
|
13818
|
-
* @defaultValue `1.6`
|
|
13819
|
-
*/
|
|
13820
|
-
widthFactor?: number;
|
|
13821
|
-
};
|
|
13822
|
-
/**
|
|
13823
|
-
* Configuration for {@link TrafficIncidentOverlayModule}.
|
|
13824
|
-
*
|
|
13825
|
-
* @group Traffic
|
|
13826
|
-
*/
|
|
13827
|
-
export type TrafficIncidentOverlayModuleConfig = MapModuleCommonConfig & {
|
|
13828
|
-
/**
|
|
13829
|
-
* Whether the incident layers are shown. Defaults to `true`.
|
|
13830
|
-
* `show()` never flips this flag — if `false`, the module loads data but
|
|
13831
|
-
* keeps layers hidden until `setVisible(true)` is called.
|
|
13832
|
-
*/
|
|
13833
|
-
visible?: boolean;
|
|
13834
|
-
/**
|
|
13835
|
-
* Position incident layers before this map-style layer. Pass `'top'` to
|
|
13836
|
-
* pin them above every other layer. Defaults to `'lowestLabel'`, which
|
|
13837
|
-
* keeps incidents below map labels (roads, places, POIs) so labels stay
|
|
13838
|
-
* readable — the same default the routing module and the flat area
|
|
13839
|
-
* analytics layers use.
|
|
13840
|
-
*/
|
|
13841
|
-
beforeLayerConfig?: BeforeLayerConfig;
|
|
13842
|
-
/**
|
|
13843
|
-
* Visual treatment for {@link TrafficIncidentOverlayModule.setFocus}.
|
|
13844
|
-
*
|
|
13845
|
-
* - Omit (or `undefined`) — use the SDK default treatment: an outline beneath
|
|
13846
|
-
* the focused stripe (black on light map styles, white on dark) and a `1.6×` width pop.
|
|
13847
|
-
* - `false` — disable the visual treatment. `setFocus(ids)` still writes
|
|
13848
|
-
* MapLibre `feature-state.focused`, so callers can drive their own
|
|
13849
|
-
* styling (extra layers, sidebar overlays, …) off that state.
|
|
13850
|
-
* - `{ outlineColor?, widthFactor? }` — override individual fields of the
|
|
13851
|
-
* default treatment.
|
|
13852
|
-
*/
|
|
13853
|
-
focus?: false | IncidentFocusStyle;
|
|
13854
|
-
};
|
|
13855
|
-
//#endregion
|
|
13856
14975
|
//#region src/traffic/TrafficIncidentOverlayModule.d.ts
|
|
13857
14976
|
type Sources = {
|
|
13858
14977
|
incidents: GeoJSONSourceWithLayers<TrafficIncidentDetails>;
|
|
@@ -13871,9 +14990,10 @@ type Sources = {
|
|
|
13871
14990
|
* 7–8 layers — 4 to 5 line (optional focus-halo, outline, solid inner, direction chevron,
|
|
13872
14991
|
* pattern inner) and 3 symbol (incident marker, jam marker with delay text, closed-road
|
|
13873
14992
|
* marker). Per-magnitude styling uses match expressions on `magnitudeOfDelay` inside a
|
|
13874
|
-
* single layer instead of one layer per magnitude. Colours are read from the loaded style
|
|
13875
|
-
*
|
|
13876
|
-
* absent
|
|
14993
|
+
* single layer instead of one layer per magnitude. Colours are read from the loaded style's
|
|
14994
|
+
* incident layers (see {@link ./util/readIncidentPalette}), falling back to built-in defaults
|
|
14995
|
+
* when absent, and read again whenever a `traffic.incidents.*Color` styling knob recolours
|
|
14996
|
+
* them. Direction is rendered as a tiled `line-pattern` (chevron sprite registered at
|
|
13877
14997
|
* init) instead of the vector-tile module's per-feature `roads-arrow` symbol — the
|
|
13878
14998
|
* pattern is continuous, so it reads on short jams and at planning zooms (z12+) where
|
|
13879
14999
|
* the per-feature symbol only activates at z15+.
|
|
@@ -13962,16 +15082,22 @@ export declare class TrafficIncidentOverlayModule extends AbstractDataOwnedMapMo
|
|
|
13962
15082
|
* instance. Every call therefore returns a **new, independent** instance, and stacking several
|
|
13963
15083
|
* of them on one map is a supported thing to do.
|
|
13964
15084
|
*
|
|
15085
|
+
* {@link trafficIncidentOverlayKnobCatalogue} lists the plain-valued settings of `config` as data.
|
|
15086
|
+
*
|
|
13965
15087
|
* @param tomtomMap The TomTomMap instance.
|
|
13966
15088
|
* @param config The module optional configuration.
|
|
13967
15089
|
* @returns {Promise} Returns a promise with a new instance of this module.
|
|
13968
15090
|
*/
|
|
13969
15091
|
static create(tomtomMap: TomTomMap, config?: TrafficIncidentOverlayModuleConfig): Promise<TrafficIncidentOverlayModule>;
|
|
13970
15092
|
private constructor();
|
|
15093
|
+
private buildLayerSpecs;
|
|
15094
|
+
private updateLayers;
|
|
13971
15095
|
/** @ignore */
|
|
13972
15096
|
protected _initSourcesWithLayers(config?: TrafficIncidentOverlayModuleConfig, _restore?: boolean): Sources;
|
|
13973
15097
|
/** @ignore */
|
|
13974
15098
|
protected _applyConfig(config: TrafficIncidentOverlayModuleConfig | undefined): TrafficIncidentOverlayModuleConfig | undefined;
|
|
15099
|
+
/** @ignore */
|
|
15100
|
+
protected applyVisibility(config: TrafficIncidentOverlayModuleConfig | undefined): void;
|
|
13975
15101
|
private applyBeforeLayer;
|
|
13976
15102
|
/** @ignore */
|
|
13977
15103
|
protected discardShownData(): void;
|
|
@@ -13985,15 +15111,6 @@ export declare class TrafficIncidentOverlayModule extends AbstractDataOwnedMapMo
|
|
|
13985
15111
|
* Remove all rendered incidents (source kept, data emptied).
|
|
13986
15112
|
*/
|
|
13987
15113
|
clear(): Promise<void>;
|
|
13988
|
-
/**
|
|
13989
|
-
* Show or hide all incident layers.
|
|
13990
|
-
*/
|
|
13991
|
-
setVisible(visible: boolean): void;
|
|
13992
|
-
/**
|
|
13993
|
-
* Whether the module is set to be shown ({@link TrafficIncidentOverlayModuleConfig.visible}). A shown
|
|
13994
|
-
* module with no incidents draws nothing; {@link getShown} holds what is shown.
|
|
13995
|
-
*/
|
|
13996
|
-
isVisible(): boolean;
|
|
13997
15114
|
/**
|
|
13998
15115
|
* Move incident layers before the given map-style layer, or to the top.
|
|
13999
15116
|
*/
|
|
@@ -14024,174 +15141,6 @@ export declare class TrafficIncidentOverlayModule extends AbstractDataOwnedMapMo
|
|
|
14024
15141
|
private clearFeatureState;
|
|
14025
15142
|
}
|
|
14026
15143
|
//#endregion
|
|
14027
|
-
//#region src/traffic/types/trafficIncidentsConfig.d.ts
|
|
14028
|
-
/**
|
|
14029
|
-
* Configuration for filtering traffic incidents by delay duration.
|
|
14030
|
-
*
|
|
14031
|
-
* @remarks
|
|
14032
|
-
* Allows filtering incidents based on whether they cause delays and the severity of those delays.
|
|
14033
|
-
* Useful for focusing on incidents with the most significant traffic impact.
|
|
14034
|
-
*
|
|
14035
|
-
* @group Traffic Incidents
|
|
14036
|
-
*/
|
|
14037
|
-
export type DelayFilter = {
|
|
14038
|
-
/**
|
|
14039
|
-
* Requires incidents to have an associated delay.
|
|
14040
|
-
*
|
|
14041
|
-
* @remarks
|
|
14042
|
-
* When `true`, incidents without delay information will be hidden from the map.
|
|
14043
|
-
* When `false` or omitted, incidents are shown regardless of delay data availability.
|
|
14044
|
-
*
|
|
14045
|
-
* @defaultValue `false`
|
|
14046
|
-
*/
|
|
14047
|
-
mustHaveDelay?: boolean;
|
|
14048
|
-
/**
|
|
14049
|
-
* Minimum delay threshold in minutes.
|
|
14050
|
-
*
|
|
14051
|
-
* @remarks
|
|
14052
|
-
* Only incidents causing delays of at least this duration will be shown.
|
|
14053
|
-
*
|
|
14054
|
-
* **Behavior:**
|
|
14055
|
-
* - If `mustHaveDelay` is `false` or not set, this filter only applies to incidents that have delay data
|
|
14056
|
-
* - Incidents without delay data are still shown (unless `mustHaveDelay` is `true`)
|
|
14057
|
-
*
|
|
14058
|
-
* @example
|
|
14059
|
-
* ```ts
|
|
14060
|
-
* // Show only incidents with delays of 5 minutes or more
|
|
14061
|
-
* delays: { minDelayMinutes: 5 }
|
|
14062
|
-
* ```
|
|
14063
|
-
*/
|
|
14064
|
-
minDelayMinutes?: number;
|
|
14065
|
-
};
|
|
14066
|
-
/**
|
|
14067
|
-
* Filter configuration for traffic incidents visualization.
|
|
14068
|
-
*
|
|
14069
|
-
* @remarks
|
|
14070
|
-
* Extends common traffic filters with incident-specific filtering options
|
|
14071
|
-
* including category, severity, and delay-based filtering.
|
|
14072
|
-
*
|
|
14073
|
-
* @group Traffic Incidents
|
|
14074
|
-
*/
|
|
14075
|
-
export type TrafficIncidentsFilter = TrafficCommonFilter & {
|
|
14076
|
-
/**
|
|
14077
|
-
* Filters incidents by category type.
|
|
14078
|
-
*
|
|
14079
|
-
* @remarks
|
|
14080
|
-
* Controls which types of incidents are displayed on the map.
|
|
14081
|
-
*
|
|
14082
|
-
* @example
|
|
14083
|
-
* ```ts
|
|
14084
|
-
* // Show only accidents and road closures
|
|
14085
|
-
* incidentCategories: { show: 'only', values: ['accident', 'road-closed'] }
|
|
14086
|
-
* ```
|
|
14087
|
-
*/
|
|
14088
|
-
incidentCategories?: ValuesFilter<TrafficIncidentCategory>;
|
|
14089
|
-
/**
|
|
14090
|
-
* Filters incidents by delay severity magnitude.
|
|
14091
|
-
*
|
|
14092
|
-
* @remarks
|
|
14093
|
-
* Controls display based on the severity of traffic delays caused by incidents.
|
|
14094
|
-
*
|
|
14095
|
-
* Available magnitude values:
|
|
14096
|
-
* - `'unknown'` - Unknown delay severity
|
|
14097
|
-
* - `'minor'` - Minor delays
|
|
14098
|
-
* - `'moderate'` - Moderate delays
|
|
14099
|
-
* - `'major'` - Major delays
|
|
14100
|
-
* - `'indefinite'` - Indefinite delays (e.g., road closures)
|
|
14101
|
-
*
|
|
14102
|
-
* @example
|
|
14103
|
-
* ```ts
|
|
14104
|
-
* // Show only major incidents
|
|
14105
|
-
* magnitudes: { show: 'only', values: ['major'] }
|
|
14106
|
-
*
|
|
14107
|
-
* // Show moderate and major incidents
|
|
14108
|
-
* magnitudes: { show: 'only', values: ['moderate', 'major'] }
|
|
14109
|
-
*
|
|
14110
|
-
* // Hide minor incidents
|
|
14111
|
-
* magnitudes: { show: 'all-except', values: ['minor'] }
|
|
14112
|
-
* ```
|
|
14113
|
-
*/
|
|
14114
|
-
magnitudes?: ValuesFilter<DelayMagnitude>;
|
|
14115
|
-
/**
|
|
14116
|
-
* Filters incidents by delay duration.
|
|
14117
|
-
*
|
|
14118
|
-
* @remarks
|
|
14119
|
-
* Allows filtering based on whether incidents have delays and minimum delay thresholds.
|
|
14120
|
-
*/
|
|
14121
|
-
delays?: DelayFilter;
|
|
14122
|
-
};
|
|
14123
|
-
/**
|
|
14124
|
-
* Collection of traffic incident filters with OR logic.
|
|
14125
|
-
*
|
|
14126
|
-
* @remarks
|
|
14127
|
-
* Combines multiple incident filter configurations where an incident is shown
|
|
14128
|
-
* if it matches **any** of the provided filter criteria (logical OR).
|
|
14129
|
-
*
|
|
14130
|
-
* This allows for complex filtering scenarios where incidents from different
|
|
14131
|
-
* categories or with different characteristics can all be displayed.
|
|
14132
|
-
*
|
|
14133
|
-
* @example
|
|
14134
|
-
* ```ts
|
|
14135
|
-
* // Show major incidents OR road closures
|
|
14136
|
-
* filters: {
|
|
14137
|
-
* any: [
|
|
14138
|
-
* { magnitudes: { show: 'only', values: ['major'] } },
|
|
14139
|
-
* { incidentCategories: { show: 'only', values: ['road-closed'] } }
|
|
14140
|
-
* ]
|
|
14141
|
-
* }
|
|
14142
|
-
* ```
|
|
14143
|
-
*
|
|
14144
|
-
* @group Traffic Incidents
|
|
14145
|
-
*/
|
|
14146
|
-
export type TrafficIncidentsFilters = {
|
|
14147
|
-
/**
|
|
14148
|
-
* Array of incident filters combined with OR logic.
|
|
14149
|
-
*
|
|
14150
|
-
* @remarks
|
|
14151
|
-
* An incident is displayed if it satisfies at least one of the filter configurations.
|
|
14152
|
-
*/
|
|
14153
|
-
any: TrafficIncidentsFilter[];
|
|
14154
|
-
};
|
|
14155
|
-
/**
|
|
14156
|
-
* Configuration for the incident icons.
|
|
14157
|
-
*
|
|
14158
|
-
* @group Traffic Incidents
|
|
14159
|
-
*/
|
|
14160
|
-
export type IncidentIconsConfig = {
|
|
14161
|
-
/**
|
|
14162
|
-
* Shows or hides the incident icons, independently of the incident lines.
|
|
14163
|
-
*
|
|
14164
|
-
* @remarks
|
|
14165
|
-
* When omitted, the icons follow the module's `visible`.
|
|
14166
|
-
*/
|
|
14167
|
-
visible?: boolean;
|
|
14168
|
-
};
|
|
14169
|
-
/**
|
|
14170
|
-
* Configuration for traffic incidents module.
|
|
14171
|
-
*
|
|
14172
|
-
* @remarks
|
|
14173
|
-
* One set of `filters` narrows both the incident lines and their icons; `icons` only decides whether
|
|
14174
|
-
* the icons are shown.
|
|
14175
|
-
*
|
|
14176
|
-
* @group Traffic Incidents
|
|
14177
|
-
*/
|
|
14178
|
-
export type TrafficIncidentsModuleConfig = MapModuleCommonConfig & {
|
|
14179
|
-
/**
|
|
14180
|
-
* Controls the visibility of the traffic incident layers, icons included.
|
|
14181
|
-
*
|
|
14182
|
-
* @default false
|
|
14183
|
-
*/
|
|
14184
|
-
visible?: boolean;
|
|
14185
|
-
/**
|
|
14186
|
-
* Which incidents are shown, by category, severity, delay and road type — lines and icons alike.
|
|
14187
|
-
*/
|
|
14188
|
-
filters?: TrafficIncidentsFilters;
|
|
14189
|
-
/**
|
|
14190
|
-
* Configuration specific to the incident icons.
|
|
14191
|
-
*/
|
|
14192
|
-
icons?: IncidentIconsConfig;
|
|
14193
|
-
};
|
|
14194
|
-
//#endregion
|
|
14195
15144
|
//#region src/traffic/types/trafficIncidentsFeature.d.ts
|
|
14196
15145
|
/**
|
|
14197
15146
|
* Defines the structure of a traffic incident feature, which extends the basic GeoJSON feature with specific properties related to traffic incidents. This type is used to represent individual traffic incidents on the map, providing details such as the description of the incident, its severity, and the road category where it is occurring.
|
|
@@ -14361,6 +15310,8 @@ export declare class TrafficIncidentsModule extends AbstractStyleOwnedMapModule<
|
|
|
14361
15310
|
* - `ensureAddedToStyle`: Auto-add traffic incidents to style if missing
|
|
14362
15311
|
* - `filters`: Incident type, severity, and delay filters, for lines and icons alike
|
|
14363
15312
|
*
|
|
15313
|
+
* {@link trafficIncidentsKnobCatalogue} lists the plain-valued settings as data.
|
|
15314
|
+
*
|
|
14364
15315
|
* @throws Error if traffic incidents source is not in style and `ensureAddedToStyle` is false
|
|
14365
15316
|
*
|
|
14366
15317
|
* @example
|
|
@@ -14498,9 +15449,10 @@ export declare class TrafficIncidentsModule extends AbstractStyleOwnedMapModule<
|
|
|
14498
15449
|
setVisible(visible: boolean): void;
|
|
14499
15450
|
private _setVisible;
|
|
14500
15451
|
/**
|
|
14501
|
-
*
|
|
15452
|
+
* Whether traffic incidents are set to be shown.
|
|
14502
15453
|
*
|
|
14503
|
-
* @returns `
|
|
15454
|
+
* @returns The `visible` setting; `false` while nothing has set it, as traffic is hidden until
|
|
15455
|
+
* shown. {@link anyIconLayersVisible} reads the icon layers themselves.
|
|
14504
15456
|
*
|
|
14505
15457
|
* @example
|
|
14506
15458
|
* ```typescript
|
|
@@ -14687,4 +15639,4 @@ export declare const calculatePaddedCenter: (options: CalculateMapCenterOptions)
|
|
|
14687
15639
|
*/
|
|
14688
15640
|
export declare const calculateFittingBBox: (options: CalculateFittingBBoxOptions) => BBox | null;
|
|
14689
15641
|
//#endregion
|
|
14690
|
-
export type { AREA_ANALYTICS_DEFAULTS, AreaAnalyticsBeforeLayerConfig, AreaAnalyticsColorStop, AreaAnalyticsColorStopsConfig, AreaAnalyticsColorTheme, AreaAnalyticsDisplayMode, AreaAnalyticsHeightConfig, AreaAnalyticsMetricConfig, AreaAnalyticsMetricFilter, AreaAnalyticsRegionPolygonConfig, AreaAnalyticsValueType, AvailabilityLevel, BaseMapColorName, BeforeLayerConfig, BespokeSectionType, ByIdOrIndex, CSSCursor, ChargingSpeedIconMapping, ChargingStopIconConfig, ChargingStopIconMapping,
|
|
15642
|
+
export type { AREA_ANALYTICS_DEFAULTS, AreaAnalyticsBeforeLayerConfig, AreaAnalyticsColorStop, AreaAnalyticsColorStopsConfig, AreaAnalyticsColorTheme, AreaAnalyticsDisplayMode, AreaAnalyticsHeightConfig, AreaAnalyticsMetricConfig, AreaAnalyticsMetricFilter, AreaAnalyticsRegionPolygonConfig, AreaAnalyticsValueType, AvailabilityLevel, BaseMapColorName, BaseMapKnob, BaseMapKnobId, BaseMapKnobValueOf, BeforeLayerConfig, BespokeSectionType, ByIdOrIndex, CSSCursor, ChargingSpeedIconMapping, ChargingStopIconConfig, ChargingStopIconMapping, ChargingStopLabelConfig, ChargingStopsConfig, CleanEventStateOptions, CleanEventStatesOptions, ClickEventType, CountryCrossingAlignment, CountryCrossingConfig, CountryCrossingFeature, CustomGeoJSONKnob, CustomGeoJSONKnobId, CustomGeoJSONKnobValueOf, CustomImage, DefaultPlaceIconConfig, DisplayCountryCrossing, DisplayCountryCrossingProps, DisplayCountryCrossings, DisplayRouteProps, DisplayRouteRelatedProps, DisplayRouteSummaries, DisplayRouteSummary, DisplayRouteSummaryProps, DrawnSectionType, EVAvailabilityConfig, EventHandlerConfig, EventHandlerCursorConfig, EventHandlerHoverConfig, EventState, EventType, ExtraFeatureProp, FeaturePropValue, FilterablePOICategory, GeneratedSectionType, GeoJSONSourcesWithLayers, GeometriesKnob, GeometriesKnobId, GeometriesKnobValueOf, HasAdditionalLayersConfig, HasBeforeID, HoverEventType, HslColor, LabelConfig, LayerQuery, LayerSpecFilter, LayerSpecTemplate, LayerSpecWithSource, LightDark, MapColorName, MapColors, MapEventsConfig, MapFont, MapModuleCommonConfig, MapStyleLayerID, POIsKnob, POIsKnobId, POIsKnobValueOf, POIsModuleConfig, POIsModuleFeature, PartsBeforeLayerConfig, PlaceClusterBadgeConfig, PlaceConnectionDisplay, PlaceConnectionLayerName, PlaceConnectionsConfig, PlaceConnectionsLayersConfig, PlaceEntryPointFeature, PlaceEntryPointProps, PlaceEntryPointsConfig, PlaceEntryPointsLayersConfig, PlaceEntryPointsShowFor, PlaceIconConfig, PlaceLabelConfig, PlaceLayerName, PlaceLayersConfig, PlacesClusterConfig, PlacesKnob, PlacesKnobId, PlacesKnobValueOf, PlacesMarkerType, PlacesModuleConfig, PlacesModuleSerializableConfig, PlanningWaypoint, PutEventStateOptions, RGBAColor, RouteLayersConfig, RouteStateProps, RouteWaypointSize, RouteWidth, RoutingBeforeLayerConfig, RoutingKnob, RoutingKnobId, RoutingKnobValueOf, RoutingModuleConfig, RoutingModuleSerializableConfig, SVGIconStyleOptions, SectionDisplayConfig, SectionDrawStyle, SectionIconConfig, SectionIconPlacement, SectionKnobName, SectionKnobOf, SectionLineLayerName, SectionLinePattern, SectionSignConfig, SectionSignLayerName, SectionSignPlacement, SectionSignPriority, SectionSignUnit, SectionSourceKey, SectionSymbolLayerName, SectionsDisplayConfig, SerializableCustomImage, SourceWithLayerIDs, SourceWithLayers, SourcesWithLayers, StyleSourcesWithLayers, StylingColorKnobId, StylingKnob, StylingKnobAppliesTo, StylingKnobId, StylingKnobKind, StylingKnobRange, StylingKnobValue, StylingKnobValueOf, StylingPreset, StylingPresetId, StylingSettings, SupportsEvents, SymbolLayerSpecWithoutSource, TRAFFIC_LIGHT_COLORS, TerrainKnob, TerrainKnobId, TerrainKnobValueOf, TerrainModuleConfig, ToBeAddedLayerSpec, ToBeAddedLayerSpecTemplate, ToBeAddedLayerSpecWithoutSource, TrafficAreaAnalyticsKnob, TrafficAreaAnalyticsKnobId, TrafficAreaAnalyticsKnobValueOf, TrafficAreaAnalyticsModuleConfig, TrafficFlowKnob, TrafficFlowKnobId, TrafficFlowKnobValueOf, TrafficIncidentOverlayKnob, TrafficIncidentOverlayKnobId, TrafficIncidentOverlayKnobValueOf, TrafficIncidentsKnob, TrafficIncidentsKnobId, TrafficIncidentsKnobValueOf, UserEventHandler, WaypointsConfig };
|