@tomtom-org/maps-sdk 0.63.0 → 0.64.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 +70 -0
- package/README.md +5 -4
- package/core/dist/core.es.js +1 -1
- package/core/dist/core.es.js.map +1 -1
- package/core/dist/index.d.ts +69 -201
- package/map/dist/chunks/maplibre-gl-worker.js +2 -0
- package/map/dist/chunks/maplibre-gl-worker.js.map +1 -0
- package/map/dist/index.d.ts +5469 -5503
- package/map/dist/map.es.js +1 -1
- package/map/dist/map.es.js.map +1 -1
- package/package.json +1 -1
- package/services/dist/index.d.ts +44 -227
- package/services/dist/services.es.js +1 -1
- package/services/dist/services.es.js.map +1 -1
package/core/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BBox as BBox$1
|
|
1
|
+
import { BBox as BBox$1 } from "@tomtom-org/maps-sdk/core";
|
|
2
2
|
//#region src/types/generic.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Generic object type with string keys and unknown values.
|
|
@@ -479,18 +479,6 @@ type GetPositionOptions = {
|
|
|
479
479
|
};
|
|
480
480
|
//#endregion
|
|
481
481
|
//#region src/types/headers.d.ts
|
|
482
|
-
/**
|
|
483
|
-
* Interface for TomTom custom headers
|
|
484
|
-
* Those headers are added in every request to TomTom services
|
|
485
|
-
* * tomtom-user-agent - Name and version of this SDK
|
|
486
|
-
* * Authorization - Bearer token for experimental OAuth2 support.
|
|
487
|
-
* Based on the apiAccessToken parameter.
|
|
488
|
-
* @ignore
|
|
489
|
-
*/
|
|
490
|
-
type TomTomHeaders = {
|
|
491
|
-
'tomtom-user-agent'?: string;
|
|
492
|
-
Authorization?: string;
|
|
493
|
-
};
|
|
494
482
|
/**
|
|
495
483
|
* Service-specific TomTom API headers, declared per-request by a service's
|
|
496
484
|
* request builder (not added globally). Widen this type when a new service
|
|
@@ -4477,6 +4465,34 @@ export declare const inputSectionTypesWithGuidance: SectionType[];
|
|
|
4477
4465
|
*/
|
|
4478
4466
|
export declare const sectionTypes: SectionType[];
|
|
4479
4467
|
//#endregion
|
|
4468
|
+
//#region src/types/sdkErrorCode.d.ts
|
|
4469
|
+
/**
|
|
4470
|
+
* Every value an SDK error's `code` takes: services' `SDKError` and the map's `TomTomMapError` share them.
|
|
4471
|
+
* @group Errors
|
|
4472
|
+
*/
|
|
4473
|
+
export declare const sdkErrorCodes: readonly ["INVALID_REQUEST", "INSECURE_BASE_URL", "API_KEY_REJECTED", "NOT_FOUND", "RATE_LIMITED", "SERVICE_UNAVAILABLE", "NETWORK_ERROR", "ABORTED", "WEBGL_UNSUPPORTED", "WEBGL_CONTEXT_LOST", "STYLE_LOAD_FAILED", "UNEXPECTED"];
|
|
4474
|
+
/**
|
|
4475
|
+
* What went wrong, as an SDK error names it in its `code`.
|
|
4476
|
+
*
|
|
4477
|
+
* | Code | When |
|
|
4478
|
+
* | --- | --- |
|
|
4479
|
+
* | `INVALID_REQUEST` | The SDK's request validation failed, or the API answered `400` or another `4xx` not below |
|
|
4480
|
+
* | `INSECURE_BASE_URL` | `commonBaseURL` is not `https:`, and not a loopback address either |
|
|
4481
|
+
* | `API_KEY_REJECTED` | The API answered `401` or `403`: the key is missing, invalid, expired, or not enabled for that API |
|
|
4482
|
+
* | `NOT_FOUND` | The API answered `404` |
|
|
4483
|
+
* | `RATE_LIMITED` | The API answered `429`, still after the retries `retry` allows |
|
|
4484
|
+
* | `SERVICE_UNAVAILABLE` | The API answered a `5xx` |
|
|
4485
|
+
* | `NETWORK_ERROR` | No response arrived: offline, DNS, TLS or CORS failure |
|
|
4486
|
+
* | `ABORTED` | The call's `signal` was aborted |
|
|
4487
|
+
* | `WEBGL_UNSUPPORTED` | The browser cannot create the WebGL2 context the map draws with |
|
|
4488
|
+
* | `WEBGL_CONTEXT_LOST` | The browser took the map's WebGL context away, for example after a GPU reset |
|
|
4489
|
+
* | `STYLE_LOAD_FAILED` | The map style failed to load, and not because of an HTTP status above |
|
|
4490
|
+
* | `UNEXPECTED` | Anything else |
|
|
4491
|
+
*
|
|
4492
|
+
* @group Errors
|
|
4493
|
+
*/
|
|
4494
|
+
export type SDKErrorCode = (typeof sdkErrorCodes)[number];
|
|
4495
|
+
//#endregion
|
|
4480
4496
|
//#region src/types/traffic/areaAnalytics.d.ts
|
|
4481
4497
|
/**
|
|
4482
4498
|
* Min/max value range for a single traffic metric across all tiles.
|
|
@@ -4741,7 +4757,7 @@ export type AreaAnalyticsFeature = Omit<Feature<Polygon, AreaAnalyticsFeaturePro
|
|
|
4741
4757
|
/**
|
|
4742
4758
|
* Metadata for the area analytics result collection.
|
|
4743
4759
|
*
|
|
4744
|
-
* @group Traffic
|
|
4760
|
+
* @group Traffic
|
|
4745
4761
|
*/
|
|
4746
4762
|
export type AreaAnalyticsCollectionProperties = {
|
|
4747
4763
|
/**
|
|
@@ -4780,17 +4796,13 @@ export type AreaAnalyticsCollectionProperties = {
|
|
|
4780
4796
|
* ```typescript
|
|
4781
4797
|
* const result = await trafficAreaAnalytics({
|
|
4782
4798
|
* startDate: new Date('2024-08-06'),
|
|
4783
|
-
* endDate: new Date('2024-08-
|
|
4784
|
-
*
|
|
4799
|
+
* endDate: new Date('2024-08-07'),
|
|
4800
|
+
* functionalRoadClasses: ['MOTORWAY', 'MAJOR_ROAD', 'OTHER_MAJOR_ROAD', 'SECONDARY_ROAD'],
|
|
4785
4801
|
* hours: [7, 8, 9],
|
|
4786
4802
|
* metrics: ['speed', 'congestionLevel'],
|
|
4787
|
-
*
|
|
4788
|
-
* type: '
|
|
4789
|
-
*
|
|
4790
|
-
* type: 'Polygon',
|
|
4791
|
-
* coordinates: [[[4.89, 52.37], [4.91, 52.37], [4.91, 52.39], [4.89, 52.39], [4.89, 52.37]]]
|
|
4792
|
-
* },
|
|
4793
|
-
* properties: {}
|
|
4803
|
+
* geometry: {
|
|
4804
|
+
* type: 'Polygon',
|
|
4805
|
+
* coordinates: [[[4.89, 52.37], [4.91, 52.37], [4.91, 52.39], [4.89, 52.39], [4.89, 52.37]]]
|
|
4794
4806
|
* }
|
|
4795
4807
|
* });
|
|
4796
4808
|
*
|
|
@@ -4815,45 +4827,17 @@ export type TrafficAreaAnalytics = {
|
|
|
4815
4827
|
//#endregion
|
|
4816
4828
|
//#region src/util/bbox.d.ts
|
|
4817
4829
|
/**
|
|
4818
|
-
*
|
|
4819
|
-
* @ignore
|
|
4820
|
-
* @param bbox The BBox to verify. If undefined, false is returned.
|
|
4830
|
+
* Whether the bounding box has both a width and a height: `false` for a single point, a line, or `undefined`.
|
|
4821
4831
|
*/
|
|
4822
4832
|
export declare const isBBoxWithArea: (bbox: OptionalBBox) => boolean;
|
|
4823
4833
|
/**
|
|
4824
|
-
*
|
|
4825
|
-
* @ignore
|
|
4826
|
-
* @param bbox The BBox to verify. If undefined, undefined is returned.
|
|
4827
|
-
*/
|
|
4828
|
-
export declare const bboxOnlyIfWithArea: (bbox: OptionalBBox) => OptionalBBox;
|
|
4829
|
-
/**
|
|
4830
|
-
* Expands the given bounding box with the given position.
|
|
4831
|
-
* * If the given bounding box is undefined, the given position is considered alone.
|
|
4832
|
-
* This results in a zero-sized bounding box.
|
|
4833
|
-
* @ignore
|
|
4834
|
-
* @param positionToContain
|
|
4835
|
-
* @param bboxToExpand
|
|
4836
|
-
*/
|
|
4837
|
-
export declare const bboxExpandedWithPosition: (positionToContain: Position, bboxToExpand?: BBox) => OptionalBBox;
|
|
4838
|
-
/**
|
|
4839
|
-
* @ignore
|
|
4840
|
-
* @param bboxToContain
|
|
4841
|
-
* @param bboxToExpand
|
|
4842
|
-
*/
|
|
4843
|
-
export declare const bboxExpandedWithBBox: (bboxToContain: OptionalBBox, bboxToExpand?: BBox) => OptionalBBox;
|
|
4844
|
-
/**
|
|
4845
|
-
* Calculates the bounding box which contains all the given bounding boxes.
|
|
4846
|
-
* @ignore
|
|
4847
|
-
* @param bboxes
|
|
4834
|
+
* The bounding box that contains all the given ones, skipping `undefined` entries.
|
|
4848
4835
|
*/
|
|
4849
4836
|
export declare const bboxFromBBoxes: (bboxes: OptionalBBox[]) => OptionalBBox;
|
|
4850
4837
|
/**
|
|
4851
|
-
*
|
|
4852
|
-
* * If the array is beyond a certain size, it doesn't scan it fully,
|
|
4853
|
-
* for performance, but still ensures a decent accuracy.
|
|
4838
|
+
* The bounding box of an array of `[longitude, latitude]` positions, `undefined` for none.
|
|
4854
4839
|
*
|
|
4855
|
-
*
|
|
4856
|
-
* @param coordinates Should always be passed, but undefined is also supported, resulting in undefined bbox.
|
|
4840
|
+
* A very long array is sampled rather than scanned in full, which keeps the box close to exact.
|
|
4857
4841
|
*/
|
|
4858
4842
|
export declare const bboxFromCoordsArray: (coordinates: Position[] | undefined) => OptionalBBox;
|
|
4859
4843
|
/**
|
|
@@ -4876,7 +4860,7 @@ export declare const bboxFromCoordsArray: (coordinates: Position[] | undefined)
|
|
|
4876
4860
|
* @example
|
|
4877
4861
|
* ```typescript
|
|
4878
4862
|
* // From a Feature with existing bbox
|
|
4879
|
-
* const place = await
|
|
4863
|
+
* const place = await geocodeOne('Amsterdam');
|
|
4880
4864
|
* const bbox = bboxFromGeoJSON(place);
|
|
4881
4865
|
* // Returns the bbox that came with the place
|
|
4882
4866
|
*
|
|
@@ -4895,13 +4879,12 @@ export declare const bboxFromCoordsArray: (coordinates: Position[] | undefined)
|
|
|
4895
4879
|
* // Returns: [4.88, 52.36, 4.90, 52.38]
|
|
4896
4880
|
*
|
|
4897
4881
|
* // From a FeatureCollection (aggregates all features)
|
|
4898
|
-
* const places = await discoverPlaces({
|
|
4882
|
+
* const places = await discoverPlaces({ query: 'coffee' });
|
|
4899
4883
|
* const collectionBbox = bboxFromGeoJSON(places);
|
|
4900
4884
|
* // Returns bbox encompassing all search results
|
|
4901
4885
|
*
|
|
4902
4886
|
* // From a LineString (calculates from coordinates)
|
|
4903
4887
|
* const route = await calculateRoute({
|
|
4904
|
-
* key: 'key',
|
|
4905
4888
|
* locations: [[4.9, 52.3], [4.5, 51.9]]
|
|
4906
4889
|
* });
|
|
4907
4890
|
* const routeBbox = bboxFromGeoJSON(route.features[0].geometry);
|
|
@@ -4916,24 +4899,14 @@ export declare const bboxFromCoordsArray: (coordinates: Position[] | undefined)
|
|
|
4916
4899
|
*/
|
|
4917
4900
|
export declare const bboxFromGeoJSON: (hasBBox: HasBBox) => OptionalBBox;
|
|
4918
4901
|
/**
|
|
4919
|
-
*
|
|
4920
|
-
* * If the feature has also a bounding box, the latter is considered instead.
|
|
4921
|
-
* * If the given bounding box is undefined, the given point is considered alone.
|
|
4922
|
-
* This results in a zero-sized bounding box or the point bbox if it exists.
|
|
4923
|
-
* @ignore
|
|
4924
|
-
* @param geoJson
|
|
4925
|
-
* @param bboxToExpand
|
|
4902
|
+
* The `[longitude, latitude]` centre of a bounding box.
|
|
4926
4903
|
*/
|
|
4927
|
-
export declare const bboxExpandedWithGeoJSON: (geoJson: GeoJSON, bboxToExpand?: BBox) => OptionalBBox;
|
|
4928
|
-
/**
|
|
4929
|
-
* Calculate the center of bbox
|
|
4930
|
-
* @ignore
|
|
4931
|
-
* @param bbox
|
|
4932
|
-
* */
|
|
4933
4904
|
export declare const bboxCenter: (bbox: BBox) => Position;
|
|
4934
4905
|
/**
|
|
4935
4906
|
* Creates a GeoJSON Polygon Feature representing the area of the given bounding box.
|
|
4936
4907
|
* @param bbox The bounding box defined as [west, south, east, north]
|
|
4908
|
+
*
|
|
4909
|
+
* @group Utils
|
|
4937
4910
|
*/
|
|
4938
4911
|
export declare const polygonFromBBox: (bbox: BBox) => Feature<Polygon>;
|
|
4939
4912
|
//#endregion
|
|
@@ -4950,13 +4923,6 @@ export declare const generateId: () => string;
|
|
|
4950
4923
|
* @ignore
|
|
4951
4924
|
*/
|
|
4952
4925
|
export declare const TOMTOM_USER_AGENT_SDK_NAME = "MapsSDKJS";
|
|
4953
|
-
/**
|
|
4954
|
-
* Generates an object with TomTom custom header values for the given common parameters.
|
|
4955
|
-
*
|
|
4956
|
-
* @ignore
|
|
4957
|
-
* @param params Global SDK configuration
|
|
4958
|
-
*/
|
|
4959
|
-
export declare const generateTomTomHeaders: (params: Partial<GlobalConfig>) => TomTomHeaders;
|
|
4960
4926
|
//#endregion
|
|
4961
4927
|
//#region src/util/lngLat.d.ts
|
|
4962
4928
|
/**
|
|
@@ -5010,72 +4976,6 @@ export declare const generateTomTomHeaders: (params: Partial<GlobalConfig>) => T
|
|
|
5010
4976
|
* @group Utils
|
|
5011
4977
|
*/
|
|
5012
4978
|
export declare const getPosition: (hasLngLat: HasLngLat | undefined, options?: GetPositionOptions) => Position | null;
|
|
5013
|
-
/**
|
|
5014
|
-
* Extracts the lng-lat position from various input formats (strict version).
|
|
5015
|
-
*
|
|
5016
|
-
* Similar to {@link getPosition}, but throws an error if the input doesn't contain
|
|
5017
|
-
* a valid position. Use this when you expect the input to always be valid and want
|
|
5018
|
-
* to fail fast on invalid data.
|
|
5019
|
-
*
|
|
5020
|
-
* @param hasLngLat An object which either is or contains a lng-lat position.
|
|
5021
|
-
* @param options Additional options to control how we extract the position.
|
|
5022
|
-
* @returns The extracted position as `[longitude, latitude]`.
|
|
5023
|
-
* @throws Error if the input object is undefined or does not contain a lng-lat position.
|
|
5024
|
-
*
|
|
5025
|
-
* @example
|
|
5026
|
-
* ```typescript
|
|
5027
|
-
* // Valid input
|
|
5028
|
-
* getPositionStrict([4.9, 52.3]); // Returns: [4.9, 52.3]
|
|
5029
|
-
*
|
|
5030
|
-
* // Invalid input throws error
|
|
5031
|
-
* try {
|
|
5032
|
-
* getPositionStrict(undefined);
|
|
5033
|
-
* } catch (error) {
|
|
5034
|
-
* console.error(error);
|
|
5035
|
-
* // Error: The received object does not have lng-lat coordinates: undefined
|
|
5036
|
-
* }
|
|
5037
|
-
*
|
|
5038
|
-
* // Invalid object throws error
|
|
5039
|
-
* try {
|
|
5040
|
-
* getPositionStrict({ invalid: 'object' });
|
|
5041
|
-
* } catch (error) {
|
|
5042
|
-
* console.error(error);
|
|
5043
|
-
* // Error: The received object does not have lng-lat coordinates: {"invalid":"object"}
|
|
5044
|
-
* }
|
|
5045
|
-
* ```
|
|
5046
|
-
*
|
|
5047
|
-
* @ignore
|
|
5048
|
-
*/
|
|
5049
|
-
export declare const getPositionStrict: (hasLngLat: HasLngLat, options?: GetPositionOptions) => Position;
|
|
5050
|
-
/**
|
|
5051
|
-
* @ignore
|
|
5052
|
-
*/
|
|
5053
|
-
export declare const toPointGeometry: (coordinates: Position) => Point;
|
|
5054
|
-
/**
|
|
5055
|
-
* @ignore
|
|
5056
|
-
*/
|
|
5057
|
-
export declare const toPointFeature: (coordinates: Position) => Feature<Point>;
|
|
5058
|
-
//#endregion
|
|
5059
|
-
//#region src/util/poiCategoriesToID.d.ts
|
|
5060
|
-
/**
|
|
5061
|
-
* Primary mapping: POICategory names to all TomTom numeric IDs that represent them.
|
|
5062
|
-
* Each array is sorted smallest-first; poiCategoriesToID picks ids[0] as the canonical ID.
|
|
5063
|
-
*
|
|
5064
|
-
* @ignore
|
|
5065
|
-
*/
|
|
5066
|
-
export declare const poiCategoriesToIDs: Record<POICategory$1, number[]>;
|
|
5067
|
-
/**
|
|
5068
|
-
* Derived mapping: POICategory names to their primary numeric ID (first/smallest in the array).
|
|
5069
|
-
*
|
|
5070
|
-
* @ignore
|
|
5071
|
-
*/
|
|
5072
|
-
export declare const poiCategoriesToID: Record<POICategory$1, number>;
|
|
5073
|
-
/**
|
|
5074
|
-
* Derived mapping: all TomTom POI category numeric IDs to their POICategory name.
|
|
5075
|
-
*
|
|
5076
|
-
* @ignore
|
|
5077
|
-
*/
|
|
5078
|
-
export declare const poiIDsToCategories: Record<number, POICategory$1>;
|
|
5079
4979
|
//#endregion
|
|
5080
4980
|
//#region src/util/route.d.ts
|
|
5081
4981
|
/**
|
|
@@ -5314,7 +5214,7 @@ export declare const getRouteProgressBetween: (route: Route, startPathIndex: num
|
|
|
5314
5214
|
*
|
|
5315
5215
|
* @example
|
|
5316
5216
|
* ```typescript
|
|
5317
|
-
* const section = route.properties.sections.
|
|
5217
|
+
* const section = route.properties.sections.country[0];
|
|
5318
5218
|
* const result = getRouteProgressForSection(route, section);
|
|
5319
5219
|
* if (result) {
|
|
5320
5220
|
* console.log(`Section starts ${result.start.distanceInMeters} m from route origin`);
|
|
@@ -5346,7 +5246,7 @@ export declare const getRouteProgressForSection: (route: Route, section: Section
|
|
|
5346
5246
|
*
|
|
5347
5247
|
* @example
|
|
5348
5248
|
* ```typescript
|
|
5349
|
-
* const section = route.properties.sections.
|
|
5249
|
+
* const section = route.properties.sections.country[0];
|
|
5350
5250
|
* // section = { id: 'section-1', startPointIndex: 0, endPointIndex: 3, countryCodeISO3: 'NLD' }
|
|
5351
5251
|
*
|
|
5352
5252
|
* const bbox = getSectionBBox(route, section);
|
|
@@ -5391,7 +5291,7 @@ export type RouteProgressQuery = {
|
|
|
5391
5291
|
* @param query A discriminated union — provide exactly one of:
|
|
5392
5292
|
* - `{ traveledTimeInSeconds }` — elapsed seconds from route start
|
|
5393
5293
|
* - `{ traveledDistanceInMeters }` — meters traveled from route start
|
|
5394
|
-
* - `{ clockTime }` — absolute `Date`; elapsed seconds are derived from `route.summary.departureTime`
|
|
5294
|
+
* - `{ clockTime }` — absolute `Date`; elapsed seconds are derived from `route.properties.summary.departureTime`
|
|
5395
5295
|
* @returns Interpolated {@link RouteCoordinateAtProgress}, or `undefined` when:
|
|
5396
5296
|
* - the route has no `progress` data
|
|
5397
5297
|
* - `clockTime` is before the route departure time
|
|
@@ -5440,46 +5340,12 @@ export declare const getCoordinateAtRouteProgress: (route: Route, query: RoutePr
|
|
|
5440
5340
|
*/
|
|
5441
5341
|
export declare const getProgressAtNearestRoutePoint: (route: Route, point: HasLngLat) => RouteCoordinateAtProgress | undefined;
|
|
5442
5342
|
//#endregion
|
|
5443
|
-
//#region src/util/routePlanningLocations.d.ts
|
|
5444
|
-
/**
|
|
5445
|
-
* Determines the type of geographic input (waypoint or path).
|
|
5446
|
-
*
|
|
5447
|
-
* This function inspects the structure of a RoutePlanningLocation to classify it as either:
|
|
5448
|
-
* - **waypoint**: A single point location (coordinate pair, Point geometry, or Point Feature)
|
|
5449
|
-
* - **path**: A line or route (array of coordinates, LineString geometry, or LineString Feature)
|
|
5450
|
-
*
|
|
5451
|
-
* @param routePlanningLocation The geographic input to classify. Can be coordinates, GeoJSON geometry, or GeoJSON Feature.
|
|
5452
|
-
* @returns The type of the input: 'waypoint' for point locations or 'path' for line geometries.
|
|
5453
|
-
*
|
|
5454
|
-
* @ignore
|
|
5455
|
-
*/
|
|
5456
|
-
export declare const getRoutePlanningLocationType: (routePlanningLocation: RoutePlanningLocation) => RoutePlanningLocationType;
|
|
5457
|
-
//#endregion
|
|
5458
5343
|
//#region src/util/traffic.d.ts
|
|
5459
5344
|
/**
|
|
5460
|
-
* @
|
|
5345
|
+
* Every {@link DelayMagnitude}, each at the index the Traffic API's `magnitudeOfDelay` code gives it.
|
|
5346
|
+
* @group Traffic
|
|
5461
5347
|
*/
|
|
5462
5348
|
export declare const indexedMagnitudes: DelayMagnitude[];
|
|
5463
|
-
/**
|
|
5464
|
-
* Maps an `iconCategory` integer from the traffic vector tiles to a {@link TrafficIncidentCategory}.
|
|
5465
|
-
* Integer values that do not correspond to a known category are mapped to `'other'`.
|
|
5466
|
-
*
|
|
5467
|
-
* @param iconCategory - Integer category code from the tile
|
|
5468
|
-
* @returns The corresponding {@link TrafficIncidentCategory}
|
|
5469
|
-
*
|
|
5470
|
-
* @ignore
|
|
5471
|
-
*/
|
|
5472
|
-
export declare const iconToTrafficIncidentCategory: (iconCategory: number) => TrafficIncidentCategory;
|
|
5473
|
-
/**
|
|
5474
|
-
* Maps a {@link TrafficIncidentCategory} string to the `iconCategory` integer used by the traffic vector tiles.
|
|
5475
|
-
* `'other'` and any unrecognised values map to `0`.
|
|
5476
|
-
*
|
|
5477
|
-
* @param category - The string category
|
|
5478
|
-
* @returns The corresponding integer icon category code
|
|
5479
|
-
*
|
|
5480
|
-
* @ignore
|
|
5481
|
-
*/
|
|
5482
|
-
export declare const trafficIncidentToIconCategory: (category: TrafficIncidentCategory) => number;
|
|
5483
5349
|
//#endregion
|
|
5484
5350
|
//#region src/util/unitFormatters.d.ts
|
|
5485
5351
|
/**
|
|
@@ -5577,12 +5443,6 @@ export declare const formatDuration: (seconds: number | undefined, options?: Tim
|
|
|
5577
5443
|
* @group Utils
|
|
5578
5444
|
*/
|
|
5579
5445
|
export type DistanceUnitsType = 'metric' | 'imperial_us' | 'imperial_uk';
|
|
5580
|
-
/**
|
|
5581
|
-
* Metres in one international mile — the factor behind every metric-to-imperial conversion in the SDK.
|
|
5582
|
-
*
|
|
5583
|
-
* @ignore
|
|
5584
|
-
*/
|
|
5585
|
-
export declare const MILE_IN_METERS = 1609.344;
|
|
5586
5446
|
/**
|
|
5587
5447
|
* Formatting is based on the number of meters passed and unit type. Less meters more precision.
|
|
5588
5448
|
* @example
|
|
@@ -5719,7 +5579,7 @@ export type DisplayUnits = {
|
|
|
5719
5579
|
* retry: {
|
|
5720
5580
|
* initialWaitMs: 0.447,
|
|
5721
5581
|
* backoffFactor: 1.618,
|
|
5722
|
-
* timeoutMs:
|
|
5582
|
+
* timeoutMs: 40000,
|
|
5723
5583
|
* }
|
|
5724
5584
|
* });
|
|
5725
5585
|
* ```
|
|
@@ -5750,7 +5610,7 @@ export type RetryConfig = {
|
|
|
5750
5610
|
* If the next retry wait would exceed this timeout (measured from the
|
|
5751
5611
|
* first request), the SDK returns the 429 error to the caller.
|
|
5752
5612
|
*
|
|
5753
|
-
* @default
|
|
5613
|
+
* @default 40000
|
|
5754
5614
|
*/
|
|
5755
5615
|
timeoutMs?: number;
|
|
5756
5616
|
};
|
|
@@ -5800,7 +5660,7 @@ export type GlobalConfig = {
|
|
|
5800
5660
|
* Accepts IETF language codes (case-insensitive). Affects search results,
|
|
5801
5661
|
* routing instructions, and map labels.
|
|
5802
5662
|
*
|
|
5803
|
-
* @default "
|
|
5663
|
+
* @default "ngt" (Neutral Ground Truth - uses local language for each location)
|
|
5804
5664
|
*
|
|
5805
5665
|
* @see {@link https://docs.tomtom.com/search-api/documentation/product-information/supported-languages | Search supported languages}
|
|
5806
5666
|
* @see {@link https://docs.tomtom.com/routing-api/documentation/product-information/supported-languages | Routing supported languages}
|
|
@@ -5823,10 +5683,23 @@ export type GlobalConfig = {
|
|
|
5823
5683
|
* switches the SDK to proxy-credentials mode, where no key leaves the browser and requests carry the proxy's
|
|
5824
5684
|
* session cookie.
|
|
5825
5685
|
*
|
|
5686
|
+
* It must be `https:`, or relative to the page; `http:` is accepted only for a loopback address (`localhost`,
|
|
5687
|
+
* `127.0.0.0/8`, `[::1]`). Otherwise service calls reject, and the map constructor throws, with code `INSECURE_BASE_URL`.
|
|
5688
|
+
*
|
|
5826
5689
|
* @default "https://api.tomtom.com"
|
|
5827
5690
|
* @see [Proxying your API calls](https://docs.tomtom.com/maps-sdk-js/guides/security/proxying-api-calls)
|
|
5828
5691
|
*/
|
|
5829
5692
|
commonBaseURL: string;
|
|
5693
|
+
/**
|
|
5694
|
+
* Whether requests to TomTom carry the `tomtom-user-agent` header, naming the SDK and its version.
|
|
5695
|
+
*
|
|
5696
|
+
* TomTom reads it to tell which SDK versions are in use. Turn it off when that header must not
|
|
5697
|
+
* leave the page, or when a proxy of yours should not have to allow it in its CORS preflight answer.
|
|
5698
|
+
*
|
|
5699
|
+
* @default true
|
|
5700
|
+
* @see [What the SDK sends](https://docs.tomtom.com/maps-sdk-js/guides/security/what-the-sdk-sends)
|
|
5701
|
+
*/
|
|
5702
|
+
sendUserAgentHeader?: boolean;
|
|
5830
5703
|
/**
|
|
5831
5704
|
* Custom display units for time and distance.
|
|
5832
5705
|
*
|
|
@@ -5839,7 +5712,7 @@ export type GlobalConfig = {
|
|
|
5839
5712
|
* Configuration for automatic retry on rate-limited (429) responses.
|
|
5840
5713
|
*
|
|
5841
5714
|
* When set, the SDK automatically retries requests that receive a 429 status code
|
|
5842
|
-
* using exponential backoff.
|
|
5715
|
+
* using exponential backoff. A field left out takes its default; `undefined` disables retrying.
|
|
5843
5716
|
*
|
|
5844
5717
|
* @see {@link RetryConfig}
|
|
5845
5718
|
*/
|
|
@@ -5898,8 +5771,8 @@ export declare class TomTomConfig {
|
|
|
5898
5771
|
/**
|
|
5899
5772
|
* Merge configuration values into the global configuration.
|
|
5900
5773
|
*
|
|
5901
|
-
* New values override existing ones. This performs a shallow merge,
|
|
5902
|
-
*
|
|
5774
|
+
* New values override existing ones. This performs a shallow merge, so nested objects are replaced
|
|
5775
|
+
* entirely, except that a `retry` object takes its missing fields from the default retry config.
|
|
5903
5776
|
*
|
|
5904
5777
|
* @param config - Partial configuration to merge
|
|
5905
5778
|
*
|
|
@@ -5937,11 +5810,6 @@ export declare class TomTomConfig {
|
|
|
5937
5810
|
*/
|
|
5938
5811
|
get(): GlobalConfig;
|
|
5939
5812
|
}
|
|
5940
|
-
/**
|
|
5941
|
-
* Merges the global configuration into the given one, with the latter having priority.
|
|
5942
|
-
* @ignore
|
|
5943
|
-
*/
|
|
5944
|
-
export declare const mergeFromGlobal: <T extends Partial<GlobalConfig>>(givenConfig?: T) => GlobalConfig & T;
|
|
5945
5813
|
/**
|
|
5946
5814
|
* Whether the SDK is configured for a credentials proxy such as the demos proxy
|
|
5947
5815
|
* — no `apiKey` (the
|
|
@@ -5966,4 +5834,4 @@ export declare const mergeFromGlobal: <T extends Partial<GlobalConfig>>(givenCon
|
|
|
5966
5834
|
*/
|
|
5967
5835
|
export declare const isProxyCredentialsMode: (config?: Partial<Pick<GlobalConfig, "apiKey" | "commonBaseURL">>) => boolean;
|
|
5968
5836
|
//#endregion
|
|
5969
|
-
export type { Anything, BBox, ChargingAvailabilityDataSource, ChargingPark, ChargingParkWithAvailability, ChargingPointAvailability, ChargingStationsAvailability, CombustionSummary, ConnectorAvailability, ConnectorCount, DrivingSide, EVChargingStationWithAvailabilityPlaceProps, ElectricSummary, FeatureCollectionWithProperties, Fuel, GeometryDataSource, GetPositionEntryPointOption, GetPositionOptions, Guidance, HasBBox, HasConnector, HasCount, HasLngLat, Instruction, InstructionText, Landmark, Language, LegSummary, Maneuver, ManeuverAngle, ManeuverView, Moment, OpeningHours, OpeningHoursMode, OptionalBBox, POI, PathLike, PlaceDataSources, PoiDetailsDataSource, PolygonFeature, PolygonFeatures, RelatedPOI, RoadInformation, RoadInformationProperty, RoadShield, RoadShieldReference, RoundaboutType, RoutePathPoint, RoutePlanningLocation, RoutePlanningLocationType, RouteSummary, SideRoad, SideRoadSide, Signpost, SummaryBase, SummaryWithConsumption, TimeRange, TimeZone, TollPaymentType, TomTomAPIHeaders,
|
|
5837
|
+
export type { Anything, BBox, ChargingAvailabilityDataSource, ChargingPark, ChargingParkWithAvailability, ChargingPointAvailability, ChargingStationsAvailability, CombustionSummary, ConnectorAvailability, ConnectorCount, DrivingSide, EVChargingStationWithAvailabilityPlaceProps, ElectricSummary, FeatureCollectionWithProperties, Fuel, GeometryDataSource, GetPositionEntryPointOption, GetPositionOptions, Guidance, HasBBox, HasConnector, HasCount, HasLngLat, Instruction, InstructionText, Landmark, Language, LegSummary, Maneuver, ManeuverAngle, ManeuverView, Moment, OpeningHours, OpeningHoursMode, OptionalBBox, POI, PathLike, PlaceDataSources, PoiDetailsDataSource, PolygonFeature, PolygonFeatures, RelatedPOI, RoadInformation, RoadInformationProperty, RoadShield, RoadShieldReference, RoundaboutType, RoutePathPoint, RoutePlanningLocation, RoutePlanningLocationType, RouteSummary, SideRoad, SideRoadSide, Signpost, SummaryBase, SummaryWithConsumption, TimeRange, TimeZone, TollPaymentType, TomTomAPIHeaders, Waypoint, WaypointLike, WaypointProps, Waypoints, languages };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maplibre-gl-worker.js","names":["MapLibreWorker","Reflect","has","self","set"],"sources":["../../src/init/mapLibreWorkerEntry.ts"],"sourcesContent":["import MapLibreWorker from 'maplibre-gl/dist/maplibre-gl-worker.mjs';\n\n// maplibre-gl declares its dist side-effect free, so a bundler keeps this module only for an import it uses,\n// and may then drop the module's own start (`self.worker = new Worker(self)`).\nif (!Reflect.has(self, 'worker')) {\n Reflect.set(self, 'worker', new MapLibreWorker(self));\n}\n"],"mappings":"oEAIKC,QAAQC,IAAIC,KAAM,WACnBF,QAAQG,IAAID,KAAM,SAAU,IAAIH,eAAeG"}
|