@tomtom-org/maps-sdk 0.35.5 → 0.36.1

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.
@@ -2165,7 +2165,7 @@ export declare type GetPositionOptions = {
2165
2165
  * }
2166
2166
  * ```
2167
2167
  *
2168
- * @group Shared
2168
+ * @ignore
2169
2169
  */
2170
2170
  export declare const getPositionStrict: (hasLngLat: HasLngLat, options?: GetPositionOptions) => Position;
2171
2171
 
@@ -3432,6 +3432,15 @@ export declare type POI = {
3432
3432
  timeZone?: TimeZone;
3433
3433
  };
3434
3434
 
3435
+ /**
3436
+ * POI categories were retrieved from https://docs.tomtom.com/search-api/documentation/poi-categories-service/poi-categories
3437
+ * so it can be passed to search endpoints in a human-readable format in addition to being able to use POI category ID directly
3438
+ * categories were put in this format trying to match them poi classification codes as much as possible.
3439
+ *
3440
+ * @ignore
3441
+ */
3442
+ export declare const poiCategoriesToID: Record<POICategory, number>;
3443
+
3435
3444
  /**
3436
3445
  * @group Place
3437
3446
  */
@@ -3470,6 +3479,13 @@ export declare type PoiDetailsDataSource = {
3470
3479
  sourceName?: string;
3471
3480
  };
3472
3481
 
3482
+ /**
3483
+ * Inverted mapping of POI category IDs to their corresponding category names.
3484
+ *
3485
+ * @ignore
3486
+ */
3487
+ export declare const poiIDsToCategories: Record<number, POICategory>;
3488
+
3473
3489
  /**
3474
3490
  * GeoJSON Feature containing polygon or multi-polygon geometry.
3475
3491
  *
@@ -3729,7 +3745,14 @@ export declare type RoadShieldSectionProps = SectionProps & {
3729
3745
  *
3730
3746
  * @group Route
3731
3747
  */
3732
- export declare type Route<P extends RouteProps = RouteProps> = Feature<LineString, P>;
3748
+ export declare type Route<P extends RouteProps = RouteProps> = Omit<Feature<LineString, P>, 'id'> & {
3749
+ /**
3750
+ * Unique identifier for this route.
3751
+ *
3752
+ * Randomly generated to distinguish between multiple route alternatives.
3753
+ */
3754
+ id: string;
3755
+ };
3733
3756
 
3734
3757
  /**
3735
3758
  * Route path point and its metadata.
@@ -3839,12 +3862,6 @@ export declare type RouteProgressPoint = {
3839
3862
  * @group Route
3840
3863
  */
3841
3864
  export declare type RouteProps = {
3842
- /**
3843
- * Unique identifier for this route.
3844
- *
3845
- * Randomly generated to distinguish between multiple route alternatives.
3846
- */
3847
- id: string;
3848
3865
  /**
3849
3866
  * Summary statistics for the entire route.
3850
3867
  *
@@ -3910,7 +3927,12 @@ export declare type RouteProps = {
3910
3927
  *
3911
3928
  * @group Route
3912
3929
  */
3913
- export declare type Routes<P extends RouteProps = RouteProps, FeatureCollectionProps = unknown> = FeatureCollectionWithProperties<LineString, P, FeatureCollectionProps>;
3930
+ export declare type Routes<P extends RouteProps = RouteProps, FeatureCollectionProps = unknown> = Omit<FeatureCollectionWithProperties<LineString, P, FeatureCollectionProps>, 'features'> & {
3931
+ /**
3932
+ * Array of route features.
3933
+ */
3934
+ features: Route<P>[];
3935
+ };
3914
3936
 
3915
3937
  /**
3916
3938
  * Complete summary information for an entire route.
@@ -4441,9 +4463,8 @@ export declare type TomTomHeaders = {
4441
4463
 
4442
4464
  /**
4443
4465
  * @ignore
4444
- * @param lngLat
4445
4466
  */
4446
- export declare const toPointFeature: (lngLat: Position) => Feature<Point>;
4467
+ export declare const toPointFeature: (coordinates: Position) => Feature<Point>;
4447
4468
 
4448
4469
  /**
4449
4470
  * All possible traffic incident categories.
@@ -63,7 +63,7 @@ terms above.
63
63
  ---
64
64
 
65
65
  Name: @tomtom-org/maps-sdk
66
- Version: 0.35.5
66
+ Version: 0.36.1
67
67
  License: See in LICENSE.txt
68
68
  Private: false
69
69
  Description: TomTom Maps for JavaScript
@@ -956,9 +956,11 @@ export declare const buildPlaceTitle: (place: Place) => string;
956
956
  /**
957
957
  * Generates the routing layers configuration for route visualization on the map.
958
958
  * @param config - Optional routing module configuration to customize layer properties.
959
+ * @param layerIDPrefix - Optional prefix to add to layer IDs for supporting multiple instances.
960
+ * @param instanceIndex - Optional instance index for image ID suffixes.
959
961
  * @ignore
960
962
  */
961
- export declare const buildRoutingLayers: (config?: RoutingModuleConfig) => Required<RouteLayersConfig>;
963
+ export declare const buildRoutingLayers: (config?: RoutingModuleConfig, layerIDPrefix?: string, instanceIndex?: number) => Required<RouteLayersConfig>;
962
964
 
963
965
  /**
964
966
  * Parameters to identify a feature by its ID or index in a given features array.
@@ -3379,11 +3381,6 @@ declare type HillshadeSourcesWithLayers = {
3379
3381
  */
3380
3382
  export declare type HoverEventType = 'hover' | 'long-hover';
3381
3383
 
3382
- /**
3383
- * @ignore
3384
- */
3385
- export declare const imageIDWithInstanceSuffix: (baseID: string, instanceIndex: number) => string;
3386
-
3387
3384
  /**
3388
3385
  * Available traffic incident category identifiers.
3389
3386
  *
@@ -3507,9 +3504,10 @@ export declare type LightDark = 'light' | 'dark';
3507
3504
  export declare const MAJOR_DELAY_COLOR = "#AD0000";
3508
3505
 
3509
3506
  /**
3507
+ * POI category mappings that have a direct equivalent in Map Display POI categories.
3510
3508
  * @ignore
3511
3509
  */
3512
- declare const mapDisplayPoiCategoryMappings: Partial<Record<POICategory, string>>;
3510
+ export declare const mapDisplayPoiCategoryMappings: Partial<Record<POICategory, string>>;
3513
3511
 
3514
3512
  /**
3515
3513
  * Configuration options for map user event handling.
@@ -4174,15 +4172,39 @@ export declare type PlaceIconConfig = {
4174
4172
  */
4175
4173
  categoryIcons?: CustomImage<MapStylePOICategory>[];
4176
4174
  /**
4177
- * Custom mapping function to generate the icon ID for a given place.
4175
+ * Custom mapping to determine the icon for a given place.
4178
4176
  *
4179
4177
  * @remarks
4180
- * If provided, this function sets the iconID property on the place.
4181
- * This allows for full control on how to determine which icon to use for each place based on its properties.
4178
+ * Supports two mapping strategies:
4179
+ *
4180
+ * - **`imageID`**: Directly returns the icon image ID to use for the place.
4181
+ * This provides full control over icon selection.
4182
+ *
4183
+ * - **`poiCategory`**: Returns a POI category, which is then resolved to an icon
4184
+ * using the existing category-to-icon logic. This reuses the standard category mapping.
4185
+ *
4186
+ * @example
4187
+ * ```typescript
4188
+ * // Direct image ID mapping
4189
+ * mapping: {
4190
+ * to: 'imageID',
4191
+ * fn: (place) => place.properties.poi?.name?.includes('urgent') ? 'urgent-icon' : 'default-icon'
4192
+ * }
4182
4193
  *
4183
- * @param place The place to generate the icon ID for.
4194
+ * // POI category mapping
4195
+ * mapping: {
4196
+ * to: 'poiCategory',
4197
+ * fn: (place) => place.properties.customCategory || 'RESTAURANT'
4198
+ * }
4199
+ * ```
4184
4200
  */
4185
- mapping?: (place: Place) => string;
4201
+ mapping?: {
4202
+ to: 'imageID';
4203
+ fn: (place: Place) => string;
4204
+ } | {
4205
+ to: 'poiCategory';
4206
+ fn: (place: Place) => MapStylePOICategory;
4207
+ };
4186
4208
  };
4187
4209
 
4188
4210
  /**
@@ -4253,17 +4275,6 @@ export declare type PlaceLayersConfig = {
4253
4275
  selected?: Partial<ToBeAddedLayerSpecTemplate<SymbolLayerSpecification>>;
4254
4276
  } & HasAdditionalLayersConfig;
4255
4277
 
4256
- /**
4257
- * Source identifier prefix for places (geocoding results) features.
4258
- *
4259
- * @remarks
4260
- * Combined with a unique identifier to create source IDs for place markers
4261
- * displayed via the Places module.
4262
- *
4263
- * @group Places
4264
- */
4265
- export declare const PLACES_SOURCE_PREFIX_ID = "places";
4266
-
4267
4278
  /**
4268
4279
  * Map module for displaying and managing place markers.
4269
4280
  *
@@ -6050,7 +6061,15 @@ export declare type RouteTheme = {
6050
6061
  * @group Routing
6051
6062
  */
6052
6063
  export declare class RoutingModule extends AbstractMapModule<RoutingSourcesWithLayers, RoutingModuleConfig> {
6064
+ private static lastInstanceIndex;
6053
6065
  private layersSpecs;
6066
+ private layerIDPrefix;
6067
+ /**
6068
+ * The index of this instance, to generate unique source and layer IDs.
6069
+ * * Starts with 0 and each instance increments it by one.
6070
+ * @private
6071
+ */
6072
+ private instanceIndex;
6054
6073
  /**
6055
6074
  * Make sure the map is ready before create an instance of the module and any other interaction with the map
6056
6075
  * @param tomtomMap The TomTomMap instance.
@@ -6089,7 +6108,7 @@ export declare class RoutingModule extends AbstractMapModule<RoutingSourcesWithL
6089
6108
  /**
6090
6109
  * @ignore
6091
6110
  */
6092
- protected _initSourcesWithLayers(config?: RoutingModuleConfig): RoutingSourcesWithLayers;
6111
+ protected _initSourcesWithLayers(config?: RoutingModuleConfig, restore?: boolean): RoutingSourcesWithLayers;
6093
6112
  /**
6094
6113
  * @ignore
6095
6114
  */
@@ -6861,6 +6880,11 @@ export declare const tertiaryRoadCategories: readonly ["connecting", "major_loca
6861
6880
  */
6862
6881
  export declare type TertiaryRoadCategory = (typeof tertiaryRoadCategories)[number];
6863
6882
 
6883
+ /**
6884
+ * @ignore
6885
+ */
6886
+ export declare const toBaseMapPOICategory: (category: POICategory) => string;
6887
+
6864
6888
  /**
6865
6889
  * Layer to be added to the existing style, and may include extra config such as the ID of the layer to add it under.
6866
6890
  * * e.g. GeoJSON layers.
@@ -6893,11 +6917,6 @@ export declare type ToBeAddedLayerSpecTemplate<L extends LayerSpecification = La
6893
6917
  */
6894
6918
  export declare type ToBeAddedLayerSpecWithoutSource<L extends LayerSpecification = LayerSpecification> = Omit<ToBeAddedLayerSpec<L>, 'source'>;
6895
6919
 
6896
- /**
6897
- * @ignore
6898
- */
6899
- export declare const toMapDisplayPOICategory: (category: POICategory) => string;
6900
-
6901
6920
  /**
6902
6921
  * Main TomTom Map class for displaying interactive maps in web applications.
6903
6922
  *