@tomtom-org/maps-sdk 0.45.4 → 0.45.6

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.
@@ -14,6 +14,7 @@ import { ExpressionFilterSpecification } from 'maplibre-gl';
14
14
  import { ExpressionSpecification } from 'maplibre-gl';
15
15
  import { Feature } from 'geojson';
16
16
  import { FeatureCollection } from 'geojson';
17
+ import { GeoJsonProperties } from 'geojson';
17
18
  import { GeoJSONSource } from 'maplibre-gl';
18
19
  import { GeoJSONSourceSpecification } from 'maplibre-gl';
19
20
  import { GetPositionEntryPointOption } from '@tomtom-org/maps-sdk/core';
@@ -2983,6 +2984,24 @@ export declare class GeometriesModule extends AbstractMapModule<GeometrySourcesW
2983
2984
  * ```
2984
2985
  */
2985
2986
  clear(): Promise<void>;
2987
+ /**
2988
+ * Returns the currently shown geometries.
2989
+ *
2990
+ * @returns The geometries currently displayed on the map.
2991
+ *
2992
+ * @remarks
2993
+ * Returns the exact data that was passed to the `show()` method.
2994
+ *
2995
+ * @example
2996
+ * ```typescript
2997
+ * const shown = geometriesModule.getShown();
2998
+ * console.log(`Geometries: ${shown.geometry.features.length}`);
2999
+ * ```
3000
+ */
3001
+ getShown(): {
3002
+ geometry: PolygonFeatures;
3003
+ geometryLabel: FeatureCollection<Point, GeoJsonProperties>;
3004
+ };
2986
3005
  /**
2987
3006
  * Gets the events interface for handling user interactions with geometries.
2988
3007
  *
@@ -3611,8 +3630,11 @@ declare type HillshadeSourcesWithLayers = {
3611
3630
  * Subtype for hover events with timing distinction.
3612
3631
  *
3613
3632
  * @remarks
3614
- * - `hover`: Immediate hover when cursor enters a feature
3615
- * - `long-hover`: Triggered after hovering for a configured duration (typically 300-800ms)
3633
+ * - `hover`: Fires once when the cursor first enters a feature
3634
+ * - `hover-move`: Fires on every mouse movement while the cursor remains over the same feature.
3635
+ * Use this when you need continuously updated coordinates as the cursor travels along the feature
3636
+ * (e.g. updating a tooltip position or snapping to a route line).
3637
+ * - `long-hover`: Triggered after hovering over a feature for a configured duration (typically 300-800ms)
3616
3638
  *
3617
3639
  * Long-hover is useful for showing detailed tooltips or previews without
3618
3640
  * cluttering the UI during quick mouse movements.
@@ -3620,12 +3642,13 @@ declare type HillshadeSourcesWithLayers = {
3620
3642
  * @example
3621
3643
  * ```typescript
3622
3644
  * const quickHover: HoverEventType = 'hover';
3645
+ * const movingHover: HoverEventType = 'hover-move';
3623
3646
  * const sustainedHover: HoverEventType = 'long-hover';
3624
3647
  * ```
3625
3648
  *
3626
3649
  * @group User Interaction Events
3627
3650
  */
3628
- export declare type HoverEventType = 'hover' | 'long-hover';
3651
+ export declare type HoverEventType = 'hover' | 'hover-move' | 'long-hover';
3629
3652
 
3630
3653
  /**
3631
3654
  * Available traffic incident category identifiers.
@@ -4786,6 +4809,23 @@ export declare class PlacesModule extends AbstractMapModule<PlacesSourcesAndLaye
4786
4809
  * ```
4787
4810
  */
4788
4811
  clear(): Promise<void>;
4812
+ /**
4813
+ * Returns the currently shown places.
4814
+ *
4815
+ * @returns The places currently displayed on the map.
4816
+ *
4817
+ * @remarks
4818
+ * Returns the exact data that was passed to the `show()` method.
4819
+ *
4820
+ * @example
4821
+ * ```typescript
4822
+ * const shown = placesModule.getShown();
4823
+ * console.log(`Showing ${shown.places.features.length} places`);
4824
+ * ```
4825
+ */
4826
+ getShown(): {
4827
+ places: Places<DisplayPlaceProps>;
4828
+ };
4789
4829
  /**
4790
4830
  * Programmatically sets an event state on a specific place.
4791
4831
  *
@@ -5489,6 +5529,23 @@ export declare class POIsModule extends AbstractMapModule<PoIsSourcesAndLayers,
5489
5529
  * ```
5490
5530
  */
5491
5531
  filterCategories(categoriesFilter?: ValuesFilter<FilterablePOICategory> | undefined): void;
5532
+ /**
5533
+ * Returns features currently visible in the viewport.
5534
+ *
5535
+ * @returns An object containing visible POI features with properly typed properties.
5536
+ *
5537
+ * @example
5538
+ * ```typescript
5539
+ * const shown = poisModule.getShown();
5540
+ * console.log(`Visible POIs: ${shown.poi.length}`);
5541
+ * shown.poi.forEach(poi => {
5542
+ * console.log(poi.properties.name, poi.properties.category);
5543
+ * });
5544
+ * ```
5545
+ */
5546
+ getShown(): {
5547
+ poi: POIsModuleFeature[];
5548
+ };
5492
5549
  /**
5493
5550
  * Gets the events interface for handling user interactions with POIs.
5494
5551
  *
@@ -5638,6 +5695,7 @@ export declare type POIsModuleConfig = MapModuleCommonConfig & {
5638
5695
  * ```
5639
5696
  *
5640
5697
  * @group POIs
5698
+ * @see https://docs.tomtom.com/map-display-api/documentation/tomtom-orbis-maps/vector/content#poi for more details on the available properties from the vector tile features
5641
5699
  */
5642
5700
  export declare type POIsModuleFeature = Omit<MapGeoJSONFeature, 'properties'> & {
5643
5701
  /**
@@ -5671,19 +5729,9 @@ export declare type POIsModuleFeature = Omit<MapGeoJSONFeature, 'properties'> &
5671
5729
  * Used for styling and filtering purposes. Maps to a specific POI type
5672
5730
  * (e.g., RESTAURANT, HOTEL_MOTEL).
5673
5731
  *
5674
- * @example 'RESTAURANT'
5732
+ * @example 'restaurant'
5675
5733
  */
5676
5734
  category: string;
5677
- /**
5678
- * Sprite image ID for this POI's icon.
5679
- *
5680
- * @remarks
5681
- * References an image within the map style's sprite sheet used to
5682
- * render the POI icon on the map.
5683
- *
5684
- * @example 'restaurant-15'
5685
- */
5686
- iconID: string;
5687
5735
  /**
5688
5736
  * Broad category group this POI belongs to.
5689
5737
  *
@@ -6497,6 +6545,59 @@ export declare class RoutingModule extends AbstractMapModule<RoutingSourcesWithL
6497
6545
  * * If nothing was shown before, nothing happens.
6498
6546
  */
6499
6547
  clearWaypoints(): Promise<void>;
6548
+ /**
6549
+ * Returns the currently shown routes and waypoints.
6550
+ *
6551
+ * @returns An object containing all currently displayed routing data.
6552
+ *
6553
+ * @remarks
6554
+ * Returns the exact data that was passed to the `showRoutes()` and `showWaypoints()` methods.
6555
+ *
6556
+ * **Returned Data:**
6557
+ * - `mainLines`: Main route lines (selected and alternative)
6558
+ * - `waypoints`: Route waypoints (start, stops, finish)
6559
+ * - `incidents`: Traffic incidents on routes
6560
+ * - `ferries`: Ferry sections
6561
+ * - `chargingStops`: EV charging stations
6562
+ * - `tollRoads`: Toll road sections
6563
+ * - `tunnels`: Tunnel sections
6564
+ * - `vehicleRestricted`: Vehicle-restricted sections
6565
+ * - `instructionLines`: Turn-by-turn instruction lines
6566
+ * - `instructionArrows`: Instruction arrow markers
6567
+ * - `summaryBubbles`: Route summary popups
6568
+ *
6569
+ * @example
6570
+ * ```typescript
6571
+ * const shown = routingModule.getShown();
6572
+ * console.log(`Showing ${shown.mainLines.features.length} routes`);
6573
+ * console.log(`Showing ${shown.waypoints.features.length} waypoints`);
6574
+ * console.log(`Showing ${shown.chargingStops.features.length} charging stops`);
6575
+ * ```
6576
+ *
6577
+ * @example
6578
+ * Check if any routes are displayed:
6579
+ * ```typescript
6580
+ * const shown = routingModule.getShown();
6581
+ * if (shown.mainLines.features.length > 0) {
6582
+ * console.log('Routes are displayed');
6583
+ * } else {
6584
+ * console.log('No routes displayed');
6585
+ * }
6586
+ * ```
6587
+ */
6588
+ getShown(): {
6589
+ mainLines: Routes_2<DisplayRouteProps>;
6590
+ waypoints: Waypoints_2<WaypointDisplayProps>;
6591
+ incidents: RouteSections<DisplayTrafficSectionProps>;
6592
+ ferries: RouteSections;
6593
+ chargingStops: Waypoints_2;
6594
+ tollRoads: RouteSections;
6595
+ tunnels: RouteSections;
6596
+ vehicleRestricted: RouteSections;
6597
+ instructionLines: DisplayInstructions;
6598
+ instructionArrows: DisplayInstructionArrows;
6599
+ summaryBubbles: DisplayRouteSummaries;
6600
+ };
6500
6601
  /**
6501
6602
  * Create the events on/off for this module
6502
6603
  * @returns An instance of EventsModule
@@ -6568,6 +6669,21 @@ export declare type RoutingModuleConfig = MapModuleCommonConfig & {
6568
6669
  * Controls how charging stops source data and/or layer configs are processed to rendering them the map.
6569
6670
  */
6570
6671
  chargingStops?: ChargingStopsConfig;
6672
+ /**
6673
+ * Configuration for the route summary bubbles displayed on the map.
6674
+ *
6675
+ * @remarks
6676
+ * Summary bubbles show key route information (distance, duration, traffic delay)
6677
+ * as visual overlays positioned along the route.
6678
+ */
6679
+ summaryBubbles?: {
6680
+ /**
6681
+ * Controls the visibility of route summary bubbles on the map.
6682
+ *
6683
+ * @defaultValue true
6684
+ */
6685
+ visible?: boolean;
6686
+ };
6571
6687
  /**
6572
6688
  * Custom layer styling configuration.
6573
6689
  *
@@ -8171,6 +8287,45 @@ export declare class TrafficFlowModule extends AbstractMapModule<TrafficFlowSour
8171
8287
  * Returns if any layer for traffic flow is visible or not.
8172
8288
  */
8173
8289
  isVisible(): boolean;
8290
+ /**
8291
+ * Returns features currently visible in the viewport.
8292
+ *
8293
+ * @returns An object containing visible traffic flow features.
8294
+ *
8295
+ * @remarks
8296
+ * Returns all traffic flow features currently rendered in the visible map area.
8297
+ * These represent road segments with real-time traffic speed information.
8298
+ *
8299
+ * **Feature Properties:**
8300
+ * Properties depend on the traffic flow vector tile schema and may include:
8301
+ * - Current speed
8302
+ * - Free flow speed
8303
+ * - Road category
8304
+ * - Congestion level
8305
+ * - Road closure status
8306
+ *
8307
+ * @example
8308
+ * ```typescript
8309
+ * const shown = trafficFlow.getShown();
8310
+ * console.log(`Visible flow segments: ${shown.trafficFlow.length}`);
8311
+ * shown.trafficFlow.forEach(segment => {
8312
+ * console.log('Road segment:', segment.properties);
8313
+ * });
8314
+ * ```
8315
+ *
8316
+ * @example
8317
+ * Analyze congestion in viewport:
8318
+ * ```typescript
8319
+ * const shown = trafficFlow.getShown();
8320
+ * const congested = shown.trafficFlow.filter(
8321
+ * segment => segment.properties.speed < segment.properties.freeFlowSpeed * 0.5
8322
+ * );
8323
+ * console.log(`Congested segments: ${congested.length}`);
8324
+ * ```
8325
+ */
8326
+ getShown(): {
8327
+ trafficFlow: MapGeoJSONFeature[];
8328
+ };
8174
8329
  /**
8175
8330
  * Create the events on/off for this module
8176
8331
  * @returns An instance of EventsModule
@@ -8583,6 +8738,45 @@ export declare class TrafficIncidentsModule extends AbstractMapModule<TrafficInc
8583
8738
  * ```
8584
8739
  */
8585
8740
  anyIconLayersVisible(): boolean;
8741
+ /**
8742
+ * Returns features currently visible in the viewport.
8743
+ *
8744
+ * @returns An object containing visible traffic incident features.
8745
+ *
8746
+ * @remarks
8747
+ * Returns all incident features currently rendered in the visible map area,
8748
+ * including both incident areas/lines and icon markers.
8749
+ *
8750
+ * **Feature Properties:**
8751
+ * Properties depend on the traffic incidents vector tile schema and may include:
8752
+ * - Incident type/category
8753
+ * - Severity/magnitude
8754
+ * - Delay information
8755
+ * - Road affected
8756
+ * - Description
8757
+ *
8758
+ * @example
8759
+ * ```typescript
8760
+ * const shown = incidents.getShown();
8761
+ * console.log(`Visible incidents: ${shown.trafficIncidents.length}`);
8762
+ * shown.trafficIncidents.forEach(incident => {
8763
+ * console.log('Incident:', incident.properties);
8764
+ * });
8765
+ * ```
8766
+ *
8767
+ * @example
8768
+ * Filter and analyze visible incidents:
8769
+ * ```typescript
8770
+ * const shown = incidents.getShown();
8771
+ * const accidents = shown.trafficIncidents.filter(
8772
+ * incident => incident.properties.category === 'accident'
8773
+ * );
8774
+ * console.log(`Accidents in view: ${accidents.length}`);
8775
+ * ```
8776
+ */
8777
+ getShown(): {
8778
+ trafficIncidents: MapGeoJSONFeature[];
8779
+ };
8586
8780
  /**
8587
8781
  * Create the events on/off for this module
8588
8782
  * @returns An instance of EventsModule