@tomtom-org/maps-sdk 0.36.5 → 0.37.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 +44 -0
- 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 +29 -29
- package/core/package.json +2 -2
- package/map/dist/index.d.ts +207 -171
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/map/package.json +1 -2
- package/package.json +4 -3
- package/services/dist/THIRD_PARTY.txt +1 -1
- package/services/dist/services.es.js +1 -1
- package/services/dist/services.es.js.map +1 -1
- package/services/package.json +2 -2
package/map/dist/index.d.ts
CHANGED
|
@@ -64,8 +64,9 @@ declare abstract class AbstractEventProxy {
|
|
|
64
64
|
* @param sourceWithLayers The sources and layers to added.
|
|
65
65
|
* @param handlerFn Function that will handle the event.
|
|
66
66
|
* @param type Type of event to listen to.
|
|
67
|
+
* @param config Optional configuration for the event handler.
|
|
67
68
|
*/
|
|
68
|
-
addEventHandler<T = MapGeoJSONFeature>(sourceWithLayers: SourceWithLayers, handlerFn: UserEventHandler<T>, type: EventType): void;
|
|
69
|
+
addEventHandler<T = MapGeoJSONFeature>(sourceWithLayers: SourceWithLayers, handlerFn: UserEventHandler<T>, type: EventType, config: EventHandlerConfig | undefined): void;
|
|
69
70
|
/**
|
|
70
71
|
* Removes the given sources and layers from the interactive list. When not present, nothing happens.
|
|
71
72
|
* @param type The event type to be removed.
|
|
@@ -103,7 +104,7 @@ declare abstract class AbstractEventProxy {
|
|
|
103
104
|
* handling map style changes by restoring the module's state when needed.
|
|
104
105
|
*
|
|
105
106
|
* @typeParam SOURCES_WITH_LAYERS - The type defining the sources and layers used by this module
|
|
106
|
-
* @typeParam CFG - The configuration type for this module, or undefined if no configuration is needed
|
|
107
|
+
* @typeParam CFG - The configuration type for this module, or undefined if no configuration is needed. When defined, must extend MapModuleCommonConfig.
|
|
107
108
|
*
|
|
108
109
|
* @example
|
|
109
110
|
* ```typescript
|
|
@@ -117,7 +118,7 @@ declare abstract class AbstractEventProxy {
|
|
|
117
118
|
*
|
|
118
119
|
* @group Shared
|
|
119
120
|
*/
|
|
120
|
-
export declare abstract class AbstractMapModule<SOURCES_WITH_LAYERS extends SourcesWithLayers, CFG = undefined> {
|
|
121
|
+
export declare abstract class AbstractMapModule<SOURCES_WITH_LAYERS extends SourcesWithLayers, CFG extends MapModuleCommonConfig | undefined = undefined> {
|
|
121
122
|
private readonly sourceType;
|
|
122
123
|
/**
|
|
123
124
|
* @ignore
|
|
@@ -666,6 +667,7 @@ export declare class BaseMapModule extends AbstractMapModule<BaseSourceAndLayers
|
|
|
666
667
|
* @ignore
|
|
667
668
|
*/
|
|
668
669
|
protected _applyConfig(config: BaseMapModuleConfig | undefined): {
|
|
670
|
+
events?: EventHandlerConfig;
|
|
669
671
|
visible?: boolean;
|
|
670
672
|
layerGroupsVisibility?: BaseMapLayerGroupsVisibility;
|
|
671
673
|
} | undefined;
|
|
@@ -825,7 +827,7 @@ export declare class BaseMapModule extends AbstractMapModule<BaseSourceAndLayers
|
|
|
825
827
|
*
|
|
826
828
|
* @group Base Map
|
|
827
829
|
*/
|
|
828
|
-
export declare type BaseMapModuleConfig = {
|
|
830
|
+
export declare type BaseMapModuleConfig = MapModuleCommonConfig & {
|
|
829
831
|
/**
|
|
830
832
|
* Controls the visibility of all layers associated with this module.
|
|
831
833
|
*
|
|
@@ -964,7 +966,7 @@ export declare const buildRoutingLayers: (config?: RoutingModuleConfig, layerIDP
|
|
|
964
966
|
|
|
965
967
|
/**
|
|
966
968
|
* Parameters to identify a feature by its ID or index in a given features array.
|
|
967
|
-
* @group User Events
|
|
969
|
+
* @group User Interaction Events
|
|
968
970
|
*/
|
|
969
971
|
export declare type ByIdOrIndex = {
|
|
970
972
|
/**
|
|
@@ -1118,7 +1120,7 @@ export declare type ChargingStopTextConfig = {
|
|
|
1118
1120
|
* };
|
|
1119
1121
|
* ```
|
|
1120
1122
|
*
|
|
1121
|
-
* @group User Events
|
|
1123
|
+
* @group User Interaction Events
|
|
1122
1124
|
*/
|
|
1123
1125
|
export declare type CleanEventStateOptions = ByIdOrIndex & {
|
|
1124
1126
|
/**
|
|
@@ -1156,7 +1158,7 @@ export declare type CleanEventStateOptions = ByIdOrIndex & {
|
|
|
1156
1158
|
* };
|
|
1157
1159
|
* ```
|
|
1158
1160
|
*
|
|
1159
|
-
* @group User Events
|
|
1161
|
+
* @group User Interaction Events
|
|
1160
1162
|
*/
|
|
1161
1163
|
export declare type CleanEventStatesOptions = {
|
|
1162
1164
|
/**
|
|
@@ -1203,7 +1205,7 @@ export declare type CleanEventStatesOptions = {
|
|
|
1203
1205
|
* const rightClick: ClickEventType = 'contextmenu';
|
|
1204
1206
|
* ```
|
|
1205
1207
|
*
|
|
1206
|
-
* @group User Events
|
|
1208
|
+
* @group User Interaction Events
|
|
1207
1209
|
*/
|
|
1208
1210
|
export declare type ClickEventType = 'click' | 'contextmenu';
|
|
1209
1211
|
|
|
@@ -1226,6 +1228,13 @@ declare const colorPalettes: {
|
|
|
1226
1228
|
pastelRainbow: string[];
|
|
1227
1229
|
};
|
|
1228
1230
|
|
|
1231
|
+
/**
|
|
1232
|
+
* Allowed CSS cursor styles for map interactions.
|
|
1233
|
+
*
|
|
1234
|
+
* @group User Interaction Events
|
|
1235
|
+
*/
|
|
1236
|
+
export declare type CSSCursor = 'alias' | 'all-scroll' | 'auto' | 'cell' | 'context-menu' | 'col-resize' | 'copy' | 'crosshair' | 'default' | 'e-resize' | 'ew-resize' | 'grab' | 'grabbing' | 'help' | 'move' | 'n-resize' | 'ne-resize' | 'nesw-resize' | 'ns-resize' | 'nw-resize' | 'nwse-resize' | 'no-drop' | 'none' | 'not-allowed' | 'pointer' | 'progress' | 'row-resize' | 's-resize' | 'se-resize' | 'sw-resize' | 'text' | 'vertical-text' | 'w-resize' | 'wait' | 'zoom-in' | 'zoom-out';
|
|
1237
|
+
|
|
1229
1238
|
/**
|
|
1230
1239
|
* Basic structure to define custom map icons, which end up in the map sprite.
|
|
1231
1240
|
*
|
|
@@ -1919,6 +1928,47 @@ declare type DisplayTrafficSectionProps = DisplaySectionProps & TrafficSectionPr
|
|
|
1919
1928
|
title?: string;
|
|
1920
1929
|
};
|
|
1921
1930
|
|
|
1931
|
+
/**
|
|
1932
|
+
* Optional events configuration for a map module.
|
|
1933
|
+
*
|
|
1934
|
+
* @group User Interaction Events
|
|
1935
|
+
*/
|
|
1936
|
+
export declare type EventHandlerConfig = EventHandlerCursorConfig;
|
|
1937
|
+
|
|
1938
|
+
/**
|
|
1939
|
+
* Event configuration options related to how the cursor appears during interactions.
|
|
1940
|
+
*
|
|
1941
|
+
* @group User Interaction Events
|
|
1942
|
+
*/
|
|
1943
|
+
export declare type EventHandlerCursorConfig = {
|
|
1944
|
+
/**
|
|
1945
|
+
* Optional configuration to show custom cursor when hovering over interactive features.
|
|
1946
|
+
*
|
|
1947
|
+
* @remarks
|
|
1948
|
+
* Accepts any valid CSS cursor value.
|
|
1949
|
+
*
|
|
1950
|
+
* @default 'pointer'
|
|
1951
|
+
*
|
|
1952
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor | MDN cursor documentation}
|
|
1953
|
+
*
|
|
1954
|
+
* @example
|
|
1955
|
+
* ```typescript
|
|
1956
|
+
* // Default pointer
|
|
1957
|
+
* cursorOnHover: 'pointer'
|
|
1958
|
+
*
|
|
1959
|
+
* // Crosshair for precise selection
|
|
1960
|
+
* cursorOnHover: 'crosshair'
|
|
1961
|
+
*
|
|
1962
|
+
* // Help cursor for info bubbles
|
|
1963
|
+
* cursorOnHover: 'help'
|
|
1964
|
+
*
|
|
1965
|
+
* // Custom cursor image
|
|
1966
|
+
* cursorOnHover: 'url(/cursors/custom.png), pointer'
|
|
1967
|
+
* ```
|
|
1968
|
+
*/
|
|
1969
|
+
cursorOnHover?: CSSCursor;
|
|
1970
|
+
};
|
|
1971
|
+
|
|
1922
1972
|
declare type EventHandlers = Record<string, SourceEventHandlers>;
|
|
1923
1973
|
|
|
1924
1974
|
/**
|
|
@@ -2012,12 +2062,13 @@ declare type EventHandlers = Record<string, SourceEventHandlers>;
|
|
|
2012
2062
|
* });
|
|
2013
2063
|
* ```
|
|
2014
2064
|
*
|
|
2015
|
-
* @group User Events
|
|
2065
|
+
* @group User Interaction Events
|
|
2016
2066
|
*/
|
|
2017
2067
|
export declare class EventsModule<T = MapGeoJSONFeature> {
|
|
2018
2068
|
private readonly eventProxy;
|
|
2019
2069
|
private readonly sourceWithLayers;
|
|
2020
|
-
|
|
2070
|
+
private readonly config;
|
|
2071
|
+
constructor(eventProxy: EventsProxy, sourceWithLayers: SourceWithLayers, config: EventHandlerConfig | undefined);
|
|
2021
2072
|
/**
|
|
2022
2073
|
* Register an event handler for user interactions with map features.
|
|
2023
2074
|
*
|
|
@@ -2183,7 +2234,6 @@ export declare class EventsProxy extends AbstractEventProxy {
|
|
|
2183
2234
|
private lastClickedSourceWithLayers?;
|
|
2184
2235
|
private lastCursorStyle;
|
|
2185
2236
|
private readonly config;
|
|
2186
|
-
private readonly defaultZoomLevel;
|
|
2187
2237
|
constructor(map: Map_2, config?: MapEventsConfig);
|
|
2188
2238
|
private listenToEvents;
|
|
2189
2239
|
enable(enabled: boolean): void;
|
|
@@ -2198,7 +2248,7 @@ export declare class EventsProxy extends AbstractEventProxy {
|
|
|
2198
2248
|
private onMouseDown;
|
|
2199
2249
|
private onMouseUp;
|
|
2200
2250
|
private onMouseMove;
|
|
2201
|
-
private
|
|
2251
|
+
private updateHoverCursor;
|
|
2202
2252
|
private onMapClick;
|
|
2203
2253
|
}
|
|
2204
2254
|
|
|
@@ -2215,7 +2265,7 @@ export declare class EventsProxy extends AbstractEventProxy {
|
|
|
2215
2265
|
* const hoverEvent: EventType = 'long-hover';
|
|
2216
2266
|
* ```
|
|
2217
2267
|
*
|
|
2218
|
-
* @group User Events
|
|
2268
|
+
* @group User Interaction Events
|
|
2219
2269
|
*/
|
|
2220
2270
|
export declare type EventType = ClickEventType | HoverEventType;
|
|
2221
2271
|
|
|
@@ -2376,7 +2426,7 @@ export declare const FINISH_INDEX = "finish";
|
|
|
2376
2426
|
*
|
|
2377
2427
|
* @group Traffic Flow
|
|
2378
2428
|
*/
|
|
2379
|
-
export declare type FlowConfig = {
|
|
2429
|
+
export declare type FlowConfig = MapModuleCommonConfig & {
|
|
2380
2430
|
/**
|
|
2381
2431
|
* Controls the visibility of the traffic flow layers.
|
|
2382
2432
|
*
|
|
@@ -2440,10 +2490,10 @@ export declare class GeoJSONSourceWithLayers<T extends FeatureCollection = Featu
|
|
|
2440
2490
|
* import { GeometriesModule } from '@tomtom-international/maps-sdk-js/map';
|
|
2441
2491
|
*
|
|
2442
2492
|
* // Initialize module
|
|
2443
|
-
* const
|
|
2493
|
+
* const geometriesModule = await GeometriesModule.get(map);
|
|
2444
2494
|
*
|
|
2445
2495
|
* // Display a polygon
|
|
2446
|
-
* await
|
|
2496
|
+
* await geometriesModule.show({
|
|
2447
2497
|
* type: 'Feature',
|
|
2448
2498
|
* geometry: {
|
|
2449
2499
|
* type: 'Polygon',
|
|
@@ -2458,7 +2508,7 @@ export declare class GeoJSONSourceWithLayers<T extends FeatureCollection = Featu
|
|
|
2458
2508
|
* @example
|
|
2459
2509
|
* Custom styling:
|
|
2460
2510
|
* ```typescript
|
|
2461
|
-
* const
|
|
2511
|
+
* const geometriesModule = await GeometriesModule.get(map, {
|
|
2462
2512
|
* colorConfig: {
|
|
2463
2513
|
* fillColor: '#FF5733',
|
|
2464
2514
|
* fillOpacity: 0.3
|
|
@@ -2472,13 +2522,13 @@ export declare class GeoJSONSourceWithLayers<T extends FeatureCollection = Featu
|
|
|
2472
2522
|
* }
|
|
2473
2523
|
* });
|
|
2474
2524
|
*
|
|
2475
|
-
* await
|
|
2525
|
+
* await geometriesModule.show(polygonFeatures);
|
|
2476
2526
|
* ```
|
|
2477
2527
|
*
|
|
2478
2528
|
* @example
|
|
2479
2529
|
* Multiple geometries with different colors:
|
|
2480
2530
|
* ```typescript
|
|
2481
|
-
* await
|
|
2531
|
+
* await geometriesModule.show({
|
|
2482
2532
|
* type: 'FeatureCollection',
|
|
2483
2533
|
* features: [
|
|
2484
2534
|
* {
|
|
@@ -2498,12 +2548,12 @@ export declare class GeoJSONSourceWithLayers<T extends FeatureCollection = Featu
|
|
|
2498
2548
|
* @example
|
|
2499
2549
|
* Event handling:
|
|
2500
2550
|
* ```typescript
|
|
2501
|
-
*
|
|
2551
|
+
* geometriesModule.events.on('click', (feature, lngLat) => {
|
|
2502
2552
|
* console.log('Clicked geometry:', feature.properties.title);
|
|
2503
2553
|
* console.log('At coordinates:', lngLat);
|
|
2504
2554
|
* });
|
|
2505
2555
|
*
|
|
2506
|
-
*
|
|
2556
|
+
* geometriesModule.events.on('hover', (feature) => {
|
|
2507
2557
|
* showTooltip(feature.properties.title);
|
|
2508
2558
|
* });
|
|
2509
2559
|
* ```
|
|
@@ -2542,13 +2592,13 @@ export declare class GeometriesModule extends AbstractMapModule<GeometrySourcesW
|
|
|
2542
2592
|
* @example
|
|
2543
2593
|
* Default initialization:
|
|
2544
2594
|
* ```typescript
|
|
2545
|
-
* const
|
|
2595
|
+
* const geometriesModule = await GeometriesModule.get(map);
|
|
2546
2596
|
* ```
|
|
2547
2597
|
*
|
|
2548
2598
|
* @example
|
|
2549
2599
|
* With custom styling:
|
|
2550
2600
|
* ```typescript
|
|
2551
|
-
* const
|
|
2601
|
+
* const geometriesModule = await GeometriesModule.get(map, {
|
|
2552
2602
|
* colorConfig: {
|
|
2553
2603
|
* fillColor: 'blue',
|
|
2554
2604
|
* fillOpacity: 0.25
|
|
@@ -2568,7 +2618,7 @@ export declare class GeometriesModule extends AbstractMapModule<GeometrySourcesW
|
|
|
2568
2618
|
* @example
|
|
2569
2619
|
* Data-driven styling:
|
|
2570
2620
|
* ```typescript
|
|
2571
|
-
* const
|
|
2621
|
+
* const geometriesModule = await GeometriesModule.get(map, {
|
|
2572
2622
|
* colorConfig: {
|
|
2573
2623
|
* // Color based on feature properties
|
|
2574
2624
|
* fillColor: [
|
|
@@ -2838,7 +2888,7 @@ export declare class GeometriesModule extends AbstractMapModule<GeometrySourcesW
|
|
|
2838
2888
|
*
|
|
2839
2889
|
* @group Geometries
|
|
2840
2890
|
*/
|
|
2841
|
-
export declare type GeometriesModuleConfig = {
|
|
2891
|
+
export declare type GeometriesModuleConfig = MapModuleCommonConfig & {
|
|
2842
2892
|
/**
|
|
2843
2893
|
* Fill color and opacity configuration.
|
|
2844
2894
|
*
|
|
@@ -3232,13 +3282,13 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
3232
3282
|
* @example
|
|
3233
3283
|
* Default initialization:
|
|
3234
3284
|
* ```typescript
|
|
3235
|
-
* const
|
|
3285
|
+
* const hillshadeModule = await HillshadeModule.get(map);
|
|
3236
3286
|
* ```
|
|
3237
3287
|
*
|
|
3238
3288
|
* @example
|
|
3239
3289
|
* Auto-add to style if missing:
|
|
3240
3290
|
* ```typescript
|
|
3241
|
-
* const
|
|
3291
|
+
* const hillshadeModule = await HillshadeModule.get(map, {
|
|
3242
3292
|
* visible: true
|
|
3243
3293
|
* });
|
|
3244
3294
|
* ```
|
|
@@ -3246,7 +3296,7 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
3246
3296
|
* @example
|
|
3247
3297
|
* Start hidden:
|
|
3248
3298
|
* ```typescript
|
|
3249
|
-
* const
|
|
3299
|
+
* const hillshadeModule = await HillshadeModule.get(map, {
|
|
3250
3300
|
* visible: false
|
|
3251
3301
|
* });
|
|
3252
3302
|
* ```
|
|
@@ -3345,7 +3395,7 @@ export declare class HillshadeModule extends AbstractMapModule<HillshadeSourcesW
|
|
|
3345
3395
|
*
|
|
3346
3396
|
* @group Hillshade
|
|
3347
3397
|
*/
|
|
3348
|
-
export declare type HillshadeModuleConfig = {
|
|
3398
|
+
export declare type HillshadeModuleConfig = MapModuleCommonConfig & {
|
|
3349
3399
|
/**
|
|
3350
3400
|
* Controls the visibility of the hillshade layers.
|
|
3351
3401
|
*
|
|
@@ -3377,7 +3427,7 @@ declare type HillshadeSourcesWithLayers = {
|
|
|
3377
3427
|
* const sustainedHover: HoverEventType = 'long-hover';
|
|
3378
3428
|
* ```
|
|
3379
3429
|
*
|
|
3380
|
-
* @group User Events
|
|
3430
|
+
* @group User Interaction Events
|
|
3381
3431
|
*/
|
|
3382
3432
|
export declare type HoverEventType = 'hover' | 'long-hover';
|
|
3383
3433
|
|
|
@@ -3456,7 +3506,7 @@ export declare type IncidentsCommonConfig = {
|
|
|
3456
3506
|
*
|
|
3457
3507
|
* @group Traffic Incidents
|
|
3458
3508
|
*/
|
|
3459
|
-
export declare type IncidentsConfig = IncidentsCommonConfig & {
|
|
3509
|
+
export declare type IncidentsConfig = MapModuleCommonConfig & IncidentsCommonConfig & {
|
|
3460
3510
|
/**
|
|
3461
3511
|
* Configuration specific to incident icon display.
|
|
3462
3512
|
*
|
|
@@ -3543,9 +3593,57 @@ export declare const mapDisplayPoiCategoryMappings: Partial<Record<POICategory,
|
|
|
3543
3593
|
* };
|
|
3544
3594
|
* ```
|
|
3545
3595
|
*
|
|
3546
|
-
* @group
|
|
3596
|
+
* @group User Interaction Events
|
|
3547
3597
|
*/
|
|
3548
|
-
export declare type MapEventsConfig = {
|
|
3598
|
+
export declare type MapEventsConfig = EventHandlerCursorConfig & {
|
|
3599
|
+
/**
|
|
3600
|
+
* Optional configuration to show custom cursor when clicking (mouse down).
|
|
3601
|
+
*
|
|
3602
|
+
* @remarks
|
|
3603
|
+
* Accepts any valid CSS cursor value. Provides visual feedback during the
|
|
3604
|
+
* click action.
|
|
3605
|
+
*
|
|
3606
|
+
* @default 'grabbing'
|
|
3607
|
+
*
|
|
3608
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor | MDN cursor documentation}
|
|
3609
|
+
*
|
|
3610
|
+
* @example
|
|
3611
|
+
* ```typescript
|
|
3612
|
+
* // Grabbing hand
|
|
3613
|
+
* cursorOnMouseDown: 'grabbing'
|
|
3614
|
+
*
|
|
3615
|
+
* // Move cursor
|
|
3616
|
+
* cursorOnMouseDown: 'move'
|
|
3617
|
+
*
|
|
3618
|
+
* // Custom cursor
|
|
3619
|
+
* cursorOnMouseDown: 'url(/cursors/drag.png), grabbing'
|
|
3620
|
+
* ```
|
|
3621
|
+
*/
|
|
3622
|
+
cursorOnMouseDown?: CSSCursor;
|
|
3623
|
+
/**
|
|
3624
|
+
* Optional configuration to show custom cursor on the map canvas when not interacting with any handled features.
|
|
3625
|
+
*
|
|
3626
|
+
* @remarks
|
|
3627
|
+
* Accepts any valid CSS cursor value. This is the default cursor shown
|
|
3628
|
+
* when not interacting with any features.
|
|
3629
|
+
*
|
|
3630
|
+
* @default 'default'
|
|
3631
|
+
*
|
|
3632
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor | MDN cursor documentation}
|
|
3633
|
+
*
|
|
3634
|
+
* @example
|
|
3635
|
+
* ```typescript
|
|
3636
|
+
* // Standard arrow
|
|
3637
|
+
* cursorOnMap: 'default'
|
|
3638
|
+
*
|
|
3639
|
+
* // Open hand for draggable map
|
|
3640
|
+
* cursorOnMap: 'grab'
|
|
3641
|
+
*
|
|
3642
|
+
* // Crosshair for measurement tools
|
|
3643
|
+
* cursorOnMap: 'crosshair'
|
|
3644
|
+
* ```
|
|
3645
|
+
*/
|
|
3646
|
+
cursorOnMap?: CSSCursor;
|
|
3549
3647
|
/**
|
|
3550
3648
|
* Defines the event coordinates precision mode.
|
|
3551
3649
|
*
|
|
@@ -3601,80 +3699,6 @@ export declare type MapEventsConfig = {
|
|
|
3601
3699
|
* ```
|
|
3602
3700
|
*/
|
|
3603
3701
|
paddingBoxPx?: number;
|
|
3604
|
-
/**
|
|
3605
|
-
* Optional configuration to show custom cursor when hovering over interactive features.
|
|
3606
|
-
*
|
|
3607
|
-
* @remarks
|
|
3608
|
-
* Accepts any valid CSS cursor value.
|
|
3609
|
-
*
|
|
3610
|
-
* @default 'pointer'
|
|
3611
|
-
*
|
|
3612
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor | MDN cursor documentation}
|
|
3613
|
-
*
|
|
3614
|
-
* @example
|
|
3615
|
-
* ```typescript
|
|
3616
|
-
* // Default pointer
|
|
3617
|
-
* cursorOnHover: 'pointer'
|
|
3618
|
-
*
|
|
3619
|
-
* // Crosshair for precise selection
|
|
3620
|
-
* cursorOnHover: 'crosshair'
|
|
3621
|
-
*
|
|
3622
|
-
* // Help cursor for info bubbles
|
|
3623
|
-
* cursorOnHover: 'help'
|
|
3624
|
-
*
|
|
3625
|
-
* // Custom cursor image
|
|
3626
|
-
* cursorOnHover: 'url(/cursors/custom.png), pointer'
|
|
3627
|
-
* ```
|
|
3628
|
-
*/
|
|
3629
|
-
cursorOnHover?: string;
|
|
3630
|
-
/**
|
|
3631
|
-
* Optional configuration to show custom cursor when clicking (mouse down).
|
|
3632
|
-
*
|
|
3633
|
-
* @remarks
|
|
3634
|
-
* Accepts any valid CSS cursor value. Provides visual feedback during the
|
|
3635
|
-
* click action.
|
|
3636
|
-
*
|
|
3637
|
-
* @default 'grabbing'
|
|
3638
|
-
*
|
|
3639
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor | MDN cursor documentation}
|
|
3640
|
-
*
|
|
3641
|
-
* @example
|
|
3642
|
-
* ```typescript
|
|
3643
|
-
* // Grabbing hand
|
|
3644
|
-
* cursorOnMouseDown: 'grabbing'
|
|
3645
|
-
*
|
|
3646
|
-
* // Move cursor
|
|
3647
|
-
* cursorOnMouseDown: 'move'
|
|
3648
|
-
*
|
|
3649
|
-
* // Custom cursor
|
|
3650
|
-
* cursorOnMouseDown: 'url(/cursors/drag.png), grabbing'
|
|
3651
|
-
* ```
|
|
3652
|
-
*/
|
|
3653
|
-
cursorOnMouseDown?: string;
|
|
3654
|
-
/**
|
|
3655
|
-
* Optional configuration to show custom cursor on the map canvas.
|
|
3656
|
-
*
|
|
3657
|
-
* @remarks
|
|
3658
|
-
* Accepts any valid CSS cursor value. This is the default cursor shown
|
|
3659
|
-
* when not interacting with any features.
|
|
3660
|
-
*
|
|
3661
|
-
* @default 'default'
|
|
3662
|
-
*
|
|
3663
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/cursor | MDN cursor documentation}
|
|
3664
|
-
*
|
|
3665
|
-
* @example
|
|
3666
|
-
* ```typescript
|
|
3667
|
-
* // Standard arrow
|
|
3668
|
-
* cursorOnMap: 'default'
|
|
3669
|
-
*
|
|
3670
|
-
* // Open hand for draggable map
|
|
3671
|
-
* cursorOnMap: 'grab'
|
|
3672
|
-
*
|
|
3673
|
-
* // Crosshair for measurement tools
|
|
3674
|
-
* cursorOnMap: 'crosshair'
|
|
3675
|
-
* ```
|
|
3676
|
-
*/
|
|
3677
|
-
cursorOnMap?: string;
|
|
3678
3702
|
/**
|
|
3679
3703
|
* Delay to trigger a long-hover event when map has just moved (milliseconds).
|
|
3680
3704
|
*
|
|
@@ -3803,9 +3827,20 @@ declare const mapFonts: readonly ["Noto-Regular", "NotoSans-MediumItalic", "Noto
|
|
|
3803
3827
|
*/
|
|
3804
3828
|
export declare type MapLibreOptions = Omit<MapOptions, 'style' | 'attributionControl'>;
|
|
3805
3829
|
|
|
3830
|
+
/**
|
|
3831
|
+
* Contains configuration options common to all map modules.
|
|
3832
|
+
*
|
|
3833
|
+
* @group Shared
|
|
3834
|
+
*/
|
|
3835
|
+
export declare type MapModuleCommonConfig = {
|
|
3836
|
+
/**
|
|
3837
|
+
* Optional configuration for user event handling that applies to this map module only.
|
|
3838
|
+
*/
|
|
3839
|
+
events?: EventHandlerConfig;
|
|
3840
|
+
};
|
|
3841
|
+
|
|
3806
3842
|
/**
|
|
3807
3843
|
* Whether a map module is based on a map style or on added GeoJSON data.
|
|
3808
|
-
* @ignore
|
|
3809
3844
|
*/
|
|
3810
3845
|
declare type MapModuleSource = 'style' | 'geojson';
|
|
3811
3846
|
|
|
@@ -3866,22 +3901,22 @@ export declare type MapStyleLayerID = keyof typeof mapStyleLayerIDs;
|
|
|
3866
3901
|
* **RoutingModule** - Positions route visualizations below labels for readability:
|
|
3867
3902
|
* ```typescript
|
|
3868
3903
|
* // Routes appear below labels but above the base map
|
|
3869
|
-
* const
|
|
3904
|
+
* const routingModule = await RoutingModule.get(map);
|
|
3870
3905
|
* // Uses mapStyleLayerIDs.lowestLabel by default
|
|
3871
3906
|
* ```
|
|
3872
3907
|
*
|
|
3873
3908
|
* **GeometriesModule** - Configurable layer positioning for polygon areas:
|
|
3874
3909
|
* ```typescript
|
|
3875
3910
|
* // Default: below labels
|
|
3876
|
-
* const
|
|
3911
|
+
* const geometriesModule = await GeometriesModule.get(map);
|
|
3877
3912
|
*
|
|
3878
3913
|
* // Custom: below buildings to show at ground level
|
|
3879
|
-
* const
|
|
3914
|
+
* const geometriesModule = await GeometriesModule.get(map, {
|
|
3880
3915
|
* beforeLayerConfig: 'lowestBuilding'
|
|
3881
3916
|
* });
|
|
3882
3917
|
*
|
|
3883
3918
|
* // On top of everything
|
|
3884
|
-
* const
|
|
3919
|
+
* const geometriesModule = await GeometriesModule.get(map, {
|
|
3885
3920
|
* beforeLayerConfig: 'top'
|
|
3886
3921
|
* });
|
|
3887
3922
|
* ```
|
|
@@ -4306,7 +4341,7 @@ export declare type PlaceLayersConfig = {
|
|
|
4306
4341
|
* @example
|
|
4307
4342
|
* ```typescript
|
|
4308
4343
|
* // Create places module with pin markers
|
|
4309
|
-
* const
|
|
4344
|
+
* const placesModule = await PlacesModule.get(map, {
|
|
4310
4345
|
* icon: {
|
|
4311
4346
|
* categoryIcons: []
|
|
4312
4347
|
* },
|
|
@@ -4317,14 +4352,14 @@ export declare type PlaceLayersConfig = {
|
|
|
4317
4352
|
* });
|
|
4318
4353
|
*
|
|
4319
4354
|
* // Display places from search
|
|
4320
|
-
* await
|
|
4355
|
+
* await placesModule.show(searchResults);
|
|
4321
4356
|
*
|
|
4322
4357
|
* // Handle clicks
|
|
4323
|
-
*
|
|
4358
|
+
* placesModule.events.on('click', (feature) => {
|
|
4324
4359
|
* console.log('Clicked:', feature.properties);
|
|
4325
4360
|
* });
|
|
4326
4361
|
*
|
|
4327
|
-
*
|
|
4362
|
+
* placesModule.events.on('hover', (feature) => {
|
|
4328
4363
|
* showTooltip(feature.properties.poi?.name);
|
|
4329
4364
|
* });
|
|
4330
4365
|
* ```
|
|
@@ -4383,13 +4418,13 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4383
4418
|
* @example
|
|
4384
4419
|
* ```typescript
|
|
4385
4420
|
* // Switch to pin markers
|
|
4386
|
-
*
|
|
4421
|
+
* placesModule.applyTheme('pin');
|
|
4387
4422
|
*
|
|
4388
4423
|
* // Use simple circles
|
|
4389
|
-
*
|
|
4424
|
+
* placesModule.applyTheme('circle');
|
|
4390
4425
|
*
|
|
4391
4426
|
* // Match map's POI style (ideal to blend in)
|
|
4392
|
-
*
|
|
4427
|
+
* placesModule.applyTheme('base-map');
|
|
4393
4428
|
* ```
|
|
4394
4429
|
*/
|
|
4395
4430
|
applyTheme(theme: PlacesTheme): void;
|
|
@@ -4405,7 +4440,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4405
4440
|
*
|
|
4406
4441
|
* @example
|
|
4407
4442
|
* ```typescript
|
|
4408
|
-
*
|
|
4443
|
+
* placesModule.applyIconConfig({
|
|
4409
4444
|
* categoryIcons: [
|
|
4410
4445
|
* { category: 'RESTAURANT', id: 'restaurant-icon', image: '/icons/food.png' }
|
|
4411
4446
|
* ]
|
|
@@ -4424,12 +4459,12 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4424
4459
|
* @example
|
|
4425
4460
|
* ```typescript
|
|
4426
4461
|
* // Use function
|
|
4427
|
-
*
|
|
4462
|
+
* placesModule.applyTextConfig({
|
|
4428
4463
|
* field: (place) => place.properties.poi?.name || 'Unknown'
|
|
4429
4464
|
* });
|
|
4430
4465
|
*
|
|
4431
4466
|
* // Use MapLibre expression
|
|
4432
|
-
*
|
|
4467
|
+
* placesModule.applyTextConfig({
|
|
4433
4468
|
* field: ['get', 'title'],
|
|
4434
4469
|
* size: 14,
|
|
4435
4470
|
* color: '#333'
|
|
@@ -4448,7 +4483,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4448
4483
|
*
|
|
4449
4484
|
* @example
|
|
4450
4485
|
* ```typescript
|
|
4451
|
-
*
|
|
4486
|
+
* placesModule.applyExtraFeatureProps({
|
|
4452
4487
|
* category: (place) => place.properties.poi?.categories?.[0],
|
|
4453
4488
|
* rating: (place) => place.properties.poi?.rating || 0,
|
|
4454
4489
|
* isOpen: true
|
|
@@ -4484,14 +4519,14 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4484
4519
|
* ```typescript
|
|
4485
4520
|
* import { search } from '@tomtom-international/maps-sdk-js/services';
|
|
4486
4521
|
*
|
|
4487
|
-
* const results = await search
|
|
4488
|
-
* await
|
|
4522
|
+
* const results = await search({ query: 'coffee' });
|
|
4523
|
+
* await placesModule.show(results);
|
|
4489
4524
|
* ```
|
|
4490
4525
|
*
|
|
4491
4526
|
* @example
|
|
4492
4527
|
* Display single place:
|
|
4493
4528
|
* ```typescript
|
|
4494
|
-
* await
|
|
4529
|
+
* await placesModule.show({
|
|
4495
4530
|
* type: 'Feature',
|
|
4496
4531
|
* geometry: { type: 'Point', coordinates: [4.9041, 52.3676] },
|
|
4497
4532
|
* properties: {
|
|
@@ -4504,7 +4539,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4504
4539
|
* @example
|
|
4505
4540
|
* Display multiple places:
|
|
4506
4541
|
* ```typescript
|
|
4507
|
-
* await
|
|
4542
|
+
* await placesModule.show([place1, place2, place3]);
|
|
4508
4543
|
* ```
|
|
4509
4544
|
*/
|
|
4510
4545
|
show(places: Place_2 | Place_2[] | Places): Promise<void>;
|
|
@@ -4518,7 +4553,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4518
4553
|
*
|
|
4519
4554
|
* @example
|
|
4520
4555
|
* ```typescript
|
|
4521
|
-
* await
|
|
4556
|
+
* await placesModule.clear();
|
|
4522
4557
|
* ```
|
|
4523
4558
|
*/
|
|
4524
4559
|
clear(): Promise<void>;
|
|
@@ -4533,7 +4568,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4533
4568
|
* @example
|
|
4534
4569
|
* ```typescript
|
|
4535
4570
|
* // Make first place appear clicked
|
|
4536
|
-
*
|
|
4571
|
+
* placesModule.putEventState({
|
|
4537
4572
|
* index: 0,
|
|
4538
4573
|
* state: 'click',
|
|
4539
4574
|
* mode: 'put'
|
|
@@ -4548,7 +4583,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4548
4583
|
*
|
|
4549
4584
|
* @example
|
|
4550
4585
|
* ```typescript
|
|
4551
|
-
*
|
|
4586
|
+
* placesModule.cleanEventState({ index: 0 });
|
|
4552
4587
|
* ```
|
|
4553
4588
|
*/
|
|
4554
4589
|
cleanEventState(options: CleanEventStateOptions): void;
|
|
@@ -4560,10 +4595,10 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4560
4595
|
* @example
|
|
4561
4596
|
* ```typescript
|
|
4562
4597
|
* // Remove all event states
|
|
4563
|
-
*
|
|
4598
|
+
* placesModule.cleanEventStates();
|
|
4564
4599
|
*
|
|
4565
4600
|
* // Remove only hover states
|
|
4566
|
-
*
|
|
4601
|
+
* placesModule.cleanEventStates({ states: ['hover'] });
|
|
4567
4602
|
* ```
|
|
4568
4603
|
*/
|
|
4569
4604
|
cleanEventStates(options?: CleanEventStatesOptions): void;
|
|
@@ -4616,7 +4651,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
4616
4651
|
*
|
|
4617
4652
|
* @group Places
|
|
4618
4653
|
*/
|
|
4619
|
-
export declare type PlacesModuleConfig = {
|
|
4654
|
+
export declare type PlacesModuleConfig = MapModuleCommonConfig & {
|
|
4620
4655
|
/**
|
|
4621
4656
|
* Base style for all places.
|
|
4622
4657
|
*
|
|
@@ -5031,24 +5066,24 @@ export declare const poiLayerIDs: string[];
|
|
|
5031
5066
|
* import { POIsModule } from '@tomtom-international/maps-sdk-js/map';
|
|
5032
5067
|
*
|
|
5033
5068
|
* // Get module
|
|
5034
|
-
* const
|
|
5069
|
+
* const poisModule = await POIsModule.get(map);
|
|
5035
5070
|
*
|
|
5036
5071
|
* // Toggle visibility
|
|
5037
|
-
*
|
|
5038
|
-
*
|
|
5072
|
+
* poisModule.setVisible(false);
|
|
5073
|
+
* poisModule.setVisible(true);
|
|
5039
5074
|
* ```
|
|
5040
5075
|
*
|
|
5041
5076
|
* @example
|
|
5042
5077
|
* Filter specific categories:
|
|
5043
5078
|
* ```typescript
|
|
5044
5079
|
* // Show only restaurants and hotels
|
|
5045
|
-
*
|
|
5080
|
+
* poisModule.filterCategories({
|
|
5046
5081
|
* show: 'only',
|
|
5047
5082
|
* values: ['RESTAURANT', 'HOTEL_MOTEL']
|
|
5048
5083
|
* });
|
|
5049
5084
|
*
|
|
5050
5085
|
* // Hide parking garages
|
|
5051
|
-
*
|
|
5086
|
+
* poisModule.filterCategories({
|
|
5052
5087
|
* show: 'all_except',
|
|
5053
5088
|
* values: ['PARKING_GARAGE', 'OPEN_PARKING_AREA']
|
|
5054
5089
|
* });
|
|
@@ -5058,7 +5093,7 @@ export declare const poiLayerIDs: string[];
|
|
|
5058
5093
|
* Filter using category groups:
|
|
5059
5094
|
* ```typescript
|
|
5060
5095
|
* // Show only food and shopping POIs
|
|
5061
|
-
*
|
|
5096
|
+
* poisModule.filterCategories({
|
|
5062
5097
|
* show: 'only',
|
|
5063
5098
|
* values: ['FOOD_DRINKS_GROUP', 'SHOPPING_GROUP']
|
|
5064
5099
|
* });
|
|
@@ -5104,13 +5139,13 @@ export declare class POIsModule extends AbstractMapModule<PoIsSourcesAndLayers,
|
|
|
5104
5139
|
* @example
|
|
5105
5140
|
* Default initialization:
|
|
5106
5141
|
* ```typescript
|
|
5107
|
-
* const
|
|
5142
|
+
* const poisModule = await POIsModule.get(map);
|
|
5108
5143
|
* ```
|
|
5109
5144
|
*
|
|
5110
5145
|
* @example
|
|
5111
5146
|
* With initial filter:
|
|
5112
5147
|
* ```typescript
|
|
5113
|
-
* const
|
|
5148
|
+
* const poisModule = await POIsModule.get(map, {
|
|
5114
5149
|
* visible: true,
|
|
5115
5150
|
* filters: {
|
|
5116
5151
|
* categories: {
|
|
@@ -5298,7 +5333,7 @@ export declare class POIsModule extends AbstractMapModule<PoIsSourcesAndLayers,
|
|
|
5298
5333
|
*
|
|
5299
5334
|
* @group POIs
|
|
5300
5335
|
*/
|
|
5301
|
-
export declare type POIsModuleConfig = {
|
|
5336
|
+
export declare type POIsModuleConfig = MapModuleCommonConfig & {
|
|
5302
5337
|
/**
|
|
5303
5338
|
* Controls the visibility of the POI layers.
|
|
5304
5339
|
*
|
|
@@ -5479,7 +5514,7 @@ export declare const preparePlacesForDisplay: (placesInput: Place | Place[] | Pl
|
|
|
5479
5514
|
* };
|
|
5480
5515
|
* ```
|
|
5481
5516
|
*
|
|
5482
|
-
* @group User Events
|
|
5517
|
+
* @group User Interaction Events
|
|
5483
5518
|
*/
|
|
5484
5519
|
export declare type PutEventStateOptions = ByIdOrIndex & {
|
|
5485
5520
|
/**
|
|
@@ -6034,7 +6069,7 @@ export declare type RouteTheme = {
|
|
|
6034
6069
|
* @example
|
|
6035
6070
|
* ```typescript
|
|
6036
6071
|
* // Create the module
|
|
6037
|
-
* const
|
|
6072
|
+
* const routingModule = await RoutingModule.getInstance(map, {
|
|
6038
6073
|
* displayUnits: {
|
|
6039
6074
|
* distance: { type: 'metric' }
|
|
6040
6075
|
* }
|
|
@@ -6053,7 +6088,7 @@ export declare type RouteTheme = {
|
|
|
6053
6088
|
* }
|
|
6054
6089
|
* });
|
|
6055
6090
|
*
|
|
6056
|
-
* await
|
|
6091
|
+
* await routingModule.showRoutes(result);
|
|
6057
6092
|
* ```
|
|
6058
6093
|
*
|
|
6059
6094
|
* @see [Routing Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/routing)
|
|
@@ -6088,13 +6123,13 @@ export declare class RoutingModule extends AbstractMapModule<RoutingSourcesWithL
|
|
|
6088
6123
|
* @example
|
|
6089
6124
|
* Default initialization:
|
|
6090
6125
|
* ```typescript
|
|
6091
|
-
* const
|
|
6126
|
+
* const routingModule = await RoutingModule.get(map);
|
|
6092
6127
|
* ```
|
|
6093
6128
|
*
|
|
6094
6129
|
* @example
|
|
6095
6130
|
* With custom configuration:
|
|
6096
6131
|
* ```typescript
|
|
6097
|
-
* const
|
|
6132
|
+
* const routingModule = await RoutingModule.get(map, {
|
|
6098
6133
|
* displayUnits: 'imperial',
|
|
6099
6134
|
* waypointsSource: {
|
|
6100
6135
|
* entryPoints: 'main-when-available'
|
|
@@ -6116,7 +6151,7 @@ export declare class RoutingModule extends AbstractMapModule<RoutingSourcesWithL
|
|
|
6116
6151
|
/**
|
|
6117
6152
|
* @ignore
|
|
6118
6153
|
*/
|
|
6119
|
-
protected restoreDataAndConfigImpl():
|
|
6154
|
+
protected restoreDataAndConfigImpl(): void;
|
|
6120
6155
|
private addImageIfNotExisting;
|
|
6121
6156
|
/**
|
|
6122
6157
|
* Displays the given routes on the map.
|
|
@@ -6203,13 +6238,13 @@ export declare class RoutingModule extends AbstractMapModule<RoutingSourcesWithL
|
|
|
6203
6238
|
* @example
|
|
6204
6239
|
* ```typescript
|
|
6205
6240
|
* // Show multiple routes
|
|
6206
|
-
* await
|
|
6241
|
+
* await routingModule.showRoutes(routes);
|
|
6207
6242
|
*
|
|
6208
6243
|
* // User clicks alternative route
|
|
6209
|
-
* await
|
|
6244
|
+
* await routingModule.selectRoute(1);
|
|
6210
6245
|
*
|
|
6211
6246
|
* // Switch back to first route
|
|
6212
|
-
* await
|
|
6247
|
+
* await routingModule.selectRoute(0);
|
|
6213
6248
|
* ```
|
|
6214
6249
|
*/
|
|
6215
6250
|
selectRoute(index: number): Promise<void>;
|
|
@@ -6256,7 +6291,7 @@ export declare class RoutingModule extends AbstractMapModule<RoutingSourcesWithL
|
|
|
6256
6291
|
*
|
|
6257
6292
|
* @group Routing
|
|
6258
6293
|
*/
|
|
6259
|
-
export declare type RoutingModuleConfig = {
|
|
6294
|
+
export declare type RoutingModuleConfig = MapModuleCommonConfig & {
|
|
6260
6295
|
/**
|
|
6261
6296
|
* Units for displaying distances in route summaries and instructions.
|
|
6262
6297
|
*
|
|
@@ -6393,6 +6428,7 @@ declare type SourceEventTypeHandler = {
|
|
|
6393
6428
|
sourceWithLayers: SourceWithLayers;
|
|
6394
6429
|
layerIDs: string[];
|
|
6395
6430
|
fn: UserEventHandler<any>;
|
|
6431
|
+
config?: EventHandlerConfig;
|
|
6396
6432
|
};
|
|
6397
6433
|
|
|
6398
6434
|
/**
|
|
@@ -6807,7 +6843,7 @@ export declare class StyleSourceWithLayers<SOURCE_SPEC extends SourceSpecificati
|
|
|
6807
6843
|
* const normalProps: SupportsEvents = {};
|
|
6808
6844
|
* ```
|
|
6809
6845
|
*
|
|
6810
|
-
* @group User Events
|
|
6846
|
+
* @group User Interaction Events
|
|
6811
6847
|
*/
|
|
6812
6848
|
export declare type SupportsEvents = {
|
|
6813
6849
|
/**
|
|
@@ -6967,7 +7003,7 @@ export declare type ToBeAddedLayerSpecWithoutSource<L extends LayerSpecification
|
|
|
6967
7003
|
* include: ['trafficFlow', 'trafficIncidents']
|
|
6968
7004
|
* },
|
|
6969
7005
|
* language: 'en-US',
|
|
6970
|
-
*
|
|
7006
|
+
* events: {
|
|
6971
7007
|
* precisionMode: 'point-then-box',
|
|
6972
7008
|
* cursorOnHover: 'pointer'
|
|
6973
7009
|
* }
|
|
@@ -6995,7 +7031,7 @@ export declare class TomTomMap {
|
|
|
6995
7031
|
* ```typescript
|
|
6996
7032
|
* if (map.mapReady) {
|
|
6997
7033
|
* // Safe to initialize modules
|
|
6998
|
-
* const
|
|
7034
|
+
* const trafficFlowModule = await TrafficFlowModule.get(map);
|
|
6999
7035
|
* }
|
|
7000
7036
|
* ```
|
|
7001
7037
|
*/
|
|
@@ -7103,7 +7139,7 @@ export declare class TomTomMap {
|
|
|
7103
7139
|
* include: ['trafficFlow', 'hillshade']
|
|
7104
7140
|
* },
|
|
7105
7141
|
* language: 'en-US',
|
|
7106
|
-
*
|
|
7142
|
+
* events: {
|
|
7107
7143
|
* precisionMode: 'point-then-box',
|
|
7108
7144
|
* paddingBoxPx: 10
|
|
7109
7145
|
* }
|
|
@@ -7118,7 +7154,7 @@ export declare class TomTomMap {
|
|
|
7118
7154
|
* @see {@link https://maplibre.org/maplibre-gl-js-docs/api/map/ | MapLibre Map Parameters}
|
|
7119
7155
|
* @see [Map Quickstart Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/quickstart)
|
|
7120
7156
|
* @see [Map Styles Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/map-styles)
|
|
7121
|
-
* @see [User Events Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/user-events)
|
|
7157
|
+
* @see [User Interaction Events Guide](https://docs.tomtom.com/maps-sdk-js/guides/map/user-events)
|
|
7122
7158
|
*/
|
|
7123
7159
|
constructor(mapLibreOptions: MapLibreOptions, mapParams?: Partial<TomTomMapParams>);
|
|
7124
7160
|
private loadRTLTextPlugin;
|
|
@@ -7468,7 +7504,7 @@ export declare class TomTomMap {
|
|
|
7468
7504
|
* center: [4.9041, 52.3676],
|
|
7469
7505
|
* zoom: 12,
|
|
7470
7506
|
* style: 'standardLight',
|
|
7471
|
-
*
|
|
7507
|
+
* events: {
|
|
7472
7508
|
* onClick: (event) => console.log('Map clicked', event)
|
|
7473
7509
|
* }
|
|
7474
7510
|
* };
|
|
@@ -7505,7 +7541,7 @@ export declare type TomTomMapParams = GlobalConfig & {
|
|
|
7505
7541
|
*
|
|
7506
7542
|
* @example
|
|
7507
7543
|
* ```typescript
|
|
7508
|
-
*
|
|
7544
|
+
* events: {
|
|
7509
7545
|
* onClick: (event) => {
|
|
7510
7546
|
* console.log('Clicked at', event.lngLat);
|
|
7511
7547
|
* },
|
|
@@ -7515,7 +7551,7 @@ export declare type TomTomMapParams = GlobalConfig & {
|
|
|
7515
7551
|
* }
|
|
7516
7552
|
* ```
|
|
7517
7553
|
*/
|
|
7518
|
-
|
|
7554
|
+
events?: MapEventsConfig;
|
|
7519
7555
|
};
|
|
7520
7556
|
|
|
7521
7557
|
/**
|
|
@@ -7754,13 +7790,13 @@ export declare class TrafficFlowModule extends AbstractMapModule<TrafficFlowSour
|
|
|
7754
7790
|
* @example
|
|
7755
7791
|
* Default initialization:
|
|
7756
7792
|
* ```typescript
|
|
7757
|
-
* const
|
|
7793
|
+
* const trafficFlowModule = await TrafficFlowModule.get(map);
|
|
7758
7794
|
* ```
|
|
7759
7795
|
*
|
|
7760
7796
|
* @example
|
|
7761
7797
|
* Auto-add to style:
|
|
7762
7798
|
* ```typescript
|
|
7763
|
-
* const
|
|
7799
|
+
* const trafficFlowModule = await TrafficFlowModule.get(map, {
|
|
7764
7800
|
* visible: true,
|
|
7765
7801
|
* filters: {
|
|
7766
7802
|
* any: [{
|
|
@@ -8003,23 +8039,23 @@ export declare type TrafficIncidentsFilters = {
|
|
|
8003
8039
|
* import { TrafficIncidentsModule } from '@tomtom-international/maps-sdk-js/map';
|
|
8004
8040
|
*
|
|
8005
8041
|
* // Get module (auto-add to style if needed)
|
|
8006
|
-
* const
|
|
8042
|
+
* const trafficIncidentsModule = await TrafficIncidentsModule.get(map, {
|
|
8007
8043
|
* visible: true
|
|
8008
8044
|
* });
|
|
8009
8045
|
*
|
|
8010
8046
|
* // Toggle visibility
|
|
8011
|
-
*
|
|
8012
|
-
*
|
|
8047
|
+
* trafficIncidentsModule.setVisible(false);
|
|
8048
|
+
* trafficIncidentsModule.setVisible(true);
|
|
8013
8049
|
*
|
|
8014
8050
|
* // Control icons separately
|
|
8015
|
-
*
|
|
8051
|
+
* trafficIncidentsModule.setIconsVisible(false);
|
|
8016
8052
|
* ```
|
|
8017
8053
|
*
|
|
8018
8054
|
* @example
|
|
8019
8055
|
* Filter by incident type:
|
|
8020
8056
|
* ```typescript
|
|
8021
8057
|
* // Show only accidents and road closures
|
|
8022
|
-
*
|
|
8058
|
+
* trafficIncidentsModule.filter({
|
|
8023
8059
|
* any: [{
|
|
8024
8060
|
* incidentCategories: {
|
|
8025
8061
|
* show: 'only',
|
|
@@ -8029,7 +8065,7 @@ export declare type TrafficIncidentsFilters = {
|
|
|
8029
8065
|
* });
|
|
8030
8066
|
*
|
|
8031
8067
|
* // Hide construction
|
|
8032
|
-
*
|
|
8068
|
+
* trafficIncidentsModule.filter({
|
|
8033
8069
|
* any: [{
|
|
8034
8070
|
* incidentCategories: {
|
|
8035
8071
|
* show: 'all_except',
|
|
@@ -8107,13 +8143,13 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
|
|
|
8107
8143
|
* @example
|
|
8108
8144
|
* Default initialization:
|
|
8109
8145
|
* ```typescript
|
|
8110
|
-
* const
|
|
8146
|
+
* const trafficIncidentsModule = await TrafficIncidentsModule.get(map);
|
|
8111
8147
|
* ```
|
|
8112
8148
|
*
|
|
8113
8149
|
* @example
|
|
8114
8150
|
* With configuration:
|
|
8115
8151
|
* ```typescript
|
|
8116
|
-
* const
|
|
8152
|
+
* const trafficIncidentsModule = await TrafficIncidentsModule.get(map, {
|
|
8117
8153
|
* visible: true,
|
|
8118
8154
|
* icons: { visible: true },
|
|
8119
8155
|
* filters: {
|
|
@@ -8352,7 +8388,7 @@ export declare const UNKNOWN_DELAY_COLOR = "#000000";
|
|
|
8352
8388
|
*
|
|
8353
8389
|
* @see {@link EventsModule.on} - For registering event handlers
|
|
8354
8390
|
*
|
|
8355
|
-
* @group User Events
|
|
8391
|
+
* @group User Interaction Events
|
|
8356
8392
|
*/
|
|
8357
8393
|
export declare type UserEventHandler<T> = (topFeature: T, lngLat: LngLat, allEventFeatures: MapGeoJSONFeature[], sourceWithLayers: SourceWithLayers) => void;
|
|
8358
8394
|
|