@tomtom-org/maps-sdk 0.62.1 → 0.62.3
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 +45 -0
- package/core/dist/core.es.js +1 -1
- package/core/dist/core.es.js.map +1 -1
- package/core/dist/index.d.ts +5 -3
- package/map/dist/index.d.ts +773 -348
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/package.json +1 -1
package/map/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
1
|
+
import { AllLayoutProperties, AllPaintProperties, BackgroundLayerSpecification, CircleLayerSpecification, DataDrivenPropertyValueSpecification, ExpressionFilterSpecification, ExpressionSpecification, FillExtrusionLayerSpecification, FillLayerSpecification, FilterSpecification, GeoJSONSource, GeoJSONSourceSpecification, HeatmapLayerSpecification, LayerSpecification, LineLayerSpecification, LngLat, Map as Map$1, MapGeoJSONFeature, MapOptions, Source, SourceSpecification, StyleImageInterface, StyleImageMetadata, StyleSpecification, SymbolLayerSpecification } from "maplibre-gl";
|
|
2
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
|
/**
|
|
@@ -1431,16 +1431,42 @@ export declare class LayerFilterComposer extends AbstractLayerComposer<LayerFilt
|
|
|
1431
1431
|
private apply;
|
|
1432
1432
|
}
|
|
1433
1433
|
//#endregion
|
|
1434
|
+
//#region src/styling/styleLayerGroups.d.ts
|
|
1435
|
+
/**
|
|
1436
|
+
* The layer groups of the style-owned modules other than the base map, each the style layers one
|
|
1437
|
+
* module controls: {@link POIsModule}, {@link TrafficFlowModule}, {@link TrafficIncidentsModule} and
|
|
1438
|
+
* the hillshade {@link TerrainModule} shows.
|
|
1439
|
+
*
|
|
1440
|
+
* @group Map Styling
|
|
1441
|
+
*/
|
|
1442
|
+
export declare const styleModuleLayerGroupNames: readonly ["pois", "trafficFlow", "trafficIncidents", "hillshade"];
|
|
1443
|
+
/**
|
|
1444
|
+
* One of {@link styleModuleLayerGroupNames}.
|
|
1445
|
+
*
|
|
1446
|
+
* @group Map Styling
|
|
1447
|
+
*/
|
|
1448
|
+
type StyleModuleLayerGroupName = (typeof styleModuleLayerGroupNames)[number];
|
|
1449
|
+
/**
|
|
1450
|
+
* A named group of style layers: one of the base map's ({@link BaseMapLayerGroupName}) or the
|
|
1451
|
+
* layers of another style-owned module ({@link StyleModuleLayerGroupName}).
|
|
1452
|
+
*
|
|
1453
|
+
* @group Map Styling
|
|
1454
|
+
*/
|
|
1455
|
+
type StyleLayerGroupName = BaseMapLayerGroupName | StyleModuleLayerGroupName;
|
|
1456
|
+
//#endregion
|
|
1434
1457
|
//#region src/styling/layerQuery.d.ts
|
|
1435
1458
|
/**
|
|
1436
|
-
* How {@link StylingModule.layers} picks style layers: by
|
|
1437
|
-
*
|
|
1459
|
+
* How {@link StylingModule.layers} picks style layers: by a named group, layer type, vector-tile
|
|
1460
|
+
* source layer and case-insensitive id fragments. Every constraint given must hold.
|
|
1438
1461
|
*
|
|
1439
1462
|
* @group Map Styling
|
|
1440
1463
|
*/
|
|
1441
1464
|
type LayerQuery = {
|
|
1442
|
-
/**
|
|
1443
|
-
|
|
1465
|
+
/**
|
|
1466
|
+
* A named group of style layers: a base-map group, the same vocabulary as {@link BaseMapModule},
|
|
1467
|
+
* or the layers of another style-owned module (`pois`, `trafficFlow`, `trafficIncidents`, `hillshade`).
|
|
1468
|
+
*/
|
|
1469
|
+
group?: StyleLayerGroupName;
|
|
1444
1470
|
/** The style's own `metadata.group` values, for groups the SDK does not name. */
|
|
1445
1471
|
metadataGroups?: string[];
|
|
1446
1472
|
/** Layer types (`line`, `fill`, `symbol`, …). */
|
|
@@ -1468,11 +1494,15 @@ type PropertyOverride = {
|
|
|
1468
1494
|
*
|
|
1469
1495
|
* Overrides are not part of `getConfig()`: they are edits to this style, not portable settings.
|
|
1470
1496
|
*
|
|
1497
|
+
* **Only the style's own layers.** The layers a data-owned module adds (places, routes, geometries…)
|
|
1498
|
+
* take their overrides through that module's `layers` configuration, and the ones you add are yours.
|
|
1499
|
+
*
|
|
1471
1500
|
* @example
|
|
1472
1501
|
* ```typescript
|
|
1473
1502
|
* styling.layers.query({ group: 'roadLabels' }).setPaint({ 'text-color': '#93c5fd' });
|
|
1474
1503
|
* styling.layers.query({ metadataGroups: ['water'], layerTypes: ['fill'] }).setPaint({ 'fill-opacity': 0.6 });
|
|
1475
1504
|
* styling.layers.query({ idIncludes: ['railway'] }).setVisible(false);
|
|
1505
|
+
* styling.layers.query({ group: 'trafficFlow', layerTypes: ['line'] }).setPaint({ 'line-opacity': 0.6 });
|
|
1476
1506
|
* styling.layers.query({ group: 'roadLabels' }).reset();
|
|
1477
1507
|
* ```
|
|
1478
1508
|
*
|
|
@@ -1651,8 +1681,8 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
|
|
|
1651
1681
|
*/
|
|
1652
1682
|
protected discardShownData(): void;
|
|
1653
1683
|
/**
|
|
1654
|
-
* The advanced tier: raw MapLibre paint, layout and filter edits over a query of style
|
|
1655
|
-
* re-applied across style switches. Version-coupled by nature — see {@link LayerSelection} for
|
|
1684
|
+
* The advanced tier: raw MapLibre paint, layout and filter edits over a query of the style's own
|
|
1685
|
+
* layers, re-applied across style switches. Version-coupled by nature — see {@link LayerSelection} for
|
|
1656
1686
|
* the terms — so prefer a knob or {@link setMapColors} wherever one covers the intent.
|
|
1657
1687
|
*
|
|
1658
1688
|
* @example
|
|
@@ -1778,6 +1808,7 @@ export declare class StylingModule extends AbstractStyleOwnedMapModule<Record<st
|
|
|
1778
1808
|
*/
|
|
1779
1809
|
get events(): StylingEvents;
|
|
1780
1810
|
private indexStyle;
|
|
1811
|
+
private holdTransitionsUntilFirstFrame;
|
|
1781
1812
|
private resolveMechanism;
|
|
1782
1813
|
private capture;
|
|
1783
1814
|
private originalValueOf;
|
|
@@ -2145,6 +2176,8 @@ export declare class TomTomMap {
|
|
|
2145
2176
|
private styleGivenToMapLibre;
|
|
2146
2177
|
private styleRequestSequence;
|
|
2147
2178
|
private styleLoadInFlight;
|
|
2179
|
+
private styleLayerIds;
|
|
2180
|
+
private readonly moduleSourcesAndLayers;
|
|
2148
2181
|
/**
|
|
2149
2182
|
* Constructs a new TomTom Map instance and attaches it to a DOM element.
|
|
2150
2183
|
*
|
|
@@ -2299,6 +2332,12 @@ export declare class TomTomMap {
|
|
|
2299
2332
|
private applyStyle;
|
|
2300
2333
|
private loadIntoMapLibre;
|
|
2301
2334
|
private isSuperseded;
|
|
2335
|
+
private recordStyleLayers;
|
|
2336
|
+
/**
|
|
2337
|
+
* Whether the loaded style itself declares the layer, as opposed to a module or the caller adding it.
|
|
2338
|
+
* @ignore
|
|
2339
|
+
*/
|
|
2340
|
+
_isStyleLayer(layerId: string): boolean;
|
|
2302
2341
|
private notifyHandlers;
|
|
2303
2342
|
/**
|
|
2304
2343
|
* The {@link StyleInput} the map was last given, through its parameters or {@link setStyle}.
|
|
@@ -2973,6 +3012,14 @@ export declare abstract class AbstractSourceWithLayers<SOURCE_SPEC extends Sourc
|
|
|
2973
3012
|
protected get mapRemoved(): boolean;
|
|
2974
3013
|
isAnyLayerVisible(filter?: LayerSpecFilter): boolean;
|
|
2975
3014
|
areAllLayersVisible(filter?: LayerSpecFilter): boolean;
|
|
3015
|
+
/**
|
|
3016
|
+
* The features the visible layers draw in the viewport.
|
|
3017
|
+
*
|
|
3018
|
+
* @remarks
|
|
3019
|
+
* Queries only the layers drawn now: MapLibre still returns a just-hidden layer's symbols until
|
|
3020
|
+
* its next placement, a few frames later.
|
|
3021
|
+
*/
|
|
3022
|
+
queryRenderedFeatures(): MapGeoJSONFeature[];
|
|
2976
3023
|
private getLayerSpecs;
|
|
2977
3024
|
_updateSourceAndLayerIDs(): void;
|
|
2978
3025
|
private isLayerVisible;
|
|
@@ -3782,19 +3829,13 @@ type AvailabilityLevel = 'available' | 'occupied';
|
|
|
3782
3829
|
* @example
|
|
3783
3830
|
* ```typescript
|
|
3784
3831
|
* // POI category icon
|
|
3785
|
-
* const poiIcon:
|
|
3832
|
+
* const poiIcon: CustomImage = {
|
|
3786
3833
|
* id: 'RESTAURANT',
|
|
3787
3834
|
* image: '/icons/restaurant-marker.png',
|
|
3788
3835
|
* };
|
|
3789
3836
|
*
|
|
3790
|
-
* //
|
|
3791
|
-
* const
|
|
3792
|
-
* id: WAYPOINT_START_IMAGE_ID,
|
|
3793
|
-
* image: '/icons/waypoint-start.png',
|
|
3794
|
-
* };
|
|
3795
|
-
*
|
|
3796
|
-
* // Charging station icon
|
|
3797
|
-
* const chargingIcon: CustomIcon = {
|
|
3837
|
+
* // An icon a route's waypoints or charging stops pick by id through their `icon.mapping`
|
|
3838
|
+
* const chargingIcon: CustomImage = {
|
|
3798
3839
|
* id: 'my-charging-station',
|
|
3799
3840
|
* image: '/icons/ev-charger-low-res.png',
|
|
3800
3841
|
* pixelRatio: 1
|
|
@@ -3811,9 +3852,8 @@ type CustomImage<I extends string = string> = {
|
|
|
3811
3852
|
* This ID is used to reference the icon when styling map features.
|
|
3812
3853
|
* The specific values depend on the context:
|
|
3813
3854
|
* - For POI categories: Use MapStylePOICategory values (e.g., 'RESTAURANT', 'HOTEL_OR_MOTEL')
|
|
3814
|
-
* - For
|
|
3815
|
-
*
|
|
3816
|
-
* - For custom markers: Use any unique string identifier
|
|
3855
|
+
* - For icons an `icon.mapping` picks by id (route waypoints, charging stops): any unique string,
|
|
3856
|
+
* the one the mapping returns
|
|
3817
3857
|
*/
|
|
3818
3858
|
id: I;
|
|
3819
3859
|
/**
|
|
@@ -3970,6 +4010,39 @@ type SVGIconStyleOptions = {
|
|
|
3970
4010
|
*/
|
|
3971
4011
|
outlineOpacity?: number;
|
|
3972
4012
|
};
|
|
4013
|
+
/**
|
|
4014
|
+
* One of the SDK's pins: recoloured, or replaced by an image of your own.
|
|
4015
|
+
*
|
|
4016
|
+
* @remarks
|
|
4017
|
+
* Places draw their default pin from one, and route waypoints one per role (start, stop, finish).
|
|
4018
|
+
*
|
|
4019
|
+
* @example
|
|
4020
|
+
* ```typescript
|
|
4021
|
+
* const recoloured: PinIconConfig = { style: { fillColor: '#2FAA4E', outlineColor: '#FFFFFF' } };
|
|
4022
|
+
* const replaced: PinIconConfig = { image: { image: '/icons/flag.svg', pixelRatio: 2 } };
|
|
4023
|
+
* ```
|
|
4024
|
+
*
|
|
4025
|
+
* @group Shared
|
|
4026
|
+
*/
|
|
4027
|
+
type PinIconConfig = {
|
|
4028
|
+
/**
|
|
4029
|
+
* Colours of the SDK's pin. A `fillColor` left out takes the module's colour.
|
|
4030
|
+
*/
|
|
4031
|
+
style?: SVGIconStyleOptions;
|
|
4032
|
+
/**
|
|
4033
|
+
* An image drawn in place of the SDK's pin. Neither `style` nor the image's own `offsetX`,
|
|
4034
|
+
* `offsetY` and `availabilityLevel` apply to it.
|
|
4035
|
+
*/
|
|
4036
|
+
image?: Omit<CustomImage, 'id'>;
|
|
4037
|
+
};
|
|
4038
|
+
/**
|
|
4039
|
+
* A {@link PinIconConfig} that survives JSON — see {@link SerializableCustomImage}.
|
|
4040
|
+
*
|
|
4041
|
+
* @group Shared
|
|
4042
|
+
*/
|
|
4043
|
+
type SerializablePinIconConfig = Omit<PinIconConfig, 'image'> & {
|
|
4044
|
+
image?: Omit<SerializableCustomImage, 'id'>;
|
|
4045
|
+
};
|
|
3973
4046
|
//#endregion
|
|
3974
4047
|
//#region src/shared/layers/commonLayerProps.d.ts
|
|
3975
4048
|
/**
|
|
@@ -4165,6 +4238,47 @@ type LabelConfig = {
|
|
|
4165
4238
|
/** Font faces, the first one available wins. */
|
|
4166
4239
|
font?: DataDrivenPropertyValueSpecification<MapFont[]>;
|
|
4167
4240
|
};
|
|
4241
|
+
/**
|
|
4242
|
+
* A {@link LabelConfig} that also sets what the label says, for the labels a module writes beside
|
|
4243
|
+
* the features it shows.
|
|
4244
|
+
*
|
|
4245
|
+
* @typeParam F - The feature the `title` function receives.
|
|
4246
|
+
*
|
|
4247
|
+
* @group Shared
|
|
4248
|
+
*/
|
|
4249
|
+
type FeatureLabelConfig<F> = LabelConfig & {
|
|
4250
|
+
/**
|
|
4251
|
+
* Text content for the label.
|
|
4252
|
+
*
|
|
4253
|
+
* @remarks
|
|
4254
|
+
* A function is called once per feature when it is shown, and its result is drawn as given. A
|
|
4255
|
+
* MapLibre expression is evaluated per feature by the layer, over the properties the feature is
|
|
4256
|
+
* drawn with, and replaces the module's whole label text.
|
|
4257
|
+
*
|
|
4258
|
+
* @example
|
|
4259
|
+
* ```typescript
|
|
4260
|
+
* // Function
|
|
4261
|
+
* title: (feature) => feature.properties.poi?.name || 'Unknown'
|
|
4262
|
+
*
|
|
4263
|
+
* // MapLibre expression
|
|
4264
|
+
* title: ['get', 'title']
|
|
4265
|
+
* ```
|
|
4266
|
+
*
|
|
4267
|
+
* @see https://maplibre.org/maplibre-style-spec/types/#formatted
|
|
4268
|
+
*/
|
|
4269
|
+
title?: ((feature: F) => string) | DataDrivenPropertyValueSpecification<string>;
|
|
4270
|
+
};
|
|
4271
|
+
/**
|
|
4272
|
+
* A {@link FeatureLabelConfig} that survives JSON: its `title` a MapLibre expression, never a
|
|
4273
|
+
* function — see {@link PlacesModuleSerializableConfig}.
|
|
4274
|
+
*
|
|
4275
|
+
* @typeParam L - The module's label configuration.
|
|
4276
|
+
*
|
|
4277
|
+
* @group Shared
|
|
4278
|
+
*/
|
|
4279
|
+
type SerializableFeatureLabelConfig<L extends FeatureLabelConfig<never>> = Omit<L, 'title'> & {
|
|
4280
|
+
title?: Exclude<L['title'], (feature: never) => string>;
|
|
4281
|
+
};
|
|
4168
4282
|
//#endregion
|
|
4169
4283
|
//#region src/shared/types/mapModule.d.ts
|
|
4170
4284
|
/**
|
|
@@ -6428,7 +6542,7 @@ export type CustomGeoJSONImageSpec = {
|
|
|
6428
6542
|
* change at runtime and you want a stable identity that is independent of array order.
|
|
6429
6543
|
*
|
|
6430
6544
|
* `beforeID` is the ID of an existing map layer the new layer should be inserted
|
|
6431
|
-
* before — see MapLibre's `addLayer`.
|
|
6545
|
+
* before — see MapLibre's `addLayer`. One the style lacks puts the layer on top.
|
|
6432
6546
|
*
|
|
6433
6547
|
* @group Custom
|
|
6434
6548
|
*/
|
|
@@ -6913,14 +7027,11 @@ export type GeometryLabelConfig = LabelConfig & {
|
|
|
6913
7027
|
text?: DataDrivenPropertyValueSpecification<string>;
|
|
6914
7028
|
};
|
|
6915
7029
|
/**
|
|
6916
|
-
* Line/border configuration for geometries — the outline color, opacity
|
|
6917
|
-
* any other line property, and (optionally) where the border layer sits in the map's layer stack.
|
|
7030
|
+
* Line/border configuration for geometries — the outline color, opacity and width.
|
|
6918
7031
|
*
|
|
6919
7032
|
* @remarks
|
|
6920
|
-
* The curated
|
|
6921
|
-
*
|
|
6922
|
-
* for anything else (`line-gap-width`, `line-cap`, `line-join`, …). The curated fields take precedence
|
|
6923
|
-
* over the same `paint` property set via `layer`.
|
|
7033
|
+
* The curated fields cover the common cases; {@link GeometryLayersConfig.line | layers.line} takes any
|
|
7034
|
+
* other line property (`line-gap-width`, `line-cap`, `line-dasharray`, …).
|
|
6924
7035
|
*
|
|
6925
7036
|
* @example
|
|
6926
7037
|
* ```typescript
|
|
@@ -6960,34 +7071,50 @@ export type GeometryLineConfig = {
|
|
|
6960
7071
|
*/
|
|
6961
7072
|
width?: DataDrivenPropertyValueSpecification<number>;
|
|
6962
7073
|
/**
|
|
6963
|
-
*
|
|
6964
|
-
*
|
|
6965
|
-
* @remarks
|
|
6966
|
-
* Accepts a partial MapLibre `LineLayerSpecification` (without `id`/`source`) that is merged
|
|
6967
|
-
* onto the outline layer: top-level fields first, then `layout` and `paint` are merged per
|
|
6968
|
-
* property so base defaults survive. Use this to set any line property the curated fields above
|
|
6969
|
-
* don't cover (e.g. `line-gap-width`, `line-cap`, `line-join`, `line-pattern`).
|
|
7074
|
+
* A partial MapLibre line layer merged onto the border, under the curated fields above: they
|
|
7075
|
+
* take precedence over the same `paint` properties set here.
|
|
6970
7076
|
*
|
|
6971
|
-
*
|
|
6972
|
-
*
|
|
6973
|
-
*
|
|
6974
|
-
* @example
|
|
6975
|
-
* ```typescript
|
|
6976
|
-
* line: {
|
|
6977
|
-
* color: '#00A65E',
|
|
6978
|
-
* layer: { paint: { 'line-gap-width': 3 }, layout: { 'line-cap': 'round' } },
|
|
6979
|
-
* }
|
|
6980
|
-
* ```
|
|
7077
|
+
* @deprecated Use {@link GeometryLayersConfig.line | layers.line}, which takes precedence over
|
|
7078
|
+
* the curated fields, as every module's `layers` entry does.
|
|
6981
7079
|
*/
|
|
6982
7080
|
layer?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
6983
7081
|
};
|
|
7082
|
+
/**
|
|
7083
|
+
* MapLibre overrides for the layers a polygon module draws ({@link GeometriesModule},
|
|
7084
|
+
* {@link ReachableRangesModule}), for what the curated fields don't cover.
|
|
7085
|
+
*
|
|
7086
|
+
* @remarks
|
|
7087
|
+
* Each entry is a partial layer spec merged onto the module's own: top-level fields replace, `layout`
|
|
7088
|
+
* and `paint` merge per property, and what is set here takes precedence over the curated fields.
|
|
7089
|
+
* Where the layers sit is `beforeLayerConfig`'s, so a `beforeID` here is ignored.
|
|
7090
|
+
*
|
|
7091
|
+
* @example
|
|
7092
|
+
* ```typescript
|
|
7093
|
+
* layers: {
|
|
7094
|
+
* line: { paint: { 'line-dasharray': [2, 1] }, layout: { 'line-cap': 'round' } },
|
|
7095
|
+
* label: { layout: { 'text-transform': 'uppercase' } },
|
|
7096
|
+
* }
|
|
7097
|
+
* ```
|
|
7098
|
+
*
|
|
7099
|
+
* @group Geometries
|
|
7100
|
+
*/
|
|
7101
|
+
export type GeometryLayersConfig = {
|
|
7102
|
+
/** The fill. */
|
|
7103
|
+
fill?: Partial<ToBeAddedLayerSpecTemplate<FillLayerSpecification>>;
|
|
7104
|
+
/** The border. */
|
|
7105
|
+
line?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
7106
|
+
/** The label at each geometry's center. */
|
|
7107
|
+
label?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
7108
|
+
/** The labels along the borders, drawn while `lineLabel` is set. */
|
|
7109
|
+
lineLabel?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
7110
|
+
};
|
|
6984
7111
|
/**
|
|
6985
7112
|
* How a hovered or clicked geometry is drawn: a denser fill and a wider border, in its own colours.
|
|
6986
7113
|
*
|
|
6987
7114
|
* @remarks
|
|
6988
7115
|
* The factors multiply the fill opacity and border width in force, the configured
|
|
6989
7116
|
* {@link GeometryFillConfig.opacity | fill.opacity} and {@link GeometryLineConfig.width | line.width}
|
|
6990
|
-
* included; a `line
|
|
7117
|
+
* included; a `line-width` in {@link GeometryLayersConfig.line | layers.line} is drawn as given. The geometries draw their event states
|
|
6991
7118
|
* once a handler covers them, or {@link GeometriesModule.putEventState} puts one.
|
|
6992
7119
|
*
|
|
6993
7120
|
* @example
|
|
@@ -7163,8 +7290,9 @@ export type GeometriesModuleConfig = MapModuleCommonConfig & {
|
|
|
7163
7290
|
*
|
|
7164
7291
|
* @remarks
|
|
7165
7292
|
* `show()` and `clear()` never change it — a hidden module keeps its data until
|
|
7166
|
-
* {@link GeometriesModule.setVisible} shows it again. A
|
|
7167
|
-
* `
|
|
7293
|
+
* {@link GeometriesModule.setVisible} shows it again. A layer hidden through its
|
|
7294
|
+
* {@link GeometriesModuleConfig.layers | layers} entry's `layout.visibility` stays hidden while the
|
|
7295
|
+
* module is shown.
|
|
7168
7296
|
*
|
|
7169
7297
|
* @default true
|
|
7170
7298
|
*/
|
|
@@ -7232,6 +7360,10 @@ export type GeometriesModuleConfig = MapModuleCommonConfig & {
|
|
|
7232
7360
|
* ```
|
|
7233
7361
|
*/
|
|
7234
7362
|
fillStyle?: GeometryFillStyle;
|
|
7363
|
+
/**
|
|
7364
|
+
* MapLibre overrides for the fill, border and label layers.
|
|
7365
|
+
*/
|
|
7366
|
+
layers?: GeometryLayersConfig;
|
|
7235
7367
|
/**
|
|
7236
7368
|
* Transform applied to features before rendering.
|
|
7237
7369
|
*
|
|
@@ -7309,7 +7441,7 @@ export type GeometriesEvents<CFG = GeometriesModuleConfig> = CombinedEvents<MapG
|
|
|
7309
7441
|
*
|
|
7310
7442
|
* @group Geometries
|
|
7311
7443
|
*/
|
|
7312
|
-
export declare abstract class AbstractGeometriesModule<CFG extends MapModuleCommonConfig & Pick<GeometriesModuleConfig, 'visible' | 'beforeLayerConfig' | 'highlight'>> extends AbstractDataOwnedMapModule<GeometrySourcesWithLayers, CFG> {
|
|
7444
|
+
export declare abstract class AbstractGeometriesModule<CFG extends MapModuleCommonConfig & Pick<GeometriesModuleConfig, 'visible' | 'beforeLayerConfig' | 'highlight' | 'layers'>> extends AbstractDataOwnedMapModule<GeometrySourcesWithLayers, CFG> {
|
|
7313
7445
|
private titleLayerSpecs;
|
|
7314
7446
|
private geometryFillLayerSpecs;
|
|
7315
7447
|
private geometryOutlineLayerSpecs;
|
|
@@ -7812,6 +7944,10 @@ export type ReachableRangesModuleConfig = MapModuleCommonConfig & {
|
|
|
7812
7944
|
* @default 'lowestLabel'
|
|
7813
7945
|
*/
|
|
7814
7946
|
beforeLayerConfig?: GeometryBeforeLayerConfig;
|
|
7947
|
+
/**
|
|
7948
|
+
* MapLibre overrides for the band, border and label layers.
|
|
7949
|
+
*/
|
|
7950
|
+
layers?: GeometryLayersConfig;
|
|
7815
7951
|
/**
|
|
7816
7952
|
* Each range's title, the text of its labels. Unset, it is the range's `budget`, e.g. `'30 min'`
|
|
7817
7953
|
* or `'10 km'`, else its position in what `show` was given, from 1.
|
|
@@ -7862,8 +7998,8 @@ type ReachableRangesKnob = KnobEntry<ReachableRangesKnobId, Exclude<KnobKind, 'o
|
|
|
7862
7998
|
*
|
|
7863
7999
|
* @remarks
|
|
7864
8000
|
* A knob is a plain display value in {@link GeometriesModuleConfig}, at the path its id names. Not
|
|
7865
|
-
* knobs: `beforeLayerConfig`, `line.layer`, the labels' `text` and
|
|
7866
|
-
* which take structured, MapLibre or function values; and `events`.
|
|
8001
|
+
* knobs: `beforeLayerConfig`, `layers`, `line.layer`, the labels' `text` and
|
|
8002
|
+
* `transformFeaturesForDisplay`, which take structured, MapLibre or function values; and `events`.
|
|
7867
8003
|
* Setting any `lineLabel` knob draws the border labels.
|
|
7868
8004
|
*
|
|
7869
8005
|
* @group Geometries
|
|
@@ -7882,7 +8018,8 @@ export declare const geometriesKnobIds: readonly GeometriesKnobId[];
|
|
|
7882
8018
|
*
|
|
7883
8019
|
* @remarks
|
|
7884
8020
|
* A knob is a plain display value in {@link ReachableRangesModuleConfig}, at the path its id names.
|
|
7885
|
-
* Not knobs: `beforeLayerConfig` and `title`, which take structured or function
|
|
8021
|
+
* Not knobs: `beforeLayerConfig`, `layers` and `title`, which take structured, MapLibre or function
|
|
8022
|
+
* values; and `events`.
|
|
7886
8023
|
*
|
|
7887
8024
|
* @group Geometries
|
|
7888
8025
|
*/
|
|
@@ -7937,7 +8074,7 @@ export type ReachableRangesEvents = GeometriesEvents<ReachableRangesModuleConfig
|
|
|
7937
8074
|
* ranges.applyConfig({ fillStyle: 'inverted' });
|
|
7938
8075
|
* ```
|
|
7939
8076
|
*
|
|
7940
|
-
* @see [Reachable Ranges Guide](https://docs.tomtom.com/maps-sdk-js/guides/
|
|
8077
|
+
* @see [Reachable Ranges Module Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/reachable-ranges)
|
|
7941
8078
|
*
|
|
7942
8079
|
* @group Geometries
|
|
7943
8080
|
*/
|
|
@@ -8248,36 +8385,32 @@ type EVAvailabilityConfig = {
|
|
|
8248
8385
|
formatText?: (available: number, total: number) => string;
|
|
8249
8386
|
};
|
|
8250
8387
|
/**
|
|
8251
|
-
*
|
|
8252
|
-
*
|
|
8388
|
+
* The default place icon: the pin drawn for clicked locations and addresses without a specific
|
|
8389
|
+
* category. A `style.fillColor` left out takes {@link PlacesModuleConfig.color}.
|
|
8253
8390
|
*
|
|
8254
8391
|
* @group Places
|
|
8255
8392
|
*/
|
|
8256
|
-
type DefaultPlaceIconConfig =
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
* @remarks
|
|
8278
|
-
* If provided, this image will be used instead of the default icon, and `style` does not apply.
|
|
8279
|
-
*/
|
|
8280
|
-
image?: Omit<CustomImage, 'id'>;
|
|
8393
|
+
type DefaultPlaceIconConfig = PinIconConfig;
|
|
8394
|
+
/**
|
|
8395
|
+
* Picks the icon of each feature a module draws, from the feature itself.
|
|
8396
|
+
*
|
|
8397
|
+
* @remarks
|
|
8398
|
+
* - `imageID`: `fn` returns the id of an image in the style's sprite, or of one the module adds.
|
|
8399
|
+
* - `poiCategory`: `fn` returns a POI category, drawn with the icon the SDK has for it, so data
|
|
8400
|
+
* that is not a search result can still look like one.
|
|
8401
|
+
*
|
|
8402
|
+
* `fn` returning `undefined` leaves that feature the icon it has without a mapping.
|
|
8403
|
+
*
|
|
8404
|
+
* @typeParam F - The feature `fn` receives.
|
|
8405
|
+
*
|
|
8406
|
+
* @group Places
|
|
8407
|
+
*/
|
|
8408
|
+
type IconMapping<F> = {
|
|
8409
|
+
to: 'imageID';
|
|
8410
|
+
fn: (feature: F) => string | undefined;
|
|
8411
|
+
} | {
|
|
8412
|
+
to: 'poiCategory';
|
|
8413
|
+
fn: (feature: F) => MapStylePOICategory | undefined;
|
|
8281
8414
|
};
|
|
8282
8415
|
/**
|
|
8283
8416
|
* Configuration for place marker icons.
|
|
@@ -8308,22 +8441,21 @@ type PlaceIconConfig<P extends CommonPlaceProps = CommonPlaceProps> = {
|
|
|
8308
8441
|
*
|
|
8309
8442
|
* When provided, places matching these categories will use the custom icons
|
|
8310
8443
|
* instead of the default style.
|
|
8444
|
+
*
|
|
8445
|
+
* @remarks
|
|
8446
|
+
* A place takes the entry for its own category, else the first entry for the map category its
|
|
8447
|
+
* category falls in, as the map's own POIs do: `RESTAURANT` reaches an `ITALIAN_RESTAURANT`, and
|
|
8448
|
+
* `CAFE` a `CAFE_PUB`. That second match takes only entries with an `image` and no
|
|
8449
|
+
* `availabilityLevel`, so the same list given to {@link POIsModuleConfig.icon} restyles both alike.
|
|
8311
8450
|
*/
|
|
8312
8451
|
categoryIcons?: CustomImage<MapStylePOICategory>[];
|
|
8313
8452
|
/**
|
|
8314
8453
|
* Custom mapping to determine the icon for a given place.
|
|
8315
8454
|
*
|
|
8316
8455
|
* @remarks
|
|
8317
|
-
* Supports two mapping strategies:
|
|
8318
|
-
*
|
|
8319
|
-
* - **`imageID`**: Directly returns the icon image ID to use for the place.
|
|
8320
|
-
* This provides full control over icon selection.
|
|
8321
|
-
*
|
|
8322
|
-
* - **`poiCategory`**: Returns a POI category, which is then resolved to an icon
|
|
8323
|
-
* using the existing category-to-icon logic. This reuses the standard category mapping.
|
|
8324
|
-
*
|
|
8325
8456
|
* `fn` receives places of the shape the module was created for, so it reads your own
|
|
8326
|
-
* properties typed.
|
|
8457
|
+
* properties typed. A `poiCategory` resolves through the marker type, as a place's own
|
|
8458
|
+
* category does.
|
|
8327
8459
|
*
|
|
8328
8460
|
* @example
|
|
8329
8461
|
* ```typescript
|
|
@@ -8340,13 +8472,7 @@ type PlaceIconConfig<P extends CommonPlaceProps = CommonPlaceProps> = {
|
|
|
8340
8472
|
* });
|
|
8341
8473
|
* ```
|
|
8342
8474
|
*/
|
|
8343
|
-
mapping?:
|
|
8344
|
-
to: 'imageID';
|
|
8345
|
-
fn: (place: Place<P>) => string;
|
|
8346
|
-
} | {
|
|
8347
|
-
to: 'poiCategory';
|
|
8348
|
-
fn: (place: Place<P>) => MapStylePOICategory;
|
|
8349
|
-
};
|
|
8475
|
+
mapping?: IconMapping<Place<P>>;
|
|
8350
8476
|
};
|
|
8351
8477
|
/**
|
|
8352
8478
|
* The content, look and position of the labels next to place markers.
|
|
@@ -8381,29 +8507,7 @@ type PlaceIconConfig<P extends CommonPlaceProps = CommonPlaceProps> = {
|
|
|
8381
8507
|
*
|
|
8382
8508
|
* @group Places
|
|
8383
8509
|
*/
|
|
8384
|
-
type PlaceLabelConfig<P extends CommonPlaceProps = CommonPlaceProps> =
|
|
8385
|
-
/**
|
|
8386
|
-
* Text content for the label.
|
|
8387
|
-
*
|
|
8388
|
-
* Can be a function that extracts text from the place properties (data-based),
|
|
8389
|
-
* or a MapLibre expression for data-driven content (data-driven layer-based). The function
|
|
8390
|
-
* receives places of the shape the module was created for.
|
|
8391
|
-
*
|
|
8392
|
-
* @example
|
|
8393
|
-
* ```typescript
|
|
8394
|
-
* // Function
|
|
8395
|
-
* title: (place) => place.properties.poi?.name || 'Unknown'
|
|
8396
|
-
*
|
|
8397
|
-
* // MapLibre expression
|
|
8398
|
-
* title: ['get', 'title']
|
|
8399
|
-
*
|
|
8400
|
-
* // Conditional expression
|
|
8401
|
-
* title: ['case', ['has', 'name'], ['get', 'name'], ['get', 'address']]
|
|
8402
|
-
* ```
|
|
8403
|
-
*
|
|
8404
|
-
* @see https://maplibre.org/maplibre-style-spec/types/#formatted
|
|
8405
|
-
*/
|
|
8406
|
-
title?: ((place: Place<P>) => string) | DataDrivenPropertyValueSpecification<string>;
|
|
8510
|
+
type PlaceLabelConfig<P extends CommonPlaceProps = CommonPlaceProps> = FeatureLabelConfig<Place<P>> & {
|
|
8407
8511
|
/**
|
|
8408
8512
|
* Text offset from the icon in ems.
|
|
8409
8513
|
*
|
|
@@ -9112,13 +9216,9 @@ type ExtraFeatureProp<P extends CommonPlaceProps = CommonPlaceProps> = FeaturePr
|
|
|
9112
9216
|
* @group Places
|
|
9113
9217
|
*/
|
|
9114
9218
|
type PlacesModuleSerializableConfig = Omit<PlacesModuleConfig, 'label' | 'icon' | 'evAvailability' | 'connections' | 'extraFeatureProps'> & {
|
|
9115
|
-
label?:
|
|
9116
|
-
title?: Exclude<PlaceLabelConfig['title'], (place: Place) => string>;
|
|
9117
|
-
};
|
|
9219
|
+
label?: SerializableFeatureLabelConfig<PlaceLabelConfig>;
|
|
9118
9220
|
icon?: Omit<PlaceIconConfig, 'default' | 'categoryIcons' | 'mapping'> & {
|
|
9119
|
-
default?:
|
|
9120
|
-
image?: Omit<SerializableCustomImage, 'id'>;
|
|
9121
|
-
};
|
|
9221
|
+
default?: SerializablePinIconConfig;
|
|
9122
9222
|
categoryIcons?: SerializableCustomImage<MapStylePOICategory>[];
|
|
9123
9223
|
};
|
|
9124
9224
|
evAvailability?: Omit<EVAvailabilityConfig, 'formatText'>;
|
|
@@ -9554,7 +9654,8 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
9554
9654
|
private entryPointSourceID;
|
|
9555
9655
|
private layerIDPrefix;
|
|
9556
9656
|
private defaultPlaceIconID;
|
|
9557
|
-
private
|
|
9657
|
+
private paintedPin?;
|
|
9658
|
+
private addedCategoryIcons;
|
|
9558
9659
|
private shownConnections;
|
|
9559
9660
|
private readonly shownFeaturesHandlers;
|
|
9560
9661
|
/**
|
|
@@ -9631,8 +9732,6 @@ export declare class PlacesModule extends AbstractDataOwnedMapModule<PlacesSourc
|
|
|
9631
9732
|
private applyVisibilityTo;
|
|
9632
9733
|
private applyPlacesVisibility;
|
|
9633
9734
|
private setupImages;
|
|
9634
|
-
private addCategoryIcons;
|
|
9635
|
-
private addDefaultIcon;
|
|
9636
9735
|
private updateData;
|
|
9637
9736
|
/**
|
|
9638
9737
|
* Displays the given places on the map.
|
|
@@ -9978,6 +10077,37 @@ export declare const poiCategoryGroups: {
|
|
|
9978
10077
|
export type POICategoryGroup = keyof typeof poiCategoryGroups;
|
|
9979
10078
|
//#endregion
|
|
9980
10079
|
//#region src/pois/types/poisModuleConfig.d.ts
|
|
10080
|
+
/**
|
|
10081
|
+
* Custom icons for the POIs the map style draws, per category.
|
|
10082
|
+
*
|
|
10083
|
+
* @remarks
|
|
10084
|
+
* `categoryIcons` takes the entries {@link PlaceIconConfig.categoryIcons} does, so one list restyles
|
|
10085
|
+
* the map's own POIs and the places a {@link PlacesModule} shows alike.
|
|
10086
|
+
*
|
|
10087
|
+
* @example
|
|
10088
|
+
* ```typescript
|
|
10089
|
+
* const categoryIcons = [{ id: 'RESTAURANT', image: restaurantSvg }];
|
|
10090
|
+
* await POIsModule.get(map, { icon: { categoryIcons } });
|
|
10091
|
+
* await PlacesModule.create(map, { markerType: 'base-map', icon: { categoryIcons } });
|
|
10092
|
+
* ```
|
|
10093
|
+
*
|
|
10094
|
+
* @group POIs
|
|
10095
|
+
*/
|
|
10096
|
+
type POIIconConfig = {
|
|
10097
|
+
/**
|
|
10098
|
+
* An icon per category, drawn in place of the style's own on the POIs of that category.
|
|
10099
|
+
*
|
|
10100
|
+
* @remarks
|
|
10101
|
+
* - The map style knows fewer categories than search does: `CAFE` and `CAFE_PUB` are one category
|
|
10102
|
+
* on the map, so an entry for either reaches both, and the first entry listed wins.
|
|
10103
|
+
* - The image is scaled with the style's own icons, `pois.sizeFactor` included, so one the size
|
|
10104
|
+
* of a style POI icon keeps the map's density. `offsetX` and `offsetY` move it.
|
|
10105
|
+
* - Entries without an `image`, and those with an `availabilityLevel`, change nothing: the map's
|
|
10106
|
+
* POIs carry no availability.
|
|
10107
|
+
* - The micro markers of minor POIs keep the style's dots.
|
|
10108
|
+
*/
|
|
10109
|
+
categoryIcons?: NonNullable<PlaceIconConfig['categoryIcons']>;
|
|
10110
|
+
};
|
|
9981
10111
|
/**
|
|
9982
10112
|
* A POI classification or group that can be filtered.
|
|
9983
10113
|
*
|
|
@@ -10060,6 +10190,10 @@ type POIsModuleConfig = MapModuleCommonConfig & {
|
|
|
10060
10190
|
* @default true
|
|
10061
10191
|
*/
|
|
10062
10192
|
visible?: boolean;
|
|
10193
|
+
/**
|
|
10194
|
+
* Custom icons per POI category, in place of the style's own.
|
|
10195
|
+
*/
|
|
10196
|
+
icon?: POIIconConfig;
|
|
10063
10197
|
/**
|
|
10064
10198
|
* Optional filters for controlling which POI categories are displayed.
|
|
10065
10199
|
*
|
|
@@ -10124,8 +10258,9 @@ type POIsKnob = KnobEntry<POIsKnobId, 'toggle' | 'enum' | 'enums'>;
|
|
|
10124
10258
|
*
|
|
10125
10259
|
* @remarks
|
|
10126
10260
|
* A knob is a plain display value in {@link POIsModuleConfig}, at the path its id names: whether
|
|
10127
|
-
* POIs show, and which categories. Not knobs: `
|
|
10128
|
-
* colours, micro markers — is the `pois.*`
|
|
10261
|
+
* POIs show, and which categories. Not knobs: `icon.categoryIcons`, which takes images, and `events`.
|
|
10262
|
+
* How the POIs look — size, zoom, label colours, micro markers — is the `pois.*`
|
|
10263
|
+
* {@link StylingModule} knobs'.
|
|
10129
10264
|
*
|
|
10130
10265
|
* @group POIs
|
|
10131
10266
|
*/
|
|
@@ -10245,8 +10380,9 @@ type PoIsSourcesAndLayers = {
|
|
|
10245
10380
|
* and include businesses, landmarks, and other points of interest.
|
|
10246
10381
|
*
|
|
10247
10382
|
* @remarks
|
|
10248
|
-
* **What this module owns:** whether the style's POIs are shown,
|
|
10249
|
-
* label colours and zoom thresholds are `pois.*` knobs on
|
|
10383
|
+
* **What this module owns:** whether the style's POIs are shown, which categories, and any custom icon
|
|
10384
|
+
* a category is drawn with. Their size, label colours and zoom thresholds are `pois.*` knobs on
|
|
10385
|
+
* {@link StylingModule}. The knob
|
|
10250
10386
|
* `pois.microMarkers` hides the micro markers within the POIs this module shows, and never shows
|
|
10251
10387
|
* them while this module hides the POIs.
|
|
10252
10388
|
* See [Who owns what](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#who-owns-what).
|
|
@@ -10255,6 +10391,7 @@ type PoIsSourcesAndLayers = {
|
|
|
10255
10391
|
* **Features:**
|
|
10256
10392
|
* - Toggle POI visibility on/off
|
|
10257
10393
|
* - Filter by POI categories or category groups
|
|
10394
|
+
* - Custom icons per POI category ({@link POIIconConfig})
|
|
10258
10395
|
* - Event handling for POI interactions
|
|
10259
10396
|
* - Based on vector tile data in the map style
|
|
10260
10397
|
*
|
|
@@ -10306,6 +10443,20 @@ type PoIsSourcesAndLayers = {
|
|
|
10306
10443
|
* ```
|
|
10307
10444
|
*
|
|
10308
10445
|
* @example
|
|
10446
|
+
* Custom icons per category, shared with the places a {@link PlacesModule} shows:
|
|
10447
|
+
* ```typescript
|
|
10448
|
+
* const categoryIcons = [
|
|
10449
|
+
* { id: 'RESTAURANT', image: restaurantSvg },
|
|
10450
|
+
* { id: 'HOTEL_OR_MOTEL', image: '/icons/hotel.png', pixelRatio: 2 },
|
|
10451
|
+
* ];
|
|
10452
|
+
* poisModule.updateConfig({ icon: { categoryIcons } });
|
|
10453
|
+
* searchResults.updateConfig({ icon: { categoryIcons } });
|
|
10454
|
+
*
|
|
10455
|
+
* // The style's own icons again
|
|
10456
|
+
* poisModule.updateConfig({ icon: undefined });
|
|
10457
|
+
* ```
|
|
10458
|
+
*
|
|
10459
|
+
* @example
|
|
10309
10460
|
* Event handling:
|
|
10310
10461
|
* ```typescript
|
|
10311
10462
|
* pois.events.on('click', (feature, lngLat) => {
|
|
@@ -10320,6 +10471,8 @@ type PoIsSourcesAndLayers = {
|
|
|
10320
10471
|
*/
|
|
10321
10472
|
export declare class POIsModule extends AbstractStyleOwnedMapModule<PoIsSourcesAndLayers, POIsModuleConfig> {
|
|
10322
10473
|
private categoriesFilter?;
|
|
10474
|
+
private styleIconLayout;
|
|
10475
|
+
private addedIcons;
|
|
10323
10476
|
/**
|
|
10324
10477
|
* Retrieves a POIsModule instance for the given map.
|
|
10325
10478
|
*
|
|
@@ -10403,6 +10556,7 @@ export declare class POIsModule extends AbstractStyleOwnedMapModule<PoIsSourcesA
|
|
|
10403
10556
|
setVisible(visible: boolean): void;
|
|
10404
10557
|
private _setVisible;
|
|
10405
10558
|
private applyCategoriesFilter;
|
|
10559
|
+
private applyCategoryIcons;
|
|
10406
10560
|
/**
|
|
10407
10561
|
* Returns features currently visible in the viewport.
|
|
10408
10562
|
*
|
|
@@ -10705,57 +10859,207 @@ export declare const sectionDrawsByDefault: (type: DrawnSectionType) => boolean;
|
|
|
10705
10859
|
*/
|
|
10706
10860
|
export declare const sectionSourceKey: <T extends DrawnSectionType>(type: T) => SectionSourceKey<T>;
|
|
10707
10861
|
//#endregion
|
|
10708
|
-
//#region src/routing/types/
|
|
10862
|
+
//#region src/routing/types/waypointDisplayProps.d.ts
|
|
10709
10863
|
/**
|
|
10710
|
-
* The MapLibre layer id of a generated section's line layer.
|
|
10711
|
-
*
|
|
10712
|
-
* @remarks
|
|
10713
|
-
* Derived from the section type, so `motorway` is drawn by `routeSectionMotorwayLine`.
|
|
10714
10864
|
* @group Routing
|
|
10715
10865
|
*/
|
|
10716
|
-
|
|
10866
|
+
export declare const START_INDEX = "start";
|
|
10717
10867
|
/**
|
|
10718
|
-
* The MapLibre layer id of a section's icon layer.
|
|
10719
|
-
*
|
|
10720
|
-
* @remarks
|
|
10721
|
-
* Added to a generated section as soon as `sections.<type>.icon` asks for one, so `motorway` draws
|
|
10722
|
-
* its icon through `routeSectionMotorwaySymbol`.
|
|
10723
10868
|
* @group Routing
|
|
10724
10869
|
*/
|
|
10725
|
-
|
|
10870
|
+
export declare const MIDDLE_INDEX = "middle";
|
|
10726
10871
|
/**
|
|
10727
|
-
* The MapLibre layer id drawing the signs of one generated section type.
|
|
10728
|
-
*
|
|
10729
|
-
* @remarks
|
|
10730
|
-
* Present for the types that post their own value on a sign, so `speedLimit` draws its signs
|
|
10731
|
-
* through `routeSectionSpeedLimitSign`.
|
|
10732
10872
|
* @group Routing
|
|
10733
10873
|
*/
|
|
10734
|
-
|
|
10874
|
+
export declare const FINISH_INDEX = "finish";
|
|
10735
10875
|
/**
|
|
10736
|
-
*
|
|
10876
|
+
* @group Routing
|
|
10877
|
+
*/
|
|
10878
|
+
export type WaypointIndexType = typeof START_INDEX | typeof MIDDLE_INDEX | typeof FINISH_INDEX;
|
|
10879
|
+
/**
|
|
10880
|
+
* Display properties for a waypoint marker on the map.
|
|
10881
|
+
*
|
|
10882
|
+
* Extends location display properties with waypoint-specific information
|
|
10883
|
+
* including position in the route and stop numbering.
|
|
10737
10884
|
*
|
|
10738
10885
|
* @remarks
|
|
10739
|
-
*
|
|
10740
|
-
*
|
|
10741
|
-
*
|
|
10886
|
+
* Waypoints are displayed differently based on their position:
|
|
10887
|
+
* - **Start**: Origin marker (often "A" or green pin)
|
|
10888
|
+
* - **Middle**: Numbered stop markers (1, 2, 3, etc.)
|
|
10889
|
+
* - **Finish**: Destination marker (often "B" or red pin)
|
|
10742
10890
|
*
|
|
10743
|
-
*
|
|
10891
|
+
* @example
|
|
10892
|
+
* ```typescript
|
|
10893
|
+
* // Start waypoint
|
|
10894
|
+
* const start: WaypointDisplayProps = {
|
|
10895
|
+
* id: 'waypoint-0',
|
|
10896
|
+
* iconID: 'waypoint-start',
|
|
10897
|
+
* index: 0,
|
|
10898
|
+
* indexType: 'start',
|
|
10899
|
+
* title: 'Amsterdam Central Station'
|
|
10900
|
+
* };
|
|
10901
|
+
*
|
|
10902
|
+
* // Intermediate stop
|
|
10903
|
+
* const stop: WaypointDisplayProps = {
|
|
10904
|
+
* id: 'waypoint-1',
|
|
10905
|
+
* iconID: 'waypoint-stop',
|
|
10906
|
+
* index: 1,
|
|
10907
|
+
* indexType: 'middle',
|
|
10908
|
+
* stopDisplayIndex: 1,
|
|
10909
|
+
* title: 'Schiphol Airport'
|
|
10910
|
+
* };
|
|
10911
|
+
*
|
|
10912
|
+
* // Destination
|
|
10913
|
+
* const finish: WaypointDisplayProps = {
|
|
10914
|
+
* id: 'waypoint-2',
|
|
10915
|
+
* iconID: 'waypoint-finish',
|
|
10916
|
+
* index: 2,
|
|
10917
|
+
* indexType: 'finish',
|
|
10918
|
+
* title: 'Rotterdam Central Station'
|
|
10919
|
+
* };
|
|
10920
|
+
* ```
|
|
10744
10921
|
*
|
|
10745
10922
|
* @group Routing
|
|
10746
10923
|
*/
|
|
10747
|
-
type
|
|
10924
|
+
export type WaypointDisplayProps = PlaceDisplayProps & {
|
|
10748
10925
|
/**
|
|
10749
|
-
*
|
|
10926
|
+
* The index of the waypoint in relation to the other waypoints.
|
|
10750
10927
|
*
|
|
10751
10928
|
* @remarks
|
|
10752
|
-
*
|
|
10753
|
-
*
|
|
10929
|
+
* Zero-based index of this waypoint in the complete waypoints array,
|
|
10930
|
+
* including start, all stops, and finish.
|
|
10931
|
+
*
|
|
10932
|
+
* @example
|
|
10933
|
+
* ```typescript
|
|
10934
|
+
* index: 0 // First waypoint (start)
|
|
10935
|
+
* index: 1 // Second waypoint (first stop or finish)
|
|
10936
|
+
* index: 2 // Third waypoint
|
|
10937
|
+
* ```
|
|
10754
10938
|
*/
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10939
|
+
index: number;
|
|
10940
|
+
/**
|
|
10941
|
+
* The type associated to the index, describing how the waypoint sits in the list of waypoints.
|
|
10942
|
+
*
|
|
10943
|
+
* @remarks
|
|
10944
|
+
* Determines the waypoint's role and visual representation:
|
|
10945
|
+
* - `start`: Origin point
|
|
10946
|
+
* - `middle`: Intermediate stop
|
|
10947
|
+
* - `finish`: Final destination
|
|
10948
|
+
*
|
|
10949
|
+
* This affects icon selection and labeling behavior.
|
|
10950
|
+
*/
|
|
10951
|
+
indexType: WaypointIndexType;
|
|
10952
|
+
/**
|
|
10953
|
+
* The stop index to be displayed.
|
|
10954
|
+
*
|
|
10955
|
+
* @remarks
|
|
10956
|
+
* Stops are the waypoints between origin and destination, numbered starting from 1.
|
|
10957
|
+
* Only present for middle waypoints.
|
|
10958
|
+
*
|
|
10959
|
+
* **Display Behavior:**
|
|
10960
|
+
* - Start waypoint: undefined
|
|
10961
|
+
* - First stop: 1
|
|
10962
|
+
* - Second stop: 2
|
|
10963
|
+
* - Finish waypoint: undefined
|
|
10964
|
+
*
|
|
10965
|
+
* Used for displaying stop numbers (e.g., "Stop 1", "Stop 2") in the UI.
|
|
10966
|
+
*
|
|
10967
|
+
* @example
|
|
10968
|
+
* ```typescript
|
|
10969
|
+
* stopDisplayIndex: 1 // First intermediate stop
|
|
10970
|
+
* stopDisplayIndex: 2 // Second intermediate stop
|
|
10971
|
+
* stopDisplayIndex: undefined // Start or finish waypoint
|
|
10972
|
+
* ```
|
|
10973
|
+
*/
|
|
10974
|
+
stopDisplayIndex?: number;
|
|
10975
|
+
/**
|
|
10976
|
+
* The mark the stop's pin draws inside it, under {@link WaypointsConfig.stopNumbering}: `'2'`
|
|
10977
|
+
* or `'B'` for the second stop.
|
|
10978
|
+
*
|
|
10979
|
+
* @remarks
|
|
10980
|
+
* Absent on the origin and destination, under `'none'`, and on a stop drawn with a `middle.image`
|
|
10981
|
+
* or a mapped icon, none of which carries a mark.
|
|
10982
|
+
*/
|
|
10983
|
+
stopDisplayLabel?: string;
|
|
10984
|
+
/**
|
|
10985
|
+
* How long the route waits at this waypoint, formatted for display.
|
|
10986
|
+
*
|
|
10987
|
+
* @remarks
|
|
10988
|
+
* Taken from {@link WaypointProps.pauseDurationSeconds} and rendered on the stop's label by
|
|
10989
|
+
* default (e.g. `30 min`). Absent when the waypoint carries no wait. Charging-stop pins carry
|
|
10990
|
+
* the same property, so both kinds of pin say how long you are there in the same words.
|
|
10991
|
+
*
|
|
10992
|
+
* @example
|
|
10993
|
+
* ```typescript
|
|
10994
|
+
* stopDuration: '30 min'
|
|
10995
|
+
* ```
|
|
10996
|
+
*/
|
|
10997
|
+
stopDuration?: string;
|
|
10998
|
+
};
|
|
10999
|
+
/**
|
|
11000
|
+
* A waypoint as {@link RoutingModule} draws it, as `waypoints.icon.mapping` and
|
|
11001
|
+
* `waypoints.label.title` receive it: the properties it was given — a place's, when it was a search
|
|
11002
|
+
* result — and its {@link WaypointDisplayProps}.
|
|
11003
|
+
*
|
|
11004
|
+
* @group Routing
|
|
11005
|
+
*/
|
|
11006
|
+
export type DisplayWaypoint = Waypoint<WaypointDisplayProps & Partial<CommonPlaceProps>>;
|
|
11007
|
+
/**
|
|
11008
|
+
* @ignore
|
|
11009
|
+
*/
|
|
11010
|
+
export declare const STOP_DISPLAY_LABEL = "stopDisplayLabel";
|
|
11011
|
+
//#endregion
|
|
11012
|
+
//#region src/routing/types/routeModuleConfig.d.ts
|
|
11013
|
+
/**
|
|
11014
|
+
* The MapLibre layer id of a generated section's line layer.
|
|
11015
|
+
*
|
|
11016
|
+
* @remarks
|
|
11017
|
+
* Derived from the section type, so `motorway` is drawn by `routeSectionMotorwayLine`.
|
|
11018
|
+
* @group Routing
|
|
11019
|
+
*/
|
|
11020
|
+
type SectionLineLayerName<T extends GeneratedSectionType = GeneratedSectionType> = `routeSection${Capitalize<T>}Line`;
|
|
11021
|
+
/**
|
|
11022
|
+
* The MapLibre layer id of a section's icon layer.
|
|
11023
|
+
*
|
|
11024
|
+
* @remarks
|
|
11025
|
+
* Added to a generated section as soon as `sections.<type>.icon` asks for one, so `motorway` draws
|
|
11026
|
+
* its icon through `routeSectionMotorwaySymbol`.
|
|
11027
|
+
* @group Routing
|
|
11028
|
+
*/
|
|
11029
|
+
type SectionSymbolLayerName<T extends GeneratedSectionType = GeneratedSectionType> = `routeSection${Capitalize<T>}Symbol`;
|
|
11030
|
+
/**
|
|
11031
|
+
* The MapLibre layer id drawing the signs of one generated section type.
|
|
11032
|
+
*
|
|
11033
|
+
* @remarks
|
|
11034
|
+
* Present for the types that post their own value on a sign, so `speedLimit` draws its signs
|
|
11035
|
+
* through `routeSectionSpeedLimitSign`.
|
|
11036
|
+
* @group Routing
|
|
11037
|
+
*/
|
|
11038
|
+
type SectionSignLayerName<T extends GeneratedSectionType = GeneratedSectionType> = `routeSection${Capitalize<T>}Sign`;
|
|
11039
|
+
/**
|
|
11040
|
+
* Detailed configuration for the visual appearance of route layers on the map with the MapLibre specification.
|
|
11041
|
+
*
|
|
11042
|
+
* @remarks
|
|
11043
|
+
* Provides fine-grained control over all route visualization layers, including
|
|
11044
|
+
* main route lines, waypoints, route sections (ferry, tunnel, toll roads, etc.),
|
|
11045
|
+
* turn-by-turn guidance instructions, and route summaries.
|
|
11046
|
+
*
|
|
11047
|
+
* All fields are optional. When a field is not provided, the default styling will be used.
|
|
11048
|
+
*
|
|
11049
|
+
* @group Routing
|
|
11050
|
+
*/
|
|
11051
|
+
type RouteLayersConfig = {
|
|
11052
|
+
/**
|
|
11053
|
+
* Main route line layer specifications.
|
|
11054
|
+
*
|
|
11055
|
+
* @remarks
|
|
11056
|
+
* Defines the visual styling for the primary route path displayed on the map.
|
|
11057
|
+
* Can include both line and symbol layers for enhanced visualization.
|
|
11058
|
+
*/
|
|
11059
|
+
mainLines?: {
|
|
11060
|
+
/**
|
|
11061
|
+
* Styling for the primary, selected route line.
|
|
11062
|
+
*
|
|
10759
11063
|
* @remarks
|
|
10760
11064
|
* Controls the visual appearance of the active route's line (color, width, dash pattern, etc.).
|
|
10761
11065
|
*/
|
|
@@ -11147,48 +11451,142 @@ type ChargingStopsConfig = {
|
|
|
11147
11451
|
icon?: ChargingStopIconConfig;
|
|
11148
11452
|
};
|
|
11149
11453
|
/**
|
|
11150
|
-
*
|
|
11454
|
+
* The waypoint pins: one per role — origin, stops, destination — each in the SDK's pin or an image
|
|
11455
|
+
* of your own, and an optional icon per waypoint picked from its data.
|
|
11151
11456
|
*
|
|
11152
11457
|
* @remarks
|
|
11153
|
-
*
|
|
11154
|
-
*
|
|
11458
|
+
* A pin's style is laid over, in order: the route colour as its fill, `style`, and the role's own
|
|
11459
|
+
* `style`. A role's `image` replaces its pin, and `mapping` replaces the role's icon for the
|
|
11460
|
+
* waypoints it returns an id or category for.
|
|
11461
|
+
*
|
|
11462
|
+
* @example
|
|
11463
|
+
* ```typescript
|
|
11464
|
+
* const icon: WaypointIconConfig = {
|
|
11465
|
+
* style: { outlineColor: '#FFFFFF' },
|
|
11466
|
+
* start: { style: { fillColor: '#1B7A43' } },
|
|
11467
|
+
* finish: { image: { image: '/flag.svg', pixelRatio: 2 } },
|
|
11468
|
+
* // Stops that are charging stations look like the map's charging stations:
|
|
11469
|
+
* mapping: { to: 'poiCategory', fn: (waypoint) => waypoint.properties.poi?.categories?.[0] },
|
|
11470
|
+
* };
|
|
11471
|
+
* ```
|
|
11155
11472
|
*
|
|
11156
11473
|
* @group Routing
|
|
11157
11474
|
*/
|
|
11158
|
-
type
|
|
11475
|
+
type WaypointIconConfig = {
|
|
11159
11476
|
/**
|
|
11160
|
-
*
|
|
11477
|
+
* Style of all three pins, under each role's own `style`.
|
|
11478
|
+
*/
|
|
11479
|
+
style?: SVGIconStyleOptions;
|
|
11480
|
+
/**
|
|
11481
|
+
* The origin's pin.
|
|
11482
|
+
*/
|
|
11483
|
+
start?: PinIconConfig;
|
|
11484
|
+
/**
|
|
11485
|
+
* The pin of every stop between origin and destination.
|
|
11486
|
+
*/
|
|
11487
|
+
middle?: PinIconConfig;
|
|
11488
|
+
/**
|
|
11489
|
+
* The destination's pin.
|
|
11490
|
+
*/
|
|
11491
|
+
finish?: PinIconConfig;
|
|
11492
|
+
/**
|
|
11493
|
+
* Images for `mapping` to pick by id.
|
|
11161
11494
|
*
|
|
11162
11495
|
* @remarks
|
|
11163
|
-
*
|
|
11496
|
+
* Added under their own `id`, so `mapping` returns that id. An entry's `offsetX`/`offsetY`
|
|
11497
|
+
* shift that icon from the waypoint's position, and only apply to an entry with an `image`; one
|
|
11498
|
+
* naming a sprite icon by `id` alone ignores them.
|
|
11499
|
+
*/
|
|
11500
|
+
customIcons?: CustomImage[];
|
|
11501
|
+
/**
|
|
11502
|
+
* The icon of each waypoint, picked from its data.
|
|
11164
11503
|
*
|
|
11504
|
+
* @remarks
|
|
11505
|
+
* `fn` receives the waypoint as drawn — its own properties, plus its `indexType` role and the
|
|
11506
|
+
* role's `iconID` — and returning `undefined` keeps the role's pin. A `poiCategory` draws the
|
|
11507
|
+
* pin {@link PlacesModule} draws for that category. A mapped icon carries no
|
|
11508
|
+
* {@link WaypointStopNumbering | stop mark}.
|
|
11165
11509
|
*/
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11510
|
+
mapping?: IconMapping<DisplayWaypoint>;
|
|
11511
|
+
};
|
|
11512
|
+
/**
|
|
11513
|
+
* How the stops between origin and destination are marked inside their pin.
|
|
11514
|
+
*
|
|
11515
|
+
* @remarks
|
|
11516
|
+
* - `numbers`: 1, 2, 3…
|
|
11517
|
+
* - `letters`: A, B, C…, then AA, AB… after Z.
|
|
11518
|
+
* - `none`: an empty pin.
|
|
11519
|
+
*
|
|
11520
|
+
* Only the SDK's stop pin carries the mark: a `middle.image` or a mapped icon draws without one.
|
|
11521
|
+
*
|
|
11522
|
+
* @group Routing
|
|
11523
|
+
*/
|
|
11524
|
+
type WaypointStopNumbering = 'numbers' | 'letters' | 'none';
|
|
11525
|
+
/**
|
|
11526
|
+
* The waypoint labels: whether they show, what they say and how they look.
|
|
11527
|
+
*
|
|
11528
|
+
* @remarks
|
|
11529
|
+
* Unset colours follow the map's light/dark theme, as the labels of places and geometries do:
|
|
11530
|
+
* `'#333333'` text on a `'#FFFFFF'` halo on a light map, the two swapped on a dark one. By default
|
|
11531
|
+
* a label writes the waypoint's POI name or address, and under it how long the route waits there.
|
|
11532
|
+
*
|
|
11533
|
+
* @group Routing
|
|
11534
|
+
*/
|
|
11535
|
+
type WaypointLabelConfig = FeatureLabelConfig<DisplayWaypoint> & {
|
|
11536
|
+
/**
|
|
11537
|
+
* Whether the labels show.
|
|
11538
|
+
*
|
|
11539
|
+
* @defaultValue `true`
|
|
11540
|
+
*/
|
|
11541
|
+
visible?: boolean;
|
|
11542
|
+
};
|
|
11543
|
+
/**
|
|
11544
|
+
* How a hovered or clicked waypoint is drawn: its pin and its stop mark grow.
|
|
11545
|
+
*
|
|
11546
|
+
* @remarks
|
|
11547
|
+
* The waypoints draw their event states once a handler covers them, or
|
|
11548
|
+
* `routing.events.waypoints.putEventState` puts one.
|
|
11549
|
+
*
|
|
11550
|
+
* @group Routing
|
|
11551
|
+
*/
|
|
11552
|
+
type WaypointHighlightConfig = {
|
|
11184
11553
|
/**
|
|
11185
|
-
*
|
|
11554
|
+
* Multiplier on the size of a hovered or clicked waypoint's pin; `1` draws it as any other.
|
|
11186
11555
|
*
|
|
11187
11556
|
* @remarks
|
|
11188
|
-
*
|
|
11189
|
-
*
|
|
11557
|
+
* Clamped to {@link ROUTE_WAYPOINT_HIGHLIGHT_SIZE_FACTOR_RANGE}, 1 to 1.5.
|
|
11558
|
+
*
|
|
11559
|
+
* @defaultValue `1.2`
|
|
11190
11560
|
*/
|
|
11191
|
-
|
|
11561
|
+
sizeFactor?: number;
|
|
11562
|
+
};
|
|
11563
|
+
/**
|
|
11564
|
+
* How the module draws the waypoints {@link RoutingModule.showWaypoints} is given.
|
|
11565
|
+
*
|
|
11566
|
+
* @remarks
|
|
11567
|
+
* Each setting reaches the waypoints already shown.
|
|
11568
|
+
*
|
|
11569
|
+
* @group Routing
|
|
11570
|
+
*/
|
|
11571
|
+
type WaypointsConfig = {
|
|
11572
|
+
/**
|
|
11573
|
+
* The waypoint pins, per role, and an optional icon per waypoint picked from its data.
|
|
11574
|
+
*/
|
|
11575
|
+
icon?: WaypointIconConfig;
|
|
11576
|
+
/**
|
|
11577
|
+
* How the stops between origin and destination are marked inside their pin.
|
|
11578
|
+
*
|
|
11579
|
+
* @defaultValue `"numbers"`
|
|
11580
|
+
*/
|
|
11581
|
+
stopNumbering?: WaypointStopNumbering;
|
|
11582
|
+
/**
|
|
11583
|
+
* The waypoint labels: whether they show, what they say and how they look.
|
|
11584
|
+
*/
|
|
11585
|
+
label?: WaypointLabelConfig;
|
|
11586
|
+
/**
|
|
11587
|
+
* How a hovered or clicked waypoint is drawn.
|
|
11588
|
+
*/
|
|
11589
|
+
highlight?: WaypointHighlightConfig;
|
|
11192
11590
|
/**
|
|
11193
11591
|
* Controls how entry points are used when displaying waypoints on the map.
|
|
11194
11592
|
*
|
|
@@ -11224,7 +11622,7 @@ type RouteWidth = 's' | 'm' | 'l';
|
|
|
11224
11622
|
* Route waypoint icon size preset.
|
|
11225
11623
|
*
|
|
11226
11624
|
* @remarks
|
|
11227
|
-
* Controls the scale of waypoint pins, and of the stop
|
|
11625
|
+
* Controls the scale of waypoint pins, and of the stop mark inside them, at all zoom levels:
|
|
11228
11626
|
* `"s"` is 0.75 × `"m"` and `"l"` is 1.25 × `"m"`. {@link RoutingModuleConfig.waypointSizeFactor}
|
|
11229
11627
|
* multiplies whichever preset applies.
|
|
11230
11628
|
*
|
|
@@ -11742,11 +12140,14 @@ type RoutingModuleConfig = MapModuleCommonConfig & {
|
|
|
11742
12140
|
* @remarks
|
|
11743
12141
|
* It leaves out what JSON cannot carry, which a replay adds back in code:
|
|
11744
12142
|
* - `chargingStops.icon.mapping` with `basedOn: 'custom'`, whose `fn` is a function.
|
|
11745
|
-
* - `
|
|
12143
|
+
* - `waypoints.icon.mapping` and `waypoints.label.title` as a function — a MapLibre expression
|
|
12144
|
+
* title serializes.
|
|
12145
|
+
* - Any image given as an `HTMLImageElement`: `chargingStops.icon.customIcons`,
|
|
12146
|
+
* `waypoints.icon.customIcons` and each waypoint role's `image` — see {@link SerializableCustomImage}.
|
|
11746
12147
|
*
|
|
11747
12148
|
* @group Routing
|
|
11748
12149
|
*/
|
|
11749
|
-
type RoutingModuleSerializableConfig = Omit<RoutingModuleConfig, 'chargingStops'> & {
|
|
12150
|
+
type RoutingModuleSerializableConfig = Omit<RoutingModuleConfig, 'chargingStops' | 'waypoints'> & {
|
|
11750
12151
|
chargingStops?: Omit<ChargingStopsConfig, 'icon'> & {
|
|
11751
12152
|
icon?: Omit<ChargingStopIconConfig, 'customIcons' | 'mapping'> & {
|
|
11752
12153
|
customIcons?: SerializableCustomImage[];
|
|
@@ -11755,6 +12156,12 @@ type RoutingModuleSerializableConfig = Omit<RoutingModuleConfig, 'chargingStops'
|
|
|
11755
12156
|
}>;
|
|
11756
12157
|
};
|
|
11757
12158
|
};
|
|
12159
|
+
waypoints?: Omit<WaypointsConfig, 'icon' | 'label'> & {
|
|
12160
|
+
icon?: Omit<WaypointIconConfig, WaypointIndexType | 'customIcons' | 'mapping'> & { [R in WaypointIndexType]?: SerializablePinIconConfig; } & {
|
|
12161
|
+
customIcons?: SerializableCustomImage[];
|
|
12162
|
+
};
|
|
12163
|
+
label?: SerializableFeatureLabelConfig<WaypointLabelConfig>;
|
|
12164
|
+
};
|
|
11758
12165
|
};
|
|
11759
12166
|
//#endregion
|
|
11760
12167
|
//#region src/routing/types/routingKnobs.d.ts
|
|
@@ -11768,7 +12175,7 @@ type LeafPathOf<T> = { [KEY in keyof T & string]-?: NonNullable<T[KEY]> extends
|
|
|
11768
12175
|
*
|
|
11769
12176
|
* @group Routing
|
|
11770
12177
|
*/
|
|
11771
|
-
type RoutingKnobId = 'visible' | 'color' | 'width' | 'widthFactor' | `highlight.${keyof RouteHighlightConfig}` | 'waypointSize' | 'waypointSizeFactor' | `waypoints.icon.style.${keyof SVGIconStyleOptions}` | `waypoints.label.${Extract<keyof
|
|
12178
|
+
type RoutingKnobId = 'visible' | 'color' | 'width' | 'widthFactor' | `highlight.${keyof RouteHighlightConfig}` | 'waypointSize' | 'waypointSizeFactor' | `waypoints.icon.style.${keyof SVGIconStyleOptions}` | `waypoints.icon.${WaypointIndexType}.style.${keyof SVGIconStyleOptions}` | 'waypoints.stopNumbering' | `waypoints.label.${Extract<keyof WaypointLabelConfig, 'visible' | 'color' | 'haloColor'>}` | `waypoints.highlight.${keyof WaypointHighlightConfig}` | '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];
|
|
11772
12179
|
/**
|
|
11773
12180
|
* The value type a given routing knob takes: the plain value its path holds in {@link RoutingModuleConfig}.
|
|
11774
12181
|
*
|
|
@@ -11792,8 +12199,9 @@ type RoutingKnob = KnobEntry<RoutingKnobId, Exclude<KnobKind, 'offset' | 'enums'
|
|
|
11792
12199
|
*
|
|
11793
12200
|
* @remarks
|
|
11794
12201
|
* A knob is a plain display value in {@link RoutingModuleConfig}, at the path its id names. Not
|
|
11795
|
-
* knobs: `layers`, `beforeLayerConfig
|
|
11796
|
-
* or MapLibre values, and `events`. A
|
|
12202
|
+
* knobs: `layers`, `beforeLayerConfig`, the charging stop icons and title, the waypoint images, icon
|
|
12203
|
+
* mapping and label title, which take structured, function or MapLibre values, and `events`. A
|
|
12204
|
+
* `displayUnits` knob left unset follows the global config.
|
|
11797
12205
|
*
|
|
11798
12206
|
* @group Routing
|
|
11799
12207
|
*/
|
|
@@ -11820,12 +12228,10 @@ type TrafficDelayColors = Record<Extract<DelayMagnitude, 'minor' | 'moderate' |
|
|
|
11820
12228
|
* @param instanceIndex - Optional instance index for image ID suffixes.
|
|
11821
12229
|
* @param lightDark - The map style's light/dark theme, which the waypoint labels and the country
|
|
11822
12230
|
* crossing plaques follow.
|
|
11823
|
-
* @param existingLayerID - The anchor a configured `beforeLayerConfig` target resolves to, given the
|
|
11824
|
-
* layer it names: that layer when the style has it, else undefined for the top of the stack.
|
|
11825
12231
|
* @param trafficColors - The colours traffic sections draw each delay magnitude in.
|
|
11826
12232
|
* @ignore
|
|
11827
12233
|
*/
|
|
11828
|
-
export declare const buildRoutingLayers: (config?: RoutingModuleConfig, layerIDPrefix?: string, instanceIndex?: number, lightDark?: LightDark,
|
|
12234
|
+
export declare const buildRoutingLayers: (config?: RoutingModuleConfig, layerIDPrefix?: string, instanceIndex?: number, lightDark?: LightDark, trafficColors?: TrafficDelayColors) => Required<RouteLayersConfig>;
|
|
11829
12235
|
/**
|
|
11830
12236
|
* Default routing layers configuration. Calls routingLayers with no parameters.
|
|
11831
12237
|
*
|
|
@@ -11925,6 +12331,14 @@ export declare const ROUTE_WIDTH_FACTOR_RANGE: KnobRange;
|
|
|
11925
12331
|
* @group Routing
|
|
11926
12332
|
*/
|
|
11927
12333
|
export declare const ROUTE_WAYPOINT_SIZE_FACTOR_RANGE: KnobRange;
|
|
12334
|
+
/**
|
|
12335
|
+
* The values {@link WaypointHighlightConfig.sizeFactor} is clamped to.
|
|
12336
|
+
*
|
|
12337
|
+
* @remarks
|
|
12338
|
+
* Past 1.5 a hovered pin covers its neighbours' at the zooms where stops sit close together.
|
|
12339
|
+
* @group Routing
|
|
12340
|
+
*/
|
|
12341
|
+
export declare const ROUTE_WAYPOINT_HIGHLIGHT_SIZE_FACTOR_RANGE: KnobRange;
|
|
11928
12342
|
/**
|
|
11929
12343
|
* The values {@link SectionIconConfig.sizeFactor} is clamped to.
|
|
11930
12344
|
*
|
|
@@ -11983,14 +12397,17 @@ export declare const getLineOutlineWidth: (lineWidth?: RouteLineWidth) => Expres
|
|
|
11983
12397
|
*/
|
|
11984
12398
|
export declare const getWaypointIconSize: (size?: RouteWaypointSize, sizeFactor?: number) => ExpressionSpecification;
|
|
11985
12399
|
/**
|
|
11986
|
-
* Returns the text size expression of the stop
|
|
11987
|
-
*
|
|
11988
|
-
* @remarks
|
|
11989
|
-
* Scales with the pin by {@link getWaypointIconSize}'s factor: the number's offset is in ems, so
|
|
11990
|
-
* it stays inside the pin head at every size.
|
|
12400
|
+
* Returns the text size expression of the stop mark drawn inside a waypoint pin: a fixed multiple
|
|
12401
|
+
* of {@link getWaypointIconSize}, so {@link STOP_MARK_TEXT_OFFSET} centres it at every size and zoom.
|
|
11991
12402
|
* @ignore
|
|
11992
12403
|
*/
|
|
11993
12404
|
export declare const getWaypointIndexTextSize: (size?: RouteWaypointSize, sizeFactor?: number) => ExpressionSpecification;
|
|
12405
|
+
/**
|
|
12406
|
+
* The offset of a stop mark from its waypoint's point, in ems of its text size: the pin head's
|
|
12407
|
+
* centre.
|
|
12408
|
+
* @ignore
|
|
12409
|
+
*/
|
|
12410
|
+
export declare const STOP_MARK_TEXT_OFFSET: [number, number];
|
|
11994
12411
|
/**
|
|
11995
12412
|
* Returns the width expression of a section halo for the given width.
|
|
11996
12413
|
*
|
|
@@ -12611,139 +13028,6 @@ type DisplayTrafficSectionProps = DisplaySectionProps & TrafficSectionProps & {
|
|
|
12611
13028
|
title?: string;
|
|
12612
13029
|
};
|
|
12613
13030
|
//#endregion
|
|
12614
|
-
//#region src/routing/types/waypointDisplayProps.d.ts
|
|
12615
|
-
/**
|
|
12616
|
-
* @group Routing
|
|
12617
|
-
*/
|
|
12618
|
-
export declare const START_INDEX = "start";
|
|
12619
|
-
/**
|
|
12620
|
-
* @group Routing
|
|
12621
|
-
*/
|
|
12622
|
-
export declare const MIDDLE_INDEX = "middle";
|
|
12623
|
-
/**
|
|
12624
|
-
* @group Routing
|
|
12625
|
-
*/
|
|
12626
|
-
export declare const FINISH_INDEX = "finish";
|
|
12627
|
-
/**
|
|
12628
|
-
* @group Routing
|
|
12629
|
-
*/
|
|
12630
|
-
export type WaypointIndexType = typeof START_INDEX | typeof MIDDLE_INDEX | typeof FINISH_INDEX;
|
|
12631
|
-
/**
|
|
12632
|
-
* Display properties for a waypoint marker on the map.
|
|
12633
|
-
*
|
|
12634
|
-
* Extends location display properties with waypoint-specific information
|
|
12635
|
-
* including position in the route and stop numbering.
|
|
12636
|
-
*
|
|
12637
|
-
* @remarks
|
|
12638
|
-
* Waypoints are displayed differently based on their position:
|
|
12639
|
-
* - **Start**: Origin marker (often "A" or green pin)
|
|
12640
|
-
* - **Middle**: Numbered stop markers (1, 2, 3, etc.)
|
|
12641
|
-
* - **Finish**: Destination marker (often "B" or red pin)
|
|
12642
|
-
*
|
|
12643
|
-
* @example
|
|
12644
|
-
* ```typescript
|
|
12645
|
-
* // Start waypoint
|
|
12646
|
-
* const start: WaypointDisplayProps = {
|
|
12647
|
-
* id: 'waypoint-0',
|
|
12648
|
-
* iconID: 'waypoint-start',
|
|
12649
|
-
* index: 0,
|
|
12650
|
-
* indexType: 'start',
|
|
12651
|
-
* title: 'Amsterdam Central Station'
|
|
12652
|
-
* };
|
|
12653
|
-
*
|
|
12654
|
-
* // Intermediate stop
|
|
12655
|
-
* const stop: WaypointDisplayProps = {
|
|
12656
|
-
* id: 'waypoint-1',
|
|
12657
|
-
* iconID: 'waypoint-stop',
|
|
12658
|
-
* index: 1,
|
|
12659
|
-
* indexType: 'middle',
|
|
12660
|
-
* stopDisplayIndex: 1,
|
|
12661
|
-
* title: 'Schiphol Airport'
|
|
12662
|
-
* };
|
|
12663
|
-
*
|
|
12664
|
-
* // Destination
|
|
12665
|
-
* const finish: WaypointDisplayProps = {
|
|
12666
|
-
* id: 'waypoint-2',
|
|
12667
|
-
* iconID: 'waypoint-finish',
|
|
12668
|
-
* index: 2,
|
|
12669
|
-
* indexType: 'finish',
|
|
12670
|
-
* title: 'Rotterdam Central Station'
|
|
12671
|
-
* };
|
|
12672
|
-
* ```
|
|
12673
|
-
*
|
|
12674
|
-
* @group Routing
|
|
12675
|
-
*/
|
|
12676
|
-
export type WaypointDisplayProps = PlaceDisplayProps & {
|
|
12677
|
-
/**
|
|
12678
|
-
* The index of the waypoint in relation to the other waypoints.
|
|
12679
|
-
*
|
|
12680
|
-
* @remarks
|
|
12681
|
-
* Zero-based index of this waypoint in the complete waypoints array,
|
|
12682
|
-
* including start, all stops, and finish.
|
|
12683
|
-
*
|
|
12684
|
-
* @example
|
|
12685
|
-
* ```typescript
|
|
12686
|
-
* index: 0 // First waypoint (start)
|
|
12687
|
-
* index: 1 // Second waypoint (first stop or finish)
|
|
12688
|
-
* index: 2 // Third waypoint
|
|
12689
|
-
* ```
|
|
12690
|
-
*/
|
|
12691
|
-
index: number;
|
|
12692
|
-
/**
|
|
12693
|
-
* The type associated to the index, describing how the waypoint sits in the list of waypoints.
|
|
12694
|
-
*
|
|
12695
|
-
* @remarks
|
|
12696
|
-
* Determines the waypoint's role and visual representation:
|
|
12697
|
-
* - `start`: Origin point
|
|
12698
|
-
* - `middle`: Intermediate stop
|
|
12699
|
-
* - `finish`: Final destination
|
|
12700
|
-
*
|
|
12701
|
-
* This affects icon selection and labeling behavior.
|
|
12702
|
-
*/
|
|
12703
|
-
indexType: WaypointIndexType;
|
|
12704
|
-
/**
|
|
12705
|
-
* The stop index to be displayed.
|
|
12706
|
-
*
|
|
12707
|
-
* @remarks
|
|
12708
|
-
* Stops are the waypoints between origin and destination, numbered starting from 1.
|
|
12709
|
-
* Only present for middle waypoints.
|
|
12710
|
-
*
|
|
12711
|
-
* **Display Behavior:**
|
|
12712
|
-
* - Start waypoint: undefined
|
|
12713
|
-
* - First stop: 1
|
|
12714
|
-
* - Second stop: 2
|
|
12715
|
-
* - Finish waypoint: undefined
|
|
12716
|
-
*
|
|
12717
|
-
* Used for displaying stop numbers (e.g., "Stop 1", "Stop 2") in the UI.
|
|
12718
|
-
*
|
|
12719
|
-
* @example
|
|
12720
|
-
* ```typescript
|
|
12721
|
-
* stopDisplayIndex: 1 // First intermediate stop
|
|
12722
|
-
* stopDisplayIndex: 2 // Second intermediate stop
|
|
12723
|
-
* stopDisplayIndex: undefined // Start or finish waypoint
|
|
12724
|
-
* ```
|
|
12725
|
-
*/
|
|
12726
|
-
stopDisplayIndex?: number;
|
|
12727
|
-
/**
|
|
12728
|
-
* How long the route waits at this waypoint, formatted for display.
|
|
12729
|
-
*
|
|
12730
|
-
* @remarks
|
|
12731
|
-
* Taken from {@link WaypointProps.pauseDurationSeconds} and rendered on the stop's label by
|
|
12732
|
-
* default (e.g. `30 min`). Absent when the waypoint carries no wait. Charging-stop pins carry
|
|
12733
|
-
* the same property, so both kinds of pin say how long you are there in the same words.
|
|
12734
|
-
*
|
|
12735
|
-
* @example
|
|
12736
|
-
* ```typescript
|
|
12737
|
-
* stopDuration: '30 min'
|
|
12738
|
-
* ```
|
|
12739
|
-
*/
|
|
12740
|
-
stopDuration?: string;
|
|
12741
|
-
};
|
|
12742
|
-
/**
|
|
12743
|
-
* @ignore
|
|
12744
|
-
*/
|
|
12745
|
-
export declare const STOP_DISPLAY_INDEX = "stopDisplayIndex";
|
|
12746
|
-
//#endregion
|
|
12747
13031
|
//#region src/routing/types/routingSourcesAndLayers.d.ts
|
|
12748
13032
|
/**
|
|
12749
13033
|
* @ignore
|
|
@@ -12860,14 +13144,15 @@ export type RoutingEvents = CombinedEvents<MapGeoJSONFeature, RoutingModuleConfi
|
|
|
12860
13144
|
* Map module for displaying and managing route visualizations.
|
|
12861
13145
|
*
|
|
12862
13146
|
* The RoutingModule provides comprehensive functionality for displaying routes on the map,
|
|
12863
|
-
* including route lines, alternative routes, turn-by-turn guidance, and
|
|
13147
|
+
* including route lines, alternative routes, turn-by-turn guidance, and waypoints.
|
|
12864
13148
|
* It integrates seamlessly with the TomTom Routing API.
|
|
12865
13149
|
*
|
|
12866
13150
|
* @remarks
|
|
12867
13151
|
* **Features:**
|
|
12868
13152
|
* - Display route lines with customizable styling
|
|
12869
13153
|
* - Show alternative routes with different styling
|
|
12870
|
-
* -
|
|
13154
|
+
* - Waypoint pins per role — origin, numbered or lettered stops, destination — with hover and
|
|
13155
|
+
* click events
|
|
12871
13156
|
* - Turn-by-turn guidance instructions
|
|
12872
13157
|
* - Route section highlighting
|
|
12873
13158
|
* - Distance and duration information
|
|
@@ -12912,7 +13197,8 @@ export type RoutingEvents = CombinedEvents<MapGeoJSONFeature, RoutingModuleConfi
|
|
|
12912
13197
|
export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSourcesWithLayers, RoutingModuleConfig> {
|
|
12913
13198
|
private layersSpecs;
|
|
12914
13199
|
private layerIDPrefix;
|
|
12915
|
-
private
|
|
13200
|
+
private paintedWaypointPins?;
|
|
13201
|
+
private shownWaypoints?;
|
|
12916
13202
|
private appliedDisplayUnits?;
|
|
12917
13203
|
private readonly shownFeaturesHandlers;
|
|
12918
13204
|
/**
|
|
@@ -12965,6 +13251,22 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
12965
13251
|
* @ignore
|
|
12966
13252
|
*/
|
|
12967
13253
|
protected _applyConfig(config?: RoutingModuleConfig): RoutingModuleConfig | undefined;
|
|
13254
|
+
/**
|
|
13255
|
+
* Adds the images the configuration brings: each waypoint role's pin, and the custom icons of
|
|
13256
|
+
* the waypoints and charging stops.
|
|
13257
|
+
*
|
|
13258
|
+
* @remarks
|
|
13259
|
+
* Runs on every config change and after every style change, which drops the images. A pin
|
|
13260
|
+
* follows the route colour under the configured styles, so a new accent repaints it too;
|
|
13261
|
+
* {@link paintPin} skips the ones nothing moved.
|
|
13262
|
+
*/
|
|
13263
|
+
private addConfiguredImages;
|
|
13264
|
+
/**
|
|
13265
|
+
* Draws the shown waypoints again when a waypoint setting or the time unit their stop durations
|
|
13266
|
+
* read in changed: the icon, stop mark and title each waypoint draws are on the feature.
|
|
13267
|
+
*/
|
|
13268
|
+
private reshowWaypoints;
|
|
13269
|
+
private displayWaypointsOf;
|
|
12968
13270
|
/**
|
|
12969
13271
|
* Shows the speed limit sections, each carrying the sign that posts it.
|
|
12970
13272
|
*
|
|
@@ -13062,8 +13364,7 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
13062
13364
|
* @remarks
|
|
13063
13365
|
* **Waypoints are NOT shown by this method.**
|
|
13064
13366
|
* Route lines are drawn but start/stop/destination markers are not. To display waypoint
|
|
13065
|
-
* markers, call {@link showWaypoints} separately.
|
|
13066
|
-
* {@link PlacesModule} to display waypoints as fully customizable place markers.
|
|
13367
|
+
* markers, call {@link showWaypoints} separately.
|
|
13067
13368
|
*
|
|
13068
13369
|
* **Behavior:**
|
|
13069
13370
|
* - Replaces any previously shown routes
|
|
@@ -13150,8 +13451,13 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
13150
13451
|
*
|
|
13151
13452
|
* @remarks
|
|
13152
13453
|
* Waypoint markers are **not** shown by {@link showRoutes} — this method must be called
|
|
13153
|
-
* separately to display them.
|
|
13154
|
-
*
|
|
13454
|
+
* separately to display them.
|
|
13455
|
+
*
|
|
13456
|
+
* Every location the route is calculated through belongs here, so that its pin carries its
|
|
13457
|
+
* role and stop mark and the route's events reach it. A place the user is still choosing
|
|
13458
|
+
* among is a {@link PlacesModule} marker: clear it there once it joins the route. Each pin is
|
|
13459
|
+
* drawn as {@link RoutingModuleConfig.waypoints} sets, the per-role pins and an icon mapped
|
|
13460
|
+
* from the waypoint's data included.
|
|
13155
13461
|
*
|
|
13156
13462
|
* @example
|
|
13157
13463
|
* Show routes and then waypoints:
|
|
@@ -13268,6 +13574,28 @@ export declare class RoutingModule extends AbstractDataOwnedMapModule<RoutingSou
|
|
|
13268
13574
|
getLayerToRenderLinesUnder(): string | undefined;
|
|
13269
13575
|
}
|
|
13270
13576
|
//#endregion
|
|
13577
|
+
//#region src/routing/util/displayWaypoints.d.ts
|
|
13578
|
+
/**
|
|
13579
|
+
* The label {@link RoutingModule} gives a waypoint when {@link WaypointLabelConfig.title} is not a
|
|
13580
|
+
* function: the POI name, else the free-form address, else none.
|
|
13581
|
+
*
|
|
13582
|
+
* @example
|
|
13583
|
+
* ```typescript
|
|
13584
|
+
* // "Home" at the finish, the default label elsewhere
|
|
13585
|
+
* routingModule.applyConfig({
|
|
13586
|
+
* waypoints: {
|
|
13587
|
+
* label: {
|
|
13588
|
+
* title: (waypoint) =>
|
|
13589
|
+
* waypoint.properties.indexType === 'finish' ? 'Home' : (buildWaypointTitle(waypoint) ?? ''),
|
|
13590
|
+
* },
|
|
13591
|
+
* },
|
|
13592
|
+
* });
|
|
13593
|
+
* ```
|
|
13594
|
+
*
|
|
13595
|
+
* @group Routing
|
|
13596
|
+
*/
|
|
13597
|
+
export declare const buildWaypointTitle: (waypoint: Waypoint) => string | undefined;
|
|
13598
|
+
//#endregion
|
|
13271
13599
|
//#region src/terrain/types/terrainModuleConfig.d.ts
|
|
13272
13600
|
/**
|
|
13273
13601
|
* Configuration of the {@link TerrainModule}: the two ways it draws the relief of the style's
|
|
@@ -13861,6 +14189,59 @@ type TrafficAreaAnalyticsModuleConfig = MapModuleCommonConfig & {
|
|
|
13861
14189
|
* Display options for the region polygon boundary drawn alongside the analytics data.
|
|
13862
14190
|
*/
|
|
13863
14191
|
regionPolygon?: AreaAnalyticsRegionPolygonConfig;
|
|
14192
|
+
/**
|
|
14193
|
+
* MapLibre overrides for the heatmap, the cells of each grid and the region boundary. A layer
|
|
14194
|
+
* hidden through its entry's `layout.visibility` stays hidden in its display mode.
|
|
14195
|
+
*/
|
|
14196
|
+
layers?: TrafficAreaAnalyticsLayersConfig;
|
|
14197
|
+
};
|
|
14198
|
+
/**
|
|
14199
|
+
* MapLibre overrides for the layers {@link TrafficAreaAnalyticsModule} draws, for what its
|
|
14200
|
+
* configuration doesn't cover. Each display mode draws its own: `heatmap` the heatmap, `hexgrid-2d`
|
|
14201
|
+
* the hexagon fill and outline, `hexgrid-3d` the hexagon extrusion and its highlight, and the same for
|
|
14202
|
+
* the square grid; the region boundary is drawn in every mode.
|
|
14203
|
+
*
|
|
14204
|
+
* @remarks
|
|
14205
|
+
* Each entry is a partial layer spec merged onto the module's own: top-level fields replace, `layout`
|
|
14206
|
+
* and `paint` merge per property, and what is set here takes precedence over the module's own
|
|
14207
|
+
* settings, the active metric's colours and heights included. A cell layer's `filter` applies
|
|
14208
|
+
* together with the active metric's `filters`. Where the layers sit is `beforeLayerConfig`'s,
|
|
14209
|
+
* so a `beforeID` here is ignored.
|
|
14210
|
+
*
|
|
14211
|
+
* @example
|
|
14212
|
+
* ```typescript
|
|
14213
|
+
* layers: {
|
|
14214
|
+
* hexgridFill: { paint: { 'fill-opacity': 0.85 } },
|
|
14215
|
+
* hexgridExtrusion: { paint: { 'fill-extrusion-vertical-gradient': false } },
|
|
14216
|
+
* regionLine: { paint: { 'line-dasharray': [2, 2] } },
|
|
14217
|
+
* }
|
|
14218
|
+
* ```
|
|
14219
|
+
*
|
|
14220
|
+
* @group Traffic Area Analytics
|
|
14221
|
+
*/
|
|
14222
|
+
type TrafficAreaAnalyticsLayersConfig = {
|
|
14223
|
+
/** The heatmap. */
|
|
14224
|
+
heatmap?: Partial<ToBeAddedLayerSpecTemplate<HeatmapLayerSpecification>>;
|
|
14225
|
+
/** The flat hexagons. */
|
|
14226
|
+
hexgridFill?: Partial<ToBeAddedLayerSpecTemplate<FillLayerSpecification>>;
|
|
14227
|
+
/** The outline of a hovered or clicked flat hexagon. */
|
|
14228
|
+
hexgridOutline?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
14229
|
+
/** The extruded hexagons. */
|
|
14230
|
+
hexgridExtrusion?: Partial<ToBeAddedLayerSpecTemplate<FillExtrusionLayerSpecification>>;
|
|
14231
|
+
/** The overlay of a hovered or clicked extruded hexagon, drawn over its `hexgridExtrusion`. */
|
|
14232
|
+
hexgridExtrusionHighlight?: Partial<ToBeAddedLayerSpecTemplate<FillExtrusionLayerSpecification>>;
|
|
14233
|
+
/** The flat squares. */
|
|
14234
|
+
squareFill?: Partial<ToBeAddedLayerSpecTemplate<FillLayerSpecification>>;
|
|
14235
|
+
/** The outline of a hovered or clicked flat square. */
|
|
14236
|
+
squareOutline?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
14237
|
+
/** The extruded squares. */
|
|
14238
|
+
squareExtrusion?: Partial<ToBeAddedLayerSpecTemplate<FillExtrusionLayerSpecification>>;
|
|
14239
|
+
/** The overlay of a hovered or clicked extruded square, drawn over its `squareExtrusion`. */
|
|
14240
|
+
squareExtrusionHighlight?: Partial<ToBeAddedLayerSpecTemplate<FillExtrusionLayerSpecification>>;
|
|
14241
|
+
/** The region's fill. */
|
|
14242
|
+
regionFill?: Partial<ToBeAddedLayerSpecTemplate<FillLayerSpecification>>;
|
|
14243
|
+
/** The region's boundary. */
|
|
14244
|
+
regionLine?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
13864
14245
|
};
|
|
13865
14246
|
//#endregion
|
|
13866
14247
|
//#region src/traffic/types/trafficCommonConfig.d.ts
|
|
@@ -14103,6 +14484,45 @@ export type IncidentFocusStyle = {
|
|
|
14103
14484
|
*/
|
|
14104
14485
|
widthFactor?: number;
|
|
14105
14486
|
};
|
|
14487
|
+
/**
|
|
14488
|
+
* MapLibre overrides for the layers {@link TrafficIncidentDetailsModule} draws, bottom to top, for
|
|
14489
|
+
* what its configuration doesn't cover.
|
|
14490
|
+
*
|
|
14491
|
+
* @remarks
|
|
14492
|
+
* Each entry is a partial layer spec merged onto the module's own: top-level fields replace, `layout`
|
|
14493
|
+
* and `paint` merge per property, and what is set here takes precedence over the module's own
|
|
14494
|
+
* settings, the incident colours and the focus treatment included. Where the layers sit is
|
|
14495
|
+
* `beforeLayerConfig`'s, so a `beforeID` here is ignored.
|
|
14496
|
+
*
|
|
14497
|
+
* @example
|
|
14498
|
+
* ```typescript
|
|
14499
|
+
* layers: {
|
|
14500
|
+
* // Markers from zoom 11, and no delay text next to the jams
|
|
14501
|
+
* incidentMarker: { minzoom: 11 },
|
|
14502
|
+
* jamMarker: { layout: { 'text-field': '' } },
|
|
14503
|
+
* }
|
|
14504
|
+
* ```
|
|
14505
|
+
*
|
|
14506
|
+
* @group Traffic
|
|
14507
|
+
*/
|
|
14508
|
+
export type TrafficIncidentDetailsLayersConfig = {
|
|
14509
|
+
/** The outline beneath a focused, hovered or clicked incident; absent with `focus: false`. */
|
|
14510
|
+
focusHalo?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
14511
|
+
/** Every incident's outline, in its magnitude's colour. */
|
|
14512
|
+
outline?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
14513
|
+
/** The stripe of the incidents with a known delay (`minor`, `moderate`, `major`). */
|
|
14514
|
+
innerSolid?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
14515
|
+
/** The direction chevrons over that stripe, from zoom 12. */
|
|
14516
|
+
innerChevron?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
14517
|
+
/** The patterned stripe of the `unknown` (no delay) and `indefinite` (road closed) incidents. */
|
|
14518
|
+
innerPattern?: Partial<ToBeAddedLayerSpecTemplate<LineLayerSpecification>>;
|
|
14519
|
+
/** The category icon of every incident but jams and closed roads. */
|
|
14520
|
+
incidentMarker?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
14521
|
+
/** The jam icon with its delay text. */
|
|
14522
|
+
jamMarker?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
14523
|
+
/** The closed-road icon. */
|
|
14524
|
+
closedRoadMarker?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
14525
|
+
};
|
|
14106
14526
|
/**
|
|
14107
14527
|
* Configuration for {@link TrafficIncidentDetailsModule}.
|
|
14108
14528
|
*
|
|
@@ -14136,6 +14556,11 @@ export type TrafficIncidentDetailsModuleConfig = MapModuleCommonConfig & {
|
|
|
14136
14556
|
* default treatment.
|
|
14137
14557
|
*/
|
|
14138
14558
|
focus?: false | IncidentFocusStyle;
|
|
14559
|
+
/**
|
|
14560
|
+
* MapLibre overrides for the incident lines and markers. A layer hidden through its entry's
|
|
14561
|
+
* `layout.visibility` stays hidden while the module is shown.
|
|
14562
|
+
*/
|
|
14563
|
+
layers?: TrafficIncidentDetailsLayersConfig;
|
|
14139
14564
|
};
|
|
14140
14565
|
//#endregion
|
|
14141
14566
|
//#region src/traffic/types/trafficIncidentsConfig.d.ts
|
|
@@ -14459,8 +14884,8 @@ export declare const trafficIncidentsKnobIds: readonly TrafficIncidentsKnobId[];
|
|
|
14459
14884
|
*
|
|
14460
14885
|
* @remarks
|
|
14461
14886
|
* The incident lines take the colours of the style's own incident layers, which are
|
|
14462
|
-
* `StylingModule`'s `traffic.incidents.*` knobs. Not knobs: `beforeLayerConfig`, `
|
|
14463
|
-
* which turns the focus treatment off, and `events`.
|
|
14887
|
+
* `StylingModule`'s `traffic.incidents.*` knobs. Not knobs: `beforeLayerConfig`, `layers`, which
|
|
14888
|
+
* takes MapLibre layer overrides, `focus: false`, which turns the focus treatment off, and `events`.
|
|
14464
14889
|
*
|
|
14465
14890
|
* @group Traffic
|
|
14466
14891
|
*/
|
|
@@ -14477,7 +14902,7 @@ export declare const trafficIncidentDetailsKnobIds: readonly TrafficIncidentDeta
|
|
|
14477
14902
|
* Static data, readable with no map loaded.
|
|
14478
14903
|
*
|
|
14479
14904
|
* @remarks
|
|
14480
|
-
* Not knobs: `colorStops`, `beforeLayerConfig` and `events`, which take structured values.
|
|
14905
|
+
* Not knobs: `colorStops`, `beforeLayerConfig`, `layers` and `events`, which take structured values.
|
|
14481
14906
|
* The module bounds no height: a height knob's range is the span a UI offers.
|
|
14482
14907
|
*
|
|
14483
14908
|
* @group Traffic Area Analytics
|
|
@@ -14753,8 +15178,8 @@ export declare class TrafficAreaAnalyticsModule extends AbstractDataOwnedMapModu
|
|
|
14753
15178
|
/** @ignore */
|
|
14754
15179
|
protected applyVisibility(config: TrafficAreaAnalyticsModuleConfig | undefined): void;
|
|
14755
15180
|
private hideAllDataLayers;
|
|
15181
|
+
private setLayersVisible;
|
|
14756
15182
|
private addHighlightLayersToMap;
|
|
14757
|
-
private setHighlightLayerVisible;
|
|
14758
15183
|
private applyLayerConfig;
|
|
14759
15184
|
private applyRegionConfig;
|
|
14760
15185
|
private applyFiltersToLayers;
|
|
@@ -15594,4 +16019,4 @@ export declare const calculatePaddedCenter: (options: CalculateMapCenterOptions)
|
|
|
15594
16019
|
*/
|
|
15595
16020
|
export declare const calculateFittingBBox: (options: CalculateFittingBBoxOptions) => BBox | null;
|
|
15596
16021
|
//#endregion
|
|
15597
|
-
export type { AREA_ANALYTICS_DEFAULTS, AreaAnalyticsBeforeLayerConfig, AreaAnalyticsColorStop, AreaAnalyticsColorStopsConfig, AreaAnalyticsDisplayMode, AreaAnalyticsHeightConfig, AreaAnalyticsMetricConfig, AreaAnalyticsMetricFilter, AreaAnalyticsPalette, 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, EventStateIds, 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, PlacesBeforeLayerConfig, PlacesClusterConfig, PlacesKnob, PlacesKnobId, PlacesKnobValueOf, PlacesMarkerType, PlacesModuleConfig, PlacesModuleSerializableConfig, PlanningWaypoint, PutEventStateOptions, RGBAColor, ReachableRangesKnob, ReachableRangesKnobId, ReachableRangesKnobValueOf, RouteHighlightConfig, 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, TerrainKnob, TerrainKnobId, TerrainKnobValueOf, TerrainModuleConfig, ToBeAddedLayerSpec, ToBeAddedLayerSpecTemplate, ToBeAddedLayerSpecWithoutSource, TrafficAreaAnalyticsKnob, TrafficAreaAnalyticsKnobId, TrafficAreaAnalyticsKnobValueOf, TrafficAreaAnalyticsModuleConfig, TrafficFlowKnob, TrafficFlowKnobId, TrafficFlowKnobValueOf, TrafficIncidentDetailsKnob, TrafficIncidentDetailsKnobId, TrafficIncidentDetailsKnobValueOf, TrafficIncidentsKnob, TrafficIncidentsKnobId, TrafficIncidentsKnobValueOf, UserEventHandler, WaypointsConfig };
|
|
16022
|
+
export type { AREA_ANALYTICS_DEFAULTS, AreaAnalyticsBeforeLayerConfig, AreaAnalyticsColorStop, AreaAnalyticsColorStopsConfig, AreaAnalyticsDisplayMode, AreaAnalyticsHeightConfig, AreaAnalyticsMetricConfig, AreaAnalyticsMetricFilter, AreaAnalyticsPalette, 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, EventStateIds, EventType, ExtraFeatureProp, FeatureLabelConfig, FeaturePropValue, FilterablePOICategory, GeneratedSectionType, GeoJSONSourcesWithLayers, GeometriesKnob, GeometriesKnobId, GeometriesKnobValueOf, HasAdditionalLayersConfig, HasBeforeID, HoverEventType, HslColor, IconMapping, LabelConfig, LayerQuery, LayerSpecFilter, LayerSpecTemplate, LayerSpecWithSource, LightDark, MapColorName, MapColors, MapEventsConfig, MapFont, MapModuleCommonConfig, MapStyleLayerID, POIIconConfig, POIsKnob, POIsKnobId, POIsKnobValueOf, POIsModuleConfig, POIsModuleFeature, PartsBeforeLayerConfig, PinIconConfig, PlaceClusterBadgeConfig, PlaceConnectionDisplay, PlaceConnectionLayerName, PlaceConnectionsConfig, PlaceConnectionsLayersConfig, PlaceEntryPointFeature, PlaceEntryPointProps, PlaceEntryPointsConfig, PlaceEntryPointsLayersConfig, PlaceEntryPointsShowFor, PlaceIconConfig, PlaceLabelConfig, PlaceLayerName, PlaceLayersConfig, PlacesBeforeLayerConfig, PlacesClusterConfig, PlacesKnob, PlacesKnobId, PlacesKnobValueOf, PlacesMarkerType, PlacesModuleConfig, PlacesModuleSerializableConfig, PlanningWaypoint, PutEventStateOptions, RGBAColor, ReachableRangesKnob, ReachableRangesKnobId, ReachableRangesKnobValueOf, RouteHighlightConfig, 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, SerializableFeatureLabelConfig, SerializablePinIconConfig, SourceWithLayerIDs, SourceWithLayers, SourcesWithLayers, StyleLayerGroupName, StyleModuleLayerGroupName, StyleSourcesWithLayers, StylingColorKnobId, StylingKnob, StylingKnobAppliesTo, StylingKnobId, StylingKnobKind, StylingKnobRange, StylingKnobValue, StylingKnobValueOf, StylingPreset, StylingPresetId, StylingSettings, SupportsEvents, SymbolLayerSpecWithoutSource, TerrainKnob, TerrainKnobId, TerrainKnobValueOf, TerrainModuleConfig, ToBeAddedLayerSpec, ToBeAddedLayerSpecTemplate, ToBeAddedLayerSpecWithoutSource, TrafficAreaAnalyticsKnob, TrafficAreaAnalyticsKnobId, TrafficAreaAnalyticsKnobValueOf, TrafficAreaAnalyticsLayersConfig, TrafficAreaAnalyticsModuleConfig, TrafficFlowKnob, TrafficFlowKnobId, TrafficFlowKnobValueOf, TrafficIncidentDetailsKnob, TrafficIncidentDetailsKnobId, TrafficIncidentDetailsKnobValueOf, TrafficIncidentsKnob, TrafficIncidentsKnobId, TrafficIncidentsKnobValueOf, UserEventHandler, WaypointHighlightConfig, WaypointIconConfig, WaypointLabelConfig, WaypointStopNumbering, WaypointsConfig };
|