@tomtom-org/maps-sdk 0.46.12 → 0.47.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 +38 -0
- package/core/dist/core.es.js +1 -1
- package/core/dist/core.es.js.map +1 -1
- package/map/dist/index.d.ts +111 -92
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/package.json +2 -2
package/map/dist/index.d.ts
CHANGED
|
@@ -2286,37 +2286,28 @@ declare type DisplayInstructionArrows = FeatureCollection<Point, Instruction & D
|
|
|
2286
2286
|
declare type DisplayInstructions = FeatureCollection<LineString, Instruction & DisplayRouteRelatedProps>;
|
|
2287
2287
|
|
|
2288
2288
|
/**
|
|
2289
|
-
*
|
|
2290
|
-
*
|
|
2291
|
-
*
|
|
2292
|
-
* properties for rendering on the map.
|
|
2293
|
-
*
|
|
2294
|
-
* @remarks
|
|
2295
|
-
* This is the full type used by the PlacesModule for rendering search results,
|
|
2296
|
-
* POIs, and other location markers on the map. It combines:
|
|
2297
|
-
* - Geographic data (coordinates, address)
|
|
2298
|
-
* - Place metadata (POI info, opening hours, etc.)
|
|
2299
|
-
* - Display properties (icon, title, category)
|
|
2300
|
-
* - Interactive state (event handling)
|
|
2289
|
+
* Full property shape used by the PlacesModule when rendering a place: the
|
|
2290
|
+
* core place data ({@link CommonPlaceProps}) merged with the display-only
|
|
2291
|
+
* fields the module attaches ({@link PlaceDisplayProps}).
|
|
2301
2292
|
*
|
|
2302
2293
|
* @example
|
|
2303
2294
|
* ```typescript
|
|
2304
2295
|
* const place: DisplayPlaceProps = {
|
|
2305
|
-
* type: '
|
|
2306
|
-
*
|
|
2296
|
+
* type: 'POI',
|
|
2297
|
+
* poi: {
|
|
2298
|
+
* name: 'Central Station',
|
|
2299
|
+
* categories: ['RAILWAY_STATION'],
|
|
2300
|
+
* },
|
|
2307
2301
|
* address: {
|
|
2308
2302
|
* streetName: 'Damrak',
|
|
2309
2303
|
* municipalitySubdivision: 'Amsterdam',
|
|
2310
|
-
* countryCode: 'NL'
|
|
2311
|
-
* },
|
|
2312
|
-
* poi: {
|
|
2313
|
-
* name: 'Central Station',
|
|
2314
|
-
* categories: ['RAILWAY_STATION']
|
|
2304
|
+
* countryCode: 'NL',
|
|
2315
2305
|
* },
|
|
2316
2306
|
* id: 'place-123',
|
|
2317
2307
|
* title: 'Amsterdam Central Station',
|
|
2318
|
-
* iconID: 'poi-
|
|
2319
|
-
* category: '
|
|
2308
|
+
* iconID: 'poi-railway_station',
|
|
2309
|
+
* category: 'railway_station',
|
|
2310
|
+
* group: 'transport',
|
|
2320
2311
|
* };
|
|
2321
2312
|
* ```
|
|
2322
2313
|
*
|
|
@@ -3920,11 +3911,18 @@ export declare const getLineForegroundWidth: (size?: RouteWidth) => ExpressionSp
|
|
|
3920
3911
|
*/
|
|
3921
3912
|
export declare const getLineOutlineWidth: (size?: RouteWidth) => ExpressionSpecification;
|
|
3922
3913
|
|
|
3914
|
+
/**
|
|
3915
|
+
* Maps a Place to the base map POI group used by the style's `text-color` and
|
|
3916
|
+
* `POI - Micro` icon expressions (e.g., `eat_and_drink`, `lodging`, `driving`).
|
|
3917
|
+
* @ignore
|
|
3918
|
+
*/
|
|
3919
|
+
export declare const getPOIGroupForPlace: (place: Place, config?: PlacesModuleConfig) => string | undefined;
|
|
3920
|
+
|
|
3923
3921
|
/**
|
|
3924
3922
|
* Maps a Place category to the poi layer one, so the latter's style can apply it.
|
|
3925
3923
|
* @ignore
|
|
3926
3924
|
*/
|
|
3927
|
-
export declare const getPOILayerCategoryForPlace: (place: Place) => string | undefined;
|
|
3925
|
+
export declare const getPOILayerCategoryForPlace: (place: Place, config?: PlacesModuleConfig) => string | undefined;
|
|
3928
3926
|
|
|
3929
3927
|
/**
|
|
3930
3928
|
* Gets the specified filtered categories icon IDs to be used in map filtering.
|
|
@@ -4903,29 +4901,38 @@ export declare type MultiSyntaxFilter = {
|
|
|
4903
4901
|
};
|
|
4904
4902
|
|
|
4905
4903
|
/**
|
|
4906
|
-
* Properties to
|
|
4907
|
-
*
|
|
4908
|
-
* Extends basic place information with display-specific properties needed
|
|
4909
|
-
* for rendering markers, icons, and labels on the map.
|
|
4904
|
+
* Properties attached to a place feature for rendering on the map.
|
|
4910
4905
|
*
|
|
4911
4906
|
* @remarks
|
|
4912
|
-
*
|
|
4913
|
-
*
|
|
4914
|
-
*
|
|
4915
|
-
*
|
|
4916
|
-
* -
|
|
4917
|
-
*
|
|
4918
|
-
*
|
|
4919
|
-
*
|
|
4907
|
+
* Extends the source place with display-only fields consumed by the places
|
|
4908
|
+
* layer stack. Which fields are populated depends on the active
|
|
4909
|
+
* {@link PlacesTheme | theme}:
|
|
4910
|
+
*
|
|
4911
|
+
* - Every theme uses {@link PlaceDisplayProps.iconID | iconID} — the sprite name
|
|
4912
|
+
* the main layer's `icon-image` expression binds to via `['get', 'iconID']`.
|
|
4913
|
+
* The base map's POI-Micro-like layer inherits the style's `['get','group']`
|
|
4914
|
+
* expression verbatim, so custom `PlaceIconConfig.categoryIcons` sprites only
|
|
4915
|
+
* apply to the `main` layer.
|
|
4916
|
+
* - The `base-map` theme additionally populates
|
|
4917
|
+
* {@link PlaceDisplayProps.category | category} and
|
|
4918
|
+
* {@link PlaceDisplayProps.group | group} so the base map style's own
|
|
4919
|
+
* `text-color` expression — and the POI-Micro layer's `icon-image` expression
|
|
4920
|
+
* — resolve against the place feature just as they do for native POIs.
|
|
4920
4921
|
*
|
|
4921
4922
|
* @example
|
|
4922
4923
|
* ```typescript
|
|
4923
|
-
* const
|
|
4924
|
+
* const pinPlaceProps: PlaceDisplayProps = {
|
|
4924
4925
|
* id: 'place-123',
|
|
4925
4926
|
* title: 'Central Station',
|
|
4926
4927
|
* iconID: 'poi-transit',
|
|
4927
|
-
*
|
|
4928
|
-
*
|
|
4928
|
+
* };
|
|
4929
|
+
*
|
|
4930
|
+
* const baseMapPlaceProps: PlaceDisplayProps = {
|
|
4931
|
+
* id: 'place-123',
|
|
4932
|
+
* title: 'Central Station',
|
|
4933
|
+
* iconID: 'poi-railway_station',
|
|
4934
|
+
* category: 'railway_station',
|
|
4935
|
+
* group: 'transport',
|
|
4929
4936
|
* };
|
|
4930
4937
|
* ```
|
|
4931
4938
|
*
|
|
@@ -4936,87 +4943,81 @@ export declare type PlaceDisplayProps = {
|
|
|
4936
4943
|
* Unique identifier for the place feature.
|
|
4937
4944
|
*
|
|
4938
4945
|
* @remarks
|
|
4939
|
-
* MapLibre does not reuse the feature IDs
|
|
4940
|
-
* or
|
|
4941
|
-
*
|
|
4942
|
-
*
|
|
4943
|
-
* - Feature identification in events
|
|
4944
|
-
* - State management
|
|
4945
|
-
* - Data updates
|
|
4946
|
+
* MapLibre does not reuse the feature IDs, so we either generate one on the
|
|
4947
|
+
* fly or promote the one from `properties.id` via the source's `promoteId`
|
|
4948
|
+
* option. Used for feature identification in events, hit-testing, and data
|
|
4949
|
+
* updates.
|
|
4946
4950
|
*
|
|
4947
4951
|
* @example
|
|
4948
4952
|
* ```typescript
|
|
4949
4953
|
* id: 'place-123'
|
|
4950
|
-
* id: 'poi-456'
|
|
4951
4954
|
* ```
|
|
4952
4955
|
*/
|
|
4953
4956
|
id: string;
|
|
4954
4957
|
/**
|
|
4955
|
-
*
|
|
4958
|
+
* Text label rendered next to the place marker.
|
|
4956
4959
|
*
|
|
4957
4960
|
* @remarks
|
|
4958
|
-
* Optional
|
|
4959
|
-
*
|
|
4960
|
-
*
|
|
4961
|
-
* **Common Sources:**
|
|
4962
|
-
* - POI name (e.g., "Starbucks")
|
|
4963
|
-
* - Address (e.g., "123 Main Street")
|
|
4964
|
-
* - Custom label (e.g., "Meeting Point")
|
|
4961
|
+
* Optional — when absent no label is drawn. Typically sourced from the POI
|
|
4962
|
+
* name or free-form address, but can be any custom string (e.g., configured
|
|
4963
|
+
* via `PlacesModuleConfig.text.title`).
|
|
4965
4964
|
*
|
|
4966
4965
|
* @example
|
|
4967
4966
|
* ```typescript
|
|
4968
4967
|
* title: 'Amsterdam Central Station'
|
|
4969
|
-
* title: 'Starbucks'
|
|
4970
|
-
* title: '123 Main Street'
|
|
4971
|
-
* title: undefined // No label
|
|
4972
4968
|
* ```
|
|
4973
4969
|
*/
|
|
4974
4970
|
title?: string;
|
|
4975
4971
|
/**
|
|
4976
|
-
*
|
|
4972
|
+
* Sprite image ID used to draw the place marker.
|
|
4977
4973
|
*
|
|
4978
4974
|
* @remarks
|
|
4979
|
-
*
|
|
4980
|
-
*
|
|
4981
|
-
*
|
|
4982
|
-
*
|
|
4983
|
-
*
|
|
4984
|
-
*
|
|
4985
|
-
*
|
|
4975
|
+
* The main layer binds `icon-image` to `['get', 'iconID']`, so the sprite
|
|
4976
|
+
* named here is what renders. The base map's POI-Micro-like layer inherits
|
|
4977
|
+
* the style's group-driven expression verbatim and ignores this value. The
|
|
4978
|
+
* sprite name is resolved per theme: `pin` / `circle-icon` pick a built-in
|
|
4979
|
+
* sprite; `base-map` picks the base map's `poi-<category>` sprite; a custom
|
|
4980
|
+
* `PlaceIconConfig.categoryIcons` entry overrides the default for the main
|
|
4981
|
+
* layer on any theme.
|
|
4986
4982
|
*
|
|
4987
4983
|
* @example
|
|
4988
4984
|
* ```typescript
|
|
4989
|
-
* iconID: '
|
|
4990
|
-
* iconID: '
|
|
4991
|
-
* iconID: 'custom-marker'
|
|
4985
|
+
* iconID: '7315' // pin theme sprite
|
|
4986
|
+
* iconID: 'poi-restaurant' // circle-icon / base-map theme sprite
|
|
4987
|
+
* iconID: 'custom-marker-0' // user-provided custom icon
|
|
4992
4988
|
* ```
|
|
4993
4989
|
*/
|
|
4994
4990
|
iconID: string;
|
|
4995
4991
|
/**
|
|
4996
|
-
*
|
|
4992
|
+
* Base map style POI category the place should be rendered as.
|
|
4997
4993
|
*
|
|
4998
4994
|
* @remarks
|
|
4999
|
-
*
|
|
5000
|
-
*
|
|
5001
|
-
*
|
|
5002
|
-
*
|
|
5003
|
-
* - RESTAURANT
|
|
5004
|
-
* - HOTEL_MOTEL
|
|
5005
|
-
* - GAS_STATION
|
|
5006
|
-
* - PARKING_GARAGE
|
|
5007
|
-
* - SHOPPING
|
|
5008
|
-
*
|
|
5009
|
-
* Optional - only needed when using base-map styling or category-based filtering.
|
|
4995
|
+
* Populated only for the `base-map` theme. Values are the lowercased
|
|
4996
|
+
* identifiers used by the base map style (derived via
|
|
4997
|
+
* {@link toBaseMapPOICategory}). Drives the inherited `text-color`
|
|
4998
|
+
* expression on the main/selected POI-like layers.
|
|
5010
4999
|
*
|
|
5011
5000
|
* @example
|
|
5012
5001
|
* ```typescript
|
|
5013
|
-
* category: '
|
|
5014
|
-
* category: '
|
|
5015
|
-
* category: '
|
|
5016
|
-
* category: undefined // No category association
|
|
5002
|
+
* category: 'restaurant'
|
|
5003
|
+
* category: 'hotel_or_motel'
|
|
5004
|
+
* category: 'charging_location'
|
|
5017
5005
|
* ```
|
|
5018
5006
|
*/
|
|
5019
5007
|
category?: string;
|
|
5008
|
+
/**
|
|
5009
|
+
* Base map style POI group the place belongs to.
|
|
5010
|
+
*
|
|
5011
|
+
* @remarks
|
|
5012
|
+
* Populated only for the `base-map` theme. Drives the inherited
|
|
5013
|
+
* `text-color` expression on the base map's POI layers.
|
|
5014
|
+
* Valid values are those produced by {@link toBaseMapPOIGroup} — e.g.,
|
|
5015
|
+
* `eat_and_drink`, `lodging`, `driving`, `transport`, `shopping`,
|
|
5016
|
+
* `healthcare`, `finance`, `cultural`, `leisure`, `sport`, `outdoor`,
|
|
5017
|
+
* `protected`, `public`, `religion`, `military`, `business`, `education`,
|
|
5018
|
+
* `parking`.
|
|
5019
|
+
*/
|
|
5020
|
+
group?: string;
|
|
5020
5021
|
} & SupportsEvents & Anything;
|
|
5021
5022
|
|
|
5022
5023
|
/**
|
|
@@ -5141,6 +5142,18 @@ export declare type PlaceLayersConfig = {
|
|
|
5141
5142
|
* This layer renders places that are not in a highlighted/selected state.
|
|
5142
5143
|
*/
|
|
5143
5144
|
main?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
5145
|
+
/**
|
|
5146
|
+
* Micro place marker layer specification.
|
|
5147
|
+
*
|
|
5148
|
+
* @remarks
|
|
5149
|
+
* Always registered and stacked below the `main` layer, but only renders features
|
|
5150
|
+
* when the `base-map` theme is active — in that mode it mirrors the map style's
|
|
5151
|
+
* `POI - Micro` layer so place markers blend with the base map's lower-density
|
|
5152
|
+
* POI rendering. For other themes the layer is hidden via
|
|
5153
|
+
* `layout.visibility = 'none'` and acts as a no-op, making theme switches cheap
|
|
5154
|
+
* (no add/remove layer churn).
|
|
5155
|
+
*/
|
|
5156
|
+
micro?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
|
|
5144
5157
|
/**
|
|
5145
5158
|
* Selected place marker layer specification.
|
|
5146
5159
|
*
|
|
@@ -5163,7 +5176,7 @@ export declare type PlaceLayersConfig = {
|
|
|
5163
5176
|
*
|
|
5164
5177
|
* @remarks
|
|
5165
5178
|
* **Features:**
|
|
5166
|
-
* - Multiple marker styles (pin, circle, POI-like)
|
|
5179
|
+
* - Multiple marker styles (pin, circle-icon, base-map POI-like)
|
|
5167
5180
|
* - Custom icons per POI category
|
|
5168
5181
|
* - Text labels with styling options
|
|
5169
5182
|
* - Data-driven styling via MapLibre expressions
|
|
@@ -5173,8 +5186,8 @@ export declare type PlaceLayersConfig = {
|
|
|
5173
5186
|
*
|
|
5174
5187
|
* **Marker Styles:**
|
|
5175
5188
|
* - `pin`: Traditional teardrop-shaped map pins
|
|
5176
|
-
* - `circle`: Simple circular markers
|
|
5177
|
-
* - `base-map`: Mimics built-in POI layer styling
|
|
5189
|
+
* - `circle-icon`: Simple circular markers (previously named `circle`)
|
|
5190
|
+
* - `base-map`: Mimics the map's built-in POI layer styling (combines `main`, `selected`, and `micro` layers). For micro-only rendering, hide the `main` layer via `layers.main.layout.visibility = 'none'`.
|
|
5178
5191
|
*
|
|
5179
5192
|
* **EV Charging Station Availability:**
|
|
5180
5193
|
* When displaying EV charging stations with availability data from
|
|
@@ -5279,8 +5292,8 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
5279
5292
|
* @remarks
|
|
5280
5293
|
* **Available Themes:**
|
|
5281
5294
|
* - `pin`: Traditional teardrop-shaped map pins
|
|
5282
|
-
* - `circle`: Simple circular markers
|
|
5283
|
-
* - `base-map`: Mimics the map's built-in POI layer style with category icons
|
|
5295
|
+
* - `circle-icon`: Simple circular markers (previously named `circle`)
|
|
5296
|
+
* - `base-map`: Mimics the map's built-in POI layer style with category icons (combines `main`, `selected`, and `micro`). For micro-only rendering, hide the `main` layer via `layers.main.layout.visibility = 'none'`.
|
|
5284
5297
|
*
|
|
5285
5298
|
* Changes apply immediately to all currently shown places. Other configuration
|
|
5286
5299
|
* properties (icon config, text config) remain unchanged.
|
|
@@ -5291,7 +5304,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
5291
5304
|
* placesModule.applyTheme('pin');
|
|
5292
5305
|
*
|
|
5293
5306
|
* // Use simple circles
|
|
5294
|
-
* placesModule.applyTheme('circle');
|
|
5307
|
+
* placesModule.applyTheme('circle-icon');
|
|
5295
5308
|
*
|
|
5296
5309
|
* // Match map's POI style (ideal to blend in)
|
|
5297
5310
|
* placesModule.applyTheme('base-map');
|
|
@@ -5364,6 +5377,7 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
|
|
|
5364
5377
|
[key: string]: any;
|
|
5365
5378
|
}): void;
|
|
5366
5379
|
private updateLayersAndData;
|
|
5380
|
+
private applyPlacesVisibility;
|
|
5367
5381
|
private setupImages;
|
|
5368
5382
|
private updateData;
|
|
5369
5383
|
/**
|
|
@@ -5626,12 +5640,12 @@ declare type PlacesSourcesAndLayers = {
|
|
|
5626
5640
|
* @remarks
|
|
5627
5641
|
* **Available Styles:**
|
|
5628
5642
|
* - `pin`: Traditional map pin markers (teardrop shape)
|
|
5629
|
-
* - `circle`: Simple circular markers
|
|
5630
|
-
* - `base-map`: Mimics the map's built-in POI layer style with category icons
|
|
5643
|
+
* - `circle-icon`: Simple circular markers (previously named `circle`)
|
|
5644
|
+
* - `base-map`: Mimics the map's built-in POI layer style with category icons (combines `main`, `selected`, and `micro` layers). For micro-only rendering, hide the `main` layer via `layers.main.layout.visibility = 'none'`.
|
|
5631
5645
|
*
|
|
5632
5646
|
* @group Places
|
|
5633
5647
|
*/
|
|
5634
|
-
export declare type PlacesTheme = 'pin' | 'circle' | 'base-map';
|
|
5648
|
+
export declare type PlacesTheme = 'pin' | 'circle-icon' | 'base-map';
|
|
5635
5649
|
|
|
5636
5650
|
/**
|
|
5637
5651
|
* Configuration for place text labels.
|
|
@@ -8080,6 +8094,11 @@ export declare const themedGeometryConfig: (palette?: ColorPaletteOptions, befor
|
|
|
8080
8094
|
*/
|
|
8081
8095
|
export declare const toBaseMapPOICategory: (category: POICategory) => string;
|
|
8082
8096
|
|
|
8097
|
+
/**
|
|
8098
|
+
* @ignore
|
|
8099
|
+
*/
|
|
8100
|
+
export declare const toBaseMapPOIGroup: (category: POICategory) => string | undefined;
|
|
8101
|
+
|
|
8083
8102
|
/**
|
|
8084
8103
|
* Layer to be added to the existing style, and may include extra config such as the ID of the layer to add it under.
|
|
8085
8104
|
* * e.g. GeoJSON layers.
|