@tomtom-org/maps-sdk 1.0.0-rc.4 → 1.0.0-rc.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.
- package/CHANGELOG.md +112 -0
- package/README.md +4 -4
- package/core/dist/core.es.js +1 -1
- package/core/dist/index.d.ts +774 -981
- package/map/dist/index.d.ts +1115 -569
- package/map/dist/map.es.js +5 -3
- package/package.json +2 -1
- package/services/dist/index.d.ts +128 -210
- package/services/dist/services.es.js +1 -1
package/services/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddressProperties, AreaAnalyticsMetricKey, Avoidable, BBox, ChargingPoint, ChargingStation, CommonPlaceProps, Connector, ConnectorType, CurveDetectionOptions, EntryPoint, Fuel, GeographyType, GeopoliticalView, GetPositionEntryPointOption, GlobalConfig, HasBBox, HasLngLat, MapcodeType, OpeningHours, OpeningHoursMode, POICategory, Place, PlaceDataSources, PlaceType, Places, PolygonFeature, PolygonFeatures, ReachableRangeBudget, RevGeoAddressProps, RoadShieldReference,
|
|
1
|
+
import { APIErrorDetails, AddressProperties, AreaAnalyticsMetricKey, Avoidable, BBox, ChargingPoint, ChargingStation, CommonPlaceProps, Connector, ConnectorType, CurveDetectionOptions, EntryPoint, Fuel, GeographyType, GeopoliticalView, GetPositionEntryPointOption, GlobalConfig, HasBBox, HasLngLat, MapcodeType, OpeningHours, OpeningHoursMode, POICategory, PathLike, Place, PlaceDataSources, PlaceType, Places, PolygonFeature, PolygonFeatures, PrivatePreviewAccess, ReachableRangeBudget, RevGeoAddressProps, RoadShieldReference, RoutePlanningLocation, Routes, SDKErrorCode, SearchPlaceProps, TimeZone, TomTomAPIHeaders, TrafficAreaAnalytics, TrafficIncidentDetails, TrafficIncidentRequestCategory, TrafficIncidentTEC, TrafficIncidentTimeValidity, TravelMode, inputSectionTypesWithGuidance } from "@tomtom-org/maps-sdk/core";
|
|
2
2
|
import { core } from "zod";
|
|
3
3
|
//#region src/along-route-search/types/alongRoutePlaceProps.d.ts
|
|
4
4
|
/**
|
|
@@ -210,9 +210,7 @@ interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonPro
|
|
|
210
210
|
/**
|
|
211
211
|
* @ignore
|
|
212
212
|
*/
|
|
213
|
-
|
|
214
|
-
TOO_MANY_REQUESTS = 429
|
|
215
|
-
}
|
|
213
|
+
type APICode = 429;
|
|
216
214
|
//#endregion
|
|
217
215
|
//#region src/shared/types/fetch.d.ts
|
|
218
216
|
/**
|
|
@@ -244,23 +242,6 @@ type FetchInput<PostData = void> = ({
|
|
|
244
242
|
method: 'POST';
|
|
245
243
|
} & PostObject<PostData>);
|
|
246
244
|
//#endregion
|
|
247
|
-
//#region src/shared/types/privatePreviewAccess.d.ts
|
|
248
|
-
/**
|
|
249
|
-
* The access a Private Preview API needs on the API key, and where to request it.
|
|
250
|
-
*
|
|
251
|
-
* @group Errors
|
|
252
|
-
*/
|
|
253
|
-
export type PrivatePreviewAccess = {
|
|
254
|
-
/**
|
|
255
|
-
* The API the key needs access to, as TomTom Sales names it, such as `'Calculate Reachable Range'`.
|
|
256
|
-
*/
|
|
257
|
-
product: string;
|
|
258
|
-
/**
|
|
259
|
-
* Where to request that access.
|
|
260
|
-
*/
|
|
261
|
-
requestAccessURL: string;
|
|
262
|
-
};
|
|
263
|
-
//#endregion
|
|
264
245
|
//#region src/shared/types/servicesTypes.d.ts
|
|
265
246
|
/**
|
|
266
247
|
* The name of a service the SDK calls, as an {@link SDKError}'s `service` reports it.
|
|
@@ -294,7 +275,8 @@ type CommonServiceParams<ApiRequest = any, ApiResponse = any> = Partial<Omit<Glo
|
|
|
294
275
|
* Whether the SDK validates the request parameters against the expected schema before sending them.
|
|
295
276
|
*
|
|
296
277
|
* @remarks
|
|
297
|
-
* Validation also rejects a parameter the service doesn't know, and names it.
|
|
278
|
+
* Validation also rejects a parameter the service doesn't know, and names it. Only top-level names
|
|
279
|
+
* are checked: an unknown key inside an object parameter, such as `filters`, goes unreported. To skip validation,
|
|
298
280
|
* set it to `false`, which then drops an unknown parameter silently. The `commonBaseURL` check
|
|
299
281
|
* (`INSECURE_BASE_URL`) runs either way.
|
|
300
282
|
*
|
|
@@ -306,9 +288,6 @@ type CommonServiceParams<ApiRequest = any, ApiResponse = any> = Partial<Omit<Glo
|
|
|
306
288
|
*
|
|
307
289
|
* @ignore
|
|
308
290
|
*
|
|
309
|
-
* @remarks
|
|
310
|
-
* Useful for tracking, logging, or debugging API requests before they are sent to the server.
|
|
311
|
-
*
|
|
312
291
|
* @param apiRequest - The API request to be sent (usually a URL for GET requests or URL with body for POST requests)
|
|
313
292
|
*/
|
|
314
293
|
onAPIRequest?: (apiRequest: ApiRequest) => void;
|
|
@@ -320,7 +299,6 @@ type CommonServiceParams<ApiRequest = any, ApiResponse = any> = Partial<Omit<Glo
|
|
|
320
299
|
* @remarks
|
|
321
300
|
* Called as soon as the API response is received, before parsing.
|
|
322
301
|
* The request object is the same reference as provided to {@link onAPIRequest}.
|
|
323
|
-
* Useful for tracking, logging, or debugging API request-response pairs.
|
|
324
302
|
*
|
|
325
303
|
* A failed request calls it too, with the error the request threw in place of the body, such as
|
|
326
304
|
* one carrying the HTTP `status`. Check the argument before reading it as a body.
|
|
@@ -359,8 +337,8 @@ type CommonServiceParams<ApiRequest = any, ApiResponse = any> = Partial<Omit<Glo
|
|
|
359
337
|
* The SDK handles two distinct categories of errors:
|
|
360
338
|
* 1. Programming errors are configuration or usage errors in your application,
|
|
361
339
|
* such as passing incorrect types to parameters or functions.
|
|
362
|
-
* 2. API errors
|
|
363
|
-
*
|
|
340
|
+
* 2. API errors occur during SDK operations, such as network failures or invalid API responses.
|
|
341
|
+
* `code` says which, and `canRetry` whether the same call is likely to succeed later.
|
|
364
342
|
*
|
|
365
343
|
* A service call rejects with one, even for a request it cannot build at all, such as one with a geometry type
|
|
366
344
|
* that geometry search does not support sent with `validateRequest: false`. That one is an `INVALID_REQUEST`.
|
|
@@ -432,7 +410,7 @@ export declare const APIErrorCode: { readonly [K in APICode as number]: string;
|
|
|
432
410
|
*
|
|
433
411
|
* @group Errors
|
|
434
412
|
*/
|
|
435
|
-
export declare class SDKServiceError extends SDKError {
|
|
413
|
+
export declare class SDKServiceError extends SDKError implements APIErrorDetails {
|
|
436
414
|
/**
|
|
437
415
|
* HTTP status code of the failed API request.
|
|
438
416
|
*
|
|
@@ -444,17 +422,7 @@ export declare class SDKServiceError extends SDKError {
|
|
|
444
422
|
* - `500`: Internal Server Error
|
|
445
423
|
*/
|
|
446
424
|
readonly status?: number;
|
|
447
|
-
/**
|
|
448
|
-
* The API's own name for the error, from its `detailedError.code`, when its response carries one.
|
|
449
|
-
*
|
|
450
|
-
* On an `INSUFFICIENT_PERMISSIONS` it tells the causes apart: `'Forbidden'` when the API is not enabled for
|
|
451
|
-
* the key, `'InvalidReferer'` when the key's domain restriction refused the page.
|
|
452
|
-
*/
|
|
453
425
|
readonly apiErrorCode?: string;
|
|
454
|
-
/**
|
|
455
|
-
* The access the API key lacks, on an `INSUFFICIENT_PERMISSIONS` from a Private Preview API that did not
|
|
456
|
-
* name another cause. The message names it too.
|
|
457
|
-
*/
|
|
458
426
|
readonly privatePreviewAccess?: PrivatePreviewAccess;
|
|
459
427
|
/**
|
|
460
428
|
* Creates a new SDKServiceError instance.
|
|
@@ -466,10 +434,7 @@ export declare class SDKServiceError extends SDKError {
|
|
|
466
434
|
* @param service - Name of the service that generated the error.
|
|
467
435
|
* @param status - HTTP status code of the failed request.
|
|
468
436
|
*/
|
|
469
|
-
constructor(message: string, service: ServiceName, status?: number, options?:
|
|
470
|
-
apiErrorCode?: string;
|
|
471
|
-
privatePreviewAccess?: PrivatePreviewAccess;
|
|
472
|
-
});
|
|
437
|
+
constructor(message: string, service: ServiceName, status?: number, options?: APIErrorDetails);
|
|
473
438
|
}
|
|
474
439
|
/**
|
|
475
440
|
* Error class for cancelled service calls.
|
|
@@ -664,7 +629,7 @@ export type BoundingBoxGeoBias = {
|
|
|
664
629
|
* const within2km: GeoBias = { position: [4.9, 52.3], radiusMeters: 2000 };
|
|
665
630
|
*
|
|
666
631
|
* // Inside the visible map area
|
|
667
|
-
* const inViewport: GeoBias = { boundingBox: map.
|
|
632
|
+
* const inViewport: GeoBias = { boundingBox: map.getBBox() };
|
|
668
633
|
* ```
|
|
669
634
|
*
|
|
670
635
|
* @group Places Search
|
|
@@ -691,43 +656,32 @@ export type GeoBias = (PointGeoBias & {
|
|
|
691
656
|
* - `XStr`: Cross Streets - Intersections of two streets
|
|
692
657
|
* - `POI`: Points of Interest (businesses, landmarks, facilities)
|
|
693
658
|
*
|
|
694
|
-
* By default, `extendedPostalCodesFor` includes extended postal codes for all indexes except `Geo`.
|
|
695
|
-
* Use this type to request them explicitly for specific indexes.
|
|
696
|
-
*
|
|
697
|
-
* @example
|
|
698
|
-
* ```typescript
|
|
699
|
-
* // Request extended postal codes for addresses and POIs
|
|
700
|
-
* const indexes: SearchIndexType[] = ['PAD', 'Addr', 'POI'];
|
|
701
|
-
* ```
|
|
702
|
-
*
|
|
703
659
|
* @group Places Search
|
|
704
660
|
*/
|
|
705
661
|
export type SearchIndexType = 'Geo' | 'PAD' | 'Addr' | 'Str' | 'XStr' | 'POI';
|
|
706
662
|
/**
|
|
707
663
|
* The parameters the places services share.
|
|
708
664
|
*
|
|
709
|
-
* Search
|
|
665
|
+
* Search and geocoding use them to customise query behaviour, filter results,
|
|
710
666
|
* and control response formatting.
|
|
711
667
|
*
|
|
712
|
-
* @typeParam ApiRequest - The API request type (
|
|
668
|
+
* @typeParam ApiRequest - The API request type (`GetObject` or `PostObject`)
|
|
713
669
|
* @typeParam ApiResponse - The API response type
|
|
714
670
|
*
|
|
715
671
|
* @remarks
|
|
716
672
|
* They apply to:
|
|
717
673
|
* - {@link discoverPlaces}
|
|
718
674
|
* - {@link geocode}
|
|
719
|
-
* - {@link reverseGeocode}
|
|
720
675
|
*
|
|
721
676
|
* They cover:
|
|
722
677
|
* - Result limits and pagination
|
|
723
|
-
* - Geographic biasing for location-aware results
|
|
724
678
|
* - Additional data inclusion (mapcodes, extended postal codes)
|
|
725
679
|
* - Geopolitical view context for disputed territories
|
|
726
680
|
*
|
|
727
681
|
* @example
|
|
728
682
|
* ```typescript
|
|
729
683
|
* // Search with mapcodes and specific geopolitical view
|
|
730
|
-
* const detailedSearch: CommonPlacesParams<
|
|
684
|
+
* const detailedSearch: CommonPlacesParams<GetObject, Response> = {
|
|
731
685
|
* geopoliticalView: 'IN', // India's perspective
|
|
732
686
|
* mapcodes: ['Local', 'International'],
|
|
733
687
|
* extendedPostalCodesFor: ['PAD', 'POI'],
|
|
@@ -735,7 +689,7 @@ export type SearchIndexType = 'Geo' | 'PAD' | 'Addr' | 'Str' | 'XStr' | 'POI';
|
|
|
735
689
|
* };
|
|
736
690
|
*
|
|
737
691
|
* // Address search with extended postal codes
|
|
738
|
-
* const addressSearch: CommonPlacesParams<
|
|
692
|
+
* const addressSearch: CommonPlacesParams<GetObject, Response> = {
|
|
739
693
|
* extendedPostalCodesFor: ['Geo', 'PAD', 'Addr'],
|
|
740
694
|
* limit: 15
|
|
741
695
|
* };
|
|
@@ -775,7 +729,7 @@ export type CommonPlacesParams<ApiRequest, ApiResponse> = CommonServiceParams<Ap
|
|
|
775
729
|
*
|
|
776
730
|
* A regular postal code is "10001" (basic ZIP code), and an extended one "10001-1234" (ZIP+4 format).
|
|
777
731
|
*
|
|
778
|
-
*
|
|
732
|
+
* Including them for geographies can significantly increase response size.
|
|
779
733
|
*
|
|
780
734
|
* @example
|
|
781
735
|
* ```typescript
|
|
@@ -1054,10 +1008,7 @@ export type VehicleModel = {
|
|
|
1054
1008
|
//#endregion
|
|
1055
1009
|
//#region src/shared/types/vehicleRestrictionParams.d.ts
|
|
1056
1010
|
/**
|
|
1057
|
-
*
|
|
1058
|
-
*
|
|
1059
|
-
* It determines which toll roads the routing engine may use. Some tolls can only be paid by
|
|
1060
|
-
* transponder, others only without one.
|
|
1011
|
+
* The values {@link TollTransponder} takes.
|
|
1061
1012
|
*
|
|
1062
1013
|
* @group Vehicle
|
|
1063
1014
|
*/
|
|
@@ -1080,6 +1031,8 @@ export declare const tollTransponderOptions: readonly ["all", "unknown", "none"]
|
|
|
1080
1031
|
export type TollTransponder = (typeof tollTransponderOptions)[number];
|
|
1081
1032
|
/**
|
|
1082
1033
|
* The vehicle parameters for the restrictions applied during route planning.
|
|
1034
|
+
*
|
|
1035
|
+
* @group Vehicle
|
|
1083
1036
|
*/
|
|
1084
1037
|
export type VehicleRestrictions = {
|
|
1085
1038
|
/**
|
|
@@ -1142,7 +1095,7 @@ export type VehicleState = {
|
|
|
1142
1095
|
* It improves the initial route calculation by considering the vehicle's current direction of
|
|
1143
1096
|
* travel.
|
|
1144
1097
|
*
|
|
1145
|
-
* Allowed values
|
|
1098
|
+
* Allowed values run from 0 up to, but not including, 360.
|
|
1146
1099
|
*
|
|
1147
1100
|
* @example
|
|
1148
1101
|
* ```typescript
|
|
@@ -1215,12 +1168,8 @@ export type VehicleParameters = {
|
|
|
1215
1168
|
//#endregion
|
|
1216
1169
|
//#region src/shared/types/commonRoutingParams.d.ts
|
|
1217
1170
|
/**
|
|
1218
|
-
* The available route types, each naming the optimisation that route calculation uses
|
|
1219
|
-
*
|
|
1220
|
-
* * `short` finds a good compromise between small travel time and short travel distance.
|
|
1221
|
-
* * `efficient` finds a good compromise between small travel time and low fuel or energy consumption.
|
|
1222
|
-
* * `thrilling` includes interesting or challenging roads and uses as few motorways as possible.
|
|
1223
|
-
* Routes planned with routeType=thrilling are limited to 900km.
|
|
1171
|
+
* The available route types, each naming the optimisation that route calculation uses, as {@link RouteType}
|
|
1172
|
+
* describes.
|
|
1224
1173
|
*
|
|
1225
1174
|
* @group Routing
|
|
1226
1175
|
*/
|
|
@@ -1242,8 +1191,7 @@ export declare const routeTypes: readonly ["fast", "short", "efficient", "thrill
|
|
|
1242
1191
|
* - May use smaller roads to save distance
|
|
1243
1192
|
* - Useful for short trips or when fuel costs matter
|
|
1244
1193
|
*
|
|
1245
|
-
* - `efficient`
|
|
1246
|
-
* - Optimizes for least energy use
|
|
1194
|
+
* - `efficient` balances travel time against fuel or energy consumption.
|
|
1247
1195
|
* - Avoids rapid acceleration/deceleration
|
|
1248
1196
|
*
|
|
1249
1197
|
* - `thrilling` plans scenic and engaging routes.
|
|
@@ -1380,14 +1328,7 @@ export type CostModel = {
|
|
|
1380
1328
|
*/
|
|
1381
1329
|
traffic?: TrafficInput;
|
|
1382
1330
|
/**
|
|
1383
|
-
* The type of optimisation that route calculation uses.
|
|
1384
|
-
* The values are:
|
|
1385
|
-
*
|
|
1386
|
-
* * `fast` optimises for travel time, while keeping the routes sensible. For example, the calculation may avoid shortcuts along inconvenient side roads or long detours that only save very little time.
|
|
1387
|
-
* * `short` finds a good compromise between small travel time and short travel distance.
|
|
1388
|
-
* * `efficient` finds a good compromise between small travel time and low fuel or energy consumption.
|
|
1389
|
-
* * `thrilling` includes interesting or challenging roads and uses as few motorways as possible.
|
|
1390
|
-
* Routes planned with routeType=thrilling are limited to 900km.
|
|
1331
|
+
* The type of optimisation that route calculation uses, as {@link RouteType} describes.
|
|
1391
1332
|
* @default fast
|
|
1392
1333
|
*/
|
|
1393
1334
|
routeType?: RouteType;
|
|
@@ -1430,7 +1371,7 @@ export type LocalDateTime = `${number}-${number}-${number}T${number}:${number}:$
|
|
|
1430
1371
|
*
|
|
1431
1372
|
* @example
|
|
1432
1373
|
* ```typescript
|
|
1433
|
-
* // Depart at 08:15
|
|
1374
|
+
* // Depart at 08:15 local time at the origin, wherever the code runs
|
|
1434
1375
|
* const departParams: DepartArriveParams = {
|
|
1435
1376
|
* option: 'departAt',
|
|
1436
1377
|
* localDateTime: '2026-10-19T08:15:00'
|
|
@@ -1665,13 +1606,10 @@ export type CommonSearchParams<ApiRequest, ApiResponse> = CommonPlacesParams<Api
|
|
|
1665
1606
|
* The format and detail level of the POI opening hours data that the response includes.
|
|
1666
1607
|
*
|
|
1667
1608
|
* @remarks
|
|
1668
|
-
* Each mode gives a different level of detail about when a POI is open for business.
|
|
1669
|
-
*
|
|
1670
1609
|
* Use it to:
|
|
1671
1610
|
* - Display "Open Now" status
|
|
1672
1611
|
* - Show full weekly schedule
|
|
1673
1612
|
* - Plan visits during open hours
|
|
1674
|
-
* - Filter to currently open locations
|
|
1675
1613
|
*
|
|
1676
1614
|
* @example
|
|
1677
1615
|
* ```typescript
|
|
@@ -1856,18 +1794,12 @@ export type SearchSummary = {
|
|
|
1856
1794
|
*/
|
|
1857
1795
|
totalResults?: number;
|
|
1858
1796
|
/**
|
|
1859
|
-
* The maximum fuzzy
|
|
1797
|
+
* The maximum fuzzy level used to find results, one of the levels {@link FuzzyLevel} describes.
|
|
1860
1798
|
*
|
|
1861
1799
|
* It shows how much the search relaxed exact matching. Higher values mean more tolerance for
|
|
1862
1800
|
* typos and variations.
|
|
1863
1801
|
*
|
|
1864
1802
|
* @remarks
|
|
1865
|
-
* Fuzzy levels (typically 1-4):
|
|
1866
|
-
* - 1: Single character variation (typo, insertion, deletion)
|
|
1867
|
-
* - 2: Two character variations
|
|
1868
|
-
* - 3: Three character variations
|
|
1869
|
-
* - 4: Four character variations
|
|
1870
|
-
*
|
|
1871
1803
|
* It is low when exact or near-exact matching finds the results, and increases to find matches
|
|
1872
1804
|
* when the query has typos.
|
|
1873
1805
|
*
|
|
@@ -1877,7 +1809,7 @@ export type SearchSummary = {
|
|
|
1877
1809
|
* @example
|
|
1878
1810
|
* ```typescript
|
|
1879
1811
|
* // Query: "amstrdam" (typo)
|
|
1880
|
-
* fuzzyLevel: 2 // Needed
|
|
1812
|
+
* fuzzyLevel: 2 // Needed spell checking to match "amsterdam"
|
|
1881
1813
|
*
|
|
1882
1814
|
* // Query: "amsterdam" (correct)
|
|
1883
1815
|
* fuzzyLevel: 1 // Exact match, no fuzzy matching needed
|
|
@@ -2081,11 +2013,17 @@ type CommonSearchPlaceResultAPI = Omit<SearchPlaceProps, 'distance' | 'position'
|
|
|
2081
2013
|
dist?: number;
|
|
2082
2014
|
viewport?: ViewportAPI;
|
|
2083
2015
|
boundingBox?: BoundingBoxAPI;
|
|
2016
|
+
entityType?: string;
|
|
2084
2017
|
entryPoints?: EntryPointAPI[];
|
|
2085
|
-
|
|
2018
|
+
addressRanges?: AddressRangesAPI;
|
|
2086
2019
|
poi?: POIAPI;
|
|
2087
2020
|
chargingStations?: ChargingStationAPI[];
|
|
2088
2021
|
};
|
|
2022
|
+
/**
|
|
2023
|
+
* The fields every places result maps alike, whether a search or a geocoding one.
|
|
2024
|
+
* @ignore
|
|
2025
|
+
*/
|
|
2026
|
+
type PlaceResultFieldsAPI = Pick<CommonSearchPlaceResultAPI, 'id' | 'position' | 'dist' | 'boundingBox' | 'viewport' | 'entityType' | 'entryPoints' | 'addressRanges'>;
|
|
2089
2027
|
/**
|
|
2090
2028
|
* A places response holding only the summary and the results, as geometry search, along-route search and place
|
|
2091
2029
|
* details answer.
|
|
@@ -2214,7 +2152,7 @@ type AlongRouteSearchParams = CommonSearchParams<AlongRouteSearchRequestAPI, Alo
|
|
|
2214
2152
|
* route: [[4.9, 52.37], [4.95, 52.28], [5.1, 52.09]]
|
|
2215
2153
|
* ```
|
|
2216
2154
|
*/
|
|
2217
|
-
route: LineString |
|
|
2155
|
+
route: LineString | PathLike;
|
|
2218
2156
|
/**
|
|
2219
2157
|
* Maximum allowed detour time in seconds, a positive integer up to `3600` (one hour);
|
|
2220
2158
|
* request validation rejects a larger one.
|
|
@@ -2242,6 +2180,15 @@ type AlongRouteSearchParams = CommonSearchParams<AlongRouteSearchRequestAPI, Alo
|
|
|
2242
2180
|
};
|
|
2243
2181
|
//#endregion
|
|
2244
2182
|
//#region src/fuzzy-search/types/fuzzySearchResponse.d.ts
|
|
2183
|
+
/**
|
|
2184
|
+
* Response from the fuzzy search service.
|
|
2185
|
+
*
|
|
2186
|
+
* The places matching the search query, with metadata about the detected query intents
|
|
2187
|
+
* (coordinates, nearby searches, what3words or bookmarks).
|
|
2188
|
+
*
|
|
2189
|
+
* @group Fuzzy Search
|
|
2190
|
+
*/
|
|
2191
|
+
type FuzzySearchResponse = Places<SearchPlaceProps, FuzzySearchFeatureCollectionProps>;
|
|
2245
2192
|
/**
|
|
2246
2193
|
* Additional properties for fuzzy search feature collection.
|
|
2247
2194
|
*
|
|
@@ -2556,7 +2503,7 @@ type FuzzySearchParams = CommonSearchParams<GetObject, FuzzySearchResponseAPI> &
|
|
|
2556
2503
|
/**
|
|
2557
2504
|
* Maximum fuzziness level to use.
|
|
2558
2505
|
*
|
|
2559
|
-
* It sets the last spell-checking level the search tries, of those
|
|
2506
|
+
* It sets the last spell-checking level the search tries, of those {@link FuzzyLevel} lists.
|
|
2560
2507
|
* Higher values allow more variations but may include irrelevant results.
|
|
2561
2508
|
*
|
|
2562
2509
|
* @remarks
|
|
@@ -2626,16 +2573,7 @@ type GeocodingResponse = Places<GeocodingProps, SearchSummary>;
|
|
|
2626
2573
|
/**
|
|
2627
2574
|
* @ignore
|
|
2628
2575
|
*/
|
|
2629
|
-
type GeocodingResultAPI = Omit<GeocodingProps, 'distance' | 'position' | 'boundingBox' | 'addressRanges' | 'geographyType' | 'entryPoints'> &
|
|
2630
|
-
id: string;
|
|
2631
|
-
position: LatLonAPI;
|
|
2632
|
-
dist?: number;
|
|
2633
|
-
boundingBox?: BoundingBoxAPI;
|
|
2634
|
-
viewport?: ViewportAPI;
|
|
2635
|
-
entityType?: string;
|
|
2636
|
-
entryPoints?: EntryPointAPI[];
|
|
2637
|
-
addressRanges?: AddressRangesAPI;
|
|
2638
|
-
};
|
|
2576
|
+
type GeocodingResultAPI = Omit<GeocodingProps, 'distance' | 'position' | 'boundingBox' | 'addressRanges' | 'geographyType' | 'entryPoints'> & PlaceResultFieldsAPI;
|
|
2639
2577
|
/**
|
|
2640
2578
|
* @ignore
|
|
2641
2579
|
*/
|
|
@@ -2659,12 +2597,7 @@ type GeocodingIndexTypesAbbreviation = Exclude<SearchIndexType, 'POI'>;
|
|
|
2659
2597
|
* can place markers on maps or perform spatial operations.
|
|
2660
2598
|
*
|
|
2661
2599
|
* @remarks
|
|
2662
|
-
*
|
|
2663
|
-
* For POI search, use {@link discoverPlaces} instead.
|
|
2664
|
-
*
|
|
2665
|
-
* It tolerates typos and incomplete addresses, handles various address formats and supports
|
|
2666
|
-
* street addresses, intersections and cross streets. It works with geographies (cities,
|
|
2667
|
-
* counties, states, countries) and returns structured address components.
|
|
2600
|
+
* What geocoding finds, and what it tolerates, is on {@link geocode}.
|
|
2668
2601
|
*
|
|
2669
2602
|
* @example
|
|
2670
2603
|
* ```typescript
|
|
@@ -2770,21 +2703,18 @@ type GeocodingParams = Omit<CommonPlacesParams<GetObject, GeocodingResponseAPI>
|
|
|
2770
2703
|
* higher-level geographies (cities, counties, states, countries) and returns structured address
|
|
2771
2704
|
* components.
|
|
2772
2705
|
*
|
|
2773
|
-
* @param
|
|
2706
|
+
* @param queryOrParams - The address or place name to geocode, the same as `{ query }`, or the full
|
|
2707
|
+
* {@link GeocodingParams}. Pass the params form to set any other option, `signal` included.
|
|
2774
2708
|
*
|
|
2775
2709
|
* @returns The geocoded locations.
|
|
2776
2710
|
*
|
|
2777
2711
|
* @example
|
|
2778
2712
|
* ```typescript
|
|
2779
2713
|
* // Geocode a complete address
|
|
2780
|
-
* const result = await geocode(
|
|
2781
|
-
* query: '1600 Pennsylvania Avenue NW, Washington, DC'
|
|
2782
|
-
* });
|
|
2714
|
+
* const result = await geocode('1600 Pennsylvania Avenue NW, Washington, DC');
|
|
2783
2715
|
*
|
|
2784
|
-
* // Geocode
|
|
2785
|
-
* const partialResult = await geocode({
|
|
2786
|
-
* query: 'Amsterdam, Netherlands'
|
|
2787
|
-
* });
|
|
2716
|
+
* // Geocode a partial address, cancellable through an AbortSignal
|
|
2717
|
+
* const partialResult = await geocode({ query: 'Amsterdam, Netherlands', signal });
|
|
2788
2718
|
*
|
|
2789
2719
|
* // Geocode with bias towards specific location
|
|
2790
2720
|
* const biasedResult = await geocode({
|
|
@@ -2805,13 +2735,14 @@ type GeocodingParams = Omit<CommonPlacesParams<GetObject, GeocodingResponseAPI>
|
|
|
2805
2735
|
*
|
|
2806
2736
|
* @group Geocoding
|
|
2807
2737
|
*/
|
|
2808
|
-
export declare const geocode: (
|
|
2738
|
+
export declare const geocode: (queryOrParams: string | GeocodingParams) => Promise<GeocodingResponse>;
|
|
2809
2739
|
/**
|
|
2810
2740
|
* Geocodes a query and returns the single best-matching place.
|
|
2811
2741
|
*
|
|
2812
2742
|
* It wraps {@link geocode} and returns the top result directly.
|
|
2813
2743
|
*
|
|
2814
2744
|
* @param queryOrParams - The address or place name to geocode, or the full {@link GeocodingParams} without `limit`.
|
|
2745
|
+
* Pass the params form to set any other option, `signal` included.
|
|
2815
2746
|
* @returns The best-matching place.
|
|
2816
2747
|
* @throws {SDKError} With the code `NOT_FOUND` and the service `'Geocode'` if no results are found for the query
|
|
2817
2748
|
*
|
|
@@ -2862,7 +2793,7 @@ type GeometryDataResponseAPI = {
|
|
|
2862
2793
|
* const ids: GeometriesInput = ['g1234567890', 'g0987654321'];
|
|
2863
2794
|
* ```
|
|
2864
2795
|
*
|
|
2865
|
-
* @group Geometry
|
|
2796
|
+
* @group Geometry Data
|
|
2866
2797
|
*/
|
|
2867
2798
|
type GeometriesInput = string[];
|
|
2868
2799
|
/**
|
|
@@ -2870,7 +2801,7 @@ type GeometriesInput = string[];
|
|
|
2870
2801
|
*
|
|
2871
2802
|
* Extended by {@link GeometryDataParams} and {@link GeometryPlaceParams}.
|
|
2872
2803
|
*
|
|
2873
|
-
* @group Geometry
|
|
2804
|
+
* @group Geometry Data
|
|
2874
2805
|
*/
|
|
2875
2806
|
type CommonServiceParamsWithZoom = CommonServiceParams<GetObject, GeometryDataResponseAPI> & {
|
|
2876
2807
|
/**
|
|
@@ -2913,7 +2844,7 @@ type CommonServiceParamsWithZoom = CommonServiceParams<GetObject, GeometryDataRe
|
|
|
2913
2844
|
* };
|
|
2914
2845
|
* ```
|
|
2915
2846
|
*
|
|
2916
|
-
* @group Geometry
|
|
2847
|
+
* @group Geometry Data
|
|
2917
2848
|
*/
|
|
2918
2849
|
type GeometryDataParams = CommonServiceParamsWithZoom & {
|
|
2919
2850
|
/**
|
|
@@ -2960,7 +2891,7 @@ type GeometryDataParams = CommonServiceParamsWithZoom & {
|
|
|
2960
2891
|
* };
|
|
2961
2892
|
* ```
|
|
2962
2893
|
*
|
|
2963
|
-
* @group Geometry
|
|
2894
|
+
* @group Geometry Data
|
|
2964
2895
|
*/
|
|
2965
2896
|
type GeometryPlaceParams = CommonServiceParamsWithZoom & {
|
|
2966
2897
|
/**
|
|
@@ -3005,7 +2936,7 @@ type GeometryPlaceParams = CommonServiceParamsWithZoom & {
|
|
|
3005
2936
|
* };
|
|
3006
2937
|
* ```
|
|
3007
2938
|
*
|
|
3008
|
-
* @group Geometry
|
|
2939
|
+
* @group Geometry Data
|
|
3009
2940
|
*/
|
|
3010
2941
|
type GeometryParams = GeometryDataParams | GeometryPlaceParams;
|
|
3011
2942
|
//#endregion
|
|
@@ -3017,7 +2948,7 @@ type GeometryParams = GeometryDataParams | GeometryPlaceParams;
|
|
|
3017
2948
|
*
|
|
3018
2949
|
* @typeParam P - The properties of the places passed in.
|
|
3019
2950
|
*
|
|
3020
|
-
* @group Geometry
|
|
2951
|
+
* @group Geometry Data
|
|
3021
2952
|
*/
|
|
3022
2953
|
type PlaceGeometryProps<P extends CommonPlaceProps = CommonPlaceProps> = P & {
|
|
3023
2954
|
/**
|
|
@@ -3039,21 +2970,17 @@ type PlaceGeometryProps<P extends CommonPlaceProps = CommonPlaceProps> = P & {
|
|
|
3039
2970
|
* You can fetch up to 20 geometries in a single call, at scales from countries down to building
|
|
3040
2971
|
* footprints, as standard GeoJSON Polygon/MultiPolygon features.
|
|
3041
2972
|
*
|
|
3042
|
-
* Use it to display city or country boundaries on maps, show POI building footprints, create
|
|
3043
|
-
* geofences for spatial queries, visualise administrative divisions, or calculate areas and
|
|
3044
|
-
* spatial relationships.
|
|
3045
|
-
*
|
|
3046
2973
|
* It returns polygons, not places, so pass the result to `GeometriesModule.show()`, not
|
|
3047
2974
|
* `PlacesModule.show()`. The `geometryId` comes from a prior search result.
|
|
3048
2975
|
*
|
|
3049
2976
|
* A `Places` collection gets each polygon its place's properties, as {@link PlaceGeometryProps}.
|
|
2977
|
+
* Places that share a footprint give it the properties of the first of them, the best ranked.
|
|
3050
2978
|
* A polygon the service returns for no place of the collection has `null` properties. A `Place[]`
|
|
3051
|
-
* or geometry IDs return the polygons with the service's own properties.
|
|
2979
|
+
* or geometry IDs return the polygons with the service's own properties. A geometry the service
|
|
2980
|
+
* can't return, such as one with an unknown ID, is left out of the result.
|
|
3052
2981
|
*
|
|
3053
2982
|
* @param params - The geometry IDs or places to fetch boundaries for.
|
|
3054
2983
|
*
|
|
3055
|
-
* @returns Polygon features of the area boundaries.
|
|
3056
|
-
*
|
|
3057
2984
|
* @example
|
|
3058
2985
|
* ```typescript
|
|
3059
2986
|
* // Fetch geometry by ID
|
|
@@ -3079,7 +3006,7 @@ type PlaceGeometryProps<P extends CommonPlaceProps = CommonPlaceProps> = P & {
|
|
|
3079
3006
|
* @see [Places Quickstart Guide](https://docs.tomtom.com/maps-sdk-js/guides/services/places/quickstart)
|
|
3080
3007
|
* @see [Geometry Data Guide](https://docs.tomtom.com/maps-sdk-js/guides/services/places/geometry-data)
|
|
3081
3008
|
*
|
|
3082
|
-
* @group Geometry
|
|
3009
|
+
* @group Geometry Data
|
|
3083
3010
|
*/
|
|
3084
3011
|
export declare function geometryData<P extends CommonPlaceProps>(params: GeometryPlaceParams & {
|
|
3085
3012
|
geometries: Places<P>;
|
|
@@ -3134,9 +3061,7 @@ type GeometrySearchResponseAPI = SearchResultsResponseAPI;
|
|
|
3134
3061
|
* such as "restaurants in this neighborhood" or "hotels within these city boundaries".
|
|
3135
3062
|
*
|
|
3136
3063
|
* @remarks
|
|
3137
|
-
* Pass these to {@link discoverPlaces}, which
|
|
3138
|
-
* A `route` property selects along-route search, a `geometries` property selects geometry search,
|
|
3139
|
-
* and neither selects fuzzy search.
|
|
3064
|
+
* Pass these to {@link discoverPlaces}, which runs a geometry search when given `geometries`.
|
|
3140
3065
|
*
|
|
3141
3066
|
* Geometry search searches within multiple geometries at once and supports polygons, multipolygons
|
|
3142
3067
|
* and circles. It can use geometries from previous search results, and combines with text queries
|
|
@@ -3194,7 +3119,7 @@ type GeometrySearchParams = CommonSearchParams<GeometrySearchRequestAPI, Geometr
|
|
|
3194
3119
|
* - `PolygonFeatures` - Feature collection with polygon geometries
|
|
3195
3120
|
*
|
|
3196
3121
|
* Only a polygon's outer ring is sent, so holes are ignored. The ring is sampled down to 50 vertices,
|
|
3197
|
-
* and a `MultiPolygon` of more than 50 polygons keeps
|
|
3122
|
+
* and a `MultiPolygon` of more than 50 polygons keeps the 50 with the largest bounding boxes.
|
|
3198
3123
|
*
|
|
3199
3124
|
* @example
|
|
3200
3125
|
* ```typescript
|
|
@@ -3291,7 +3216,6 @@ type SearchGeometryInput = Polygon | MultiPolygon | Circle | PolygonFeatures;
|
|
|
3291
3216
|
//#endregion
|
|
3292
3217
|
//#region src/place-details/types/placeDetailsResponseAPI.d.ts
|
|
3293
3218
|
/**
|
|
3294
|
-
* Its results are sorted in descending order by score.
|
|
3295
3219
|
* @ignore
|
|
3296
3220
|
*/
|
|
3297
3221
|
type PlaceDetailsResponseAPI = SearchResultsResponseAPI;
|
|
@@ -3399,11 +3323,12 @@ type PlaceDetailsResponse = Place<SearchPlaceProps> | undefined;
|
|
|
3399
3323
|
*
|
|
3400
3324
|
* const placeDetails = await getPlaceDetails({
|
|
3401
3325
|
* entityId: place.id,
|
|
3402
|
-
* openingHours: 'nextSevenDays'
|
|
3326
|
+
* openingHours: 'nextSevenDays',
|
|
3327
|
+
* relatedPois: 'parent'
|
|
3403
3328
|
* });
|
|
3404
3329
|
*
|
|
3405
3330
|
* // Navigate to related POI
|
|
3406
|
-
* const relatedPOI =
|
|
3331
|
+
* const relatedPOI = placeDetails?.properties.relatedPois?.[0];
|
|
3407
3332
|
* if (relatedPOI) {
|
|
3408
3333
|
* const parentPlace = await getPlaceDetails({
|
|
3409
3334
|
* entityId: relatedPOI.id
|
|
@@ -3714,17 +3639,18 @@ export type ReachableRangeOwnParams = {
|
|
|
3714
3639
|
* Location where the range calculation starts.
|
|
3715
3640
|
*
|
|
3716
3641
|
* @remarks
|
|
3717
|
-
* It is the center point from which reachability is calculated,
|
|
3718
|
-
* -
|
|
3719
|
-
* -
|
|
3642
|
+
* It is the center point from which reachability is calculated, as any {@link HasLngLat}:
|
|
3643
|
+
* - A `[longitude, latitude]` position
|
|
3644
|
+
* - A GeoJSON `Point`
|
|
3645
|
+
* - A GeoJSON `Feature` with a `Point` geometry, such as a place from a search
|
|
3720
3646
|
*
|
|
3721
3647
|
* @example
|
|
3722
3648
|
* ```typescript
|
|
3723
|
-
* //
|
|
3724
|
-
* origin: { lon: 4.9, lat: 52.3 }
|
|
3725
|
-
*
|
|
3726
|
-
* // Array format
|
|
3649
|
+
* // Position
|
|
3727
3650
|
* origin: [4.9, 52.3]
|
|
3651
|
+
*
|
|
3652
|
+
* // A place from a search
|
|
3653
|
+
* origin: await geocodeOne('Amsterdam Centraal')
|
|
3728
3654
|
* ```
|
|
3729
3655
|
*/
|
|
3730
3656
|
origin: HasLngLat;
|
|
@@ -3767,11 +3693,8 @@ export type ReachableRangeOwnParams = {
|
|
|
3767
3693
|
* When to depart, as an instant (`date`) or a wall-clock time at the origin (`localDateTime`).
|
|
3768
3694
|
*
|
|
3769
3695
|
* @remarks
|
|
3770
|
-
*
|
|
3771
|
-
*
|
|
3772
|
-
*
|
|
3773
|
-
* Future departure times use predictive traffic, the current time uses live
|
|
3774
|
-
* traffic, and historic times use historical patterns.
|
|
3696
|
+
* Future departure times use predictive traffic, and the current time live traffic. A past date
|
|
3697
|
+
* departs now, as {@link DepartArriveParams} explains.
|
|
3775
3698
|
*
|
|
3776
3699
|
* @default Depart now
|
|
3777
3700
|
*
|
|
@@ -3901,10 +3824,6 @@ export declare const calculateReachableRange: (params: ReachableRangeParams) =>
|
|
|
3901
3824
|
* @remarks
|
|
3902
3825
|
* **[Private Preview](https://docs.tomtom.com/legal/private-preview)**. It needs the same API key access as {@link calculateReachableRange}.
|
|
3903
3826
|
*
|
|
3904
|
-
* Use it to compare the service areas of different store locations, create 15/30/45 minute drive
|
|
3905
|
-
* time rings from one origin, compare ranges for different vehicle types or times of day, or find
|
|
3906
|
-
* optimal facility locations with minimal overlap.
|
|
3907
|
-
*
|
|
3908
3827
|
* Note that ranges are calculated sequentially to avoid rate limiting. For large batches,
|
|
3909
3828
|
* consider implementing your own parallel processing with appropriate throttling.
|
|
3910
3829
|
*
|
|
@@ -3947,6 +3866,19 @@ export declare const calculateReachableRanges: (paramsArray: ReachableRangeParam
|
|
|
3947
3866
|
signal?: AbortSignal;
|
|
3948
3867
|
}) => Promise<PolygonFeatures<ReachableRangeProperties>>;
|
|
3949
3868
|
//#endregion
|
|
3869
|
+
//#region src/revgeo/requestBuilder.d.ts
|
|
3870
|
+
declare const AREA_TYPE_BY_GEOGRAPHY_TYPE: {
|
|
3871
|
+
readonly Country: "country";
|
|
3872
|
+
readonly CountrySubdivision: "countrySubdivision";
|
|
3873
|
+
readonly CountrySecondarySubdivision: "countrySecondarySubdivision";
|
|
3874
|
+
readonly CountryTertiarySubdivision: "countryTertiarySubdivision";
|
|
3875
|
+
readonly Municipality: "municipality";
|
|
3876
|
+
readonly MunicipalitySubdivision: "municipalitySubdivision";
|
|
3877
|
+
readonly MunicipalitySecondarySubdivision: "municipalitySecondarySubdivision";
|
|
3878
|
+
readonly Neighbourhood: "neighborhood";
|
|
3879
|
+
readonly PostalCodeArea: "postalCode";
|
|
3880
|
+
};
|
|
3881
|
+
//#endregion
|
|
3950
3882
|
//#region src/revgeo/types/apiTypes.d.ts
|
|
3951
3883
|
/** Orbis Reverse Geocoding v2 top-level result type.
|
|
3952
3884
|
* (geocode v2 also has `'intersection'`; reverse geocoding does not.)
|
|
@@ -3956,7 +3888,7 @@ type ReverseGeocodingResultTypeAPI = 'address' | 'street' | 'area';
|
|
|
3956
3888
|
/** Orbis Reverse Geocoding v2 area sub-type.
|
|
3957
3889
|
* @ignore
|
|
3958
3890
|
*/
|
|
3959
|
-
type ReverseGeocodingAreaTypeAPI =
|
|
3891
|
+
type ReverseGeocodingAreaTypeAPI = (typeof AREA_TYPE_BY_GEOGRAPHY_TYPE)[GeographyType];
|
|
3960
3892
|
/**
|
|
3961
3893
|
* Address object as returned by the Orbis Reverse Geocoding v2 API.
|
|
3962
3894
|
* @ignore
|
|
@@ -4018,8 +3950,7 @@ type ReverseGeocodingMandatoryParams = {
|
|
|
4018
3950
|
* Optional parameters for customizing reverse geocoding requests.
|
|
4019
3951
|
*
|
|
4020
3952
|
* @remarks
|
|
4021
|
-
* They
|
|
4022
|
-
* formatting and additional data retrieval.
|
|
3953
|
+
* They set the geography types to return, the heading, the search radius and the geopolitical view.
|
|
4023
3954
|
*
|
|
4024
3955
|
* @group Reverse Geocoding
|
|
4025
3956
|
*/
|
|
@@ -4047,7 +3978,7 @@ type ReverseGeocodingOptionalParams = {
|
|
|
4047
3978
|
*
|
|
4048
3979
|
* @example
|
|
4049
3980
|
* ```ts
|
|
4050
|
-
* heading:
|
|
3981
|
+
* heading: 67.5 // Traveling east-northeast
|
|
4051
3982
|
* ```
|
|
4052
3983
|
*
|
|
4053
3984
|
* @minimum -360
|
|
@@ -4206,7 +4137,6 @@ type LegRequestAPI = {
|
|
|
4206
4137
|
*/
|
|
4207
4138
|
type CalculateRoutePOSTDataAPI = CommonRoutingBodyAPI & CommonVehicleBodyAPI & {
|
|
4208
4139
|
routePlanningLocations: RoutePlanningLocationsAPI;
|
|
4209
|
-
path?: LineString;
|
|
4210
4140
|
legs?: LegRequestAPI[];
|
|
4211
4141
|
maxPathAlternativeRoutes?: number;
|
|
4212
4142
|
arrivalDateTime?: string;
|
|
@@ -4520,28 +4450,7 @@ type InputSectionType = (typeof inputSectionTypesWithGuidance)[number];
|
|
|
4520
4450
|
* display additional context like toll roads, ferry crossings or traffic incidents.
|
|
4521
4451
|
*
|
|
4522
4452
|
* @remarks
|
|
4523
|
-
*
|
|
4524
|
-
* - `carTrain`: Sections requiring car train transport
|
|
4525
|
-
* - `ferry`: Water crossings requiring ferry
|
|
4526
|
-
* - `tunnel`: Underground tunnel sections
|
|
4527
|
-
* - `motorway`: Highway/freeway sections
|
|
4528
|
-
* - `pedestrian`: Pedestrian-only sections
|
|
4529
|
-
* - `toll`: Sections requiring toll payment
|
|
4530
|
-
* - `tollRoad`: Toll roads
|
|
4531
|
-
* - `tollVignette`: Sections requiring toll vignette
|
|
4532
|
-
* - `country`: Different countries traversed
|
|
4533
|
-
* - `traffic`: Sections with traffic incidents
|
|
4534
|
-
* - `vehicleRestricted`: Sections with vehicle restrictions
|
|
4535
|
-
* - `carpool`: HOV/carpool lane sections
|
|
4536
|
-
* - `urban`: Urban area sections
|
|
4537
|
-
* - `unpaved`: Unpaved road sections
|
|
4538
|
-
* - `lowEmissionZone`: Low emission zones
|
|
4539
|
-
* - `speedLimit`: Speed limit changes
|
|
4540
|
-
* - `roadShields`: Road shield information
|
|
4541
|
-
* - `importantRoadStretch`: Named important road stretches along the route
|
|
4542
|
-
* - `lanes`: Lane guidance
|
|
4543
|
-
* - `curve`: Curves, with their heading change and radius, which the SDK finds in the route's geometry
|
|
4544
|
-
* - `curvyStretch`: Stretches where curves follow one another closely, which the SDK groups the curves into
|
|
4453
|
+
* {@link SectionsProps} describes each section type.
|
|
4545
4454
|
*
|
|
4546
4455
|
* A requested section type is only present in the response if the route actually traverses it
|
|
4547
4456
|
* (e.g. `ferry` is omitted on a route with no water crossing). The `lanes` section is returned only
|
|
@@ -4851,15 +4760,12 @@ type CalculateRouteParams = CommonServiceParams<CalculateRouteRequestAPI, Calcul
|
|
|
4851
4760
|
*/
|
|
4852
4761
|
guidance?: GuidanceParams;
|
|
4853
4762
|
/**
|
|
4854
|
-
* Route section types to include in the response.
|
|
4763
|
+
* Route section types to include in the response, as {@link InputSectionTypes} describes.
|
|
4855
4764
|
*
|
|
4856
4765
|
* Sections help you display route characteristics like tolls, ferries, or traffic.
|
|
4857
4766
|
* Leg sections are always included regardless of this parameter, and so are distinct sections
|
|
4858
|
-
* when two or more routes come back.
|
|
4859
|
-
*
|
|
4860
|
-
* {@link GuidanceParams | `guidance`} is also requested, and, when a list is given, only if it
|
|
4861
|
-
* includes `lanes`. The SDK finds `curve` and `curvyStretch` in the route's geometry, with
|
|
4862
|
-
* the thresholds of `curveDetection`, and only when the list names them.
|
|
4767
|
+
* when two or more routes come back. The SDK finds `curve` and `curvyStretch` in the route's
|
|
4768
|
+
* geometry, with the thresholds of `curveDetection`, and only when the list names them.
|
|
4863
4769
|
*
|
|
4864
4770
|
* @default When omitted, core's `defaultSectionTypes`: every type but `curve` and `curvyStretch`.
|
|
4865
4771
|
*
|
|
@@ -4898,7 +4804,6 @@ type CalculateRouteParams = CommonServiceParams<CalculateRouteRequestAPI, Calcul
|
|
|
4898
4804
|
* Maximum number of alternative routes to calculate.
|
|
4899
4805
|
*
|
|
4900
4806
|
* Alternative routes provide different travel options between the same origin and destination.
|
|
4901
|
-
* Each alternative is optimized differently (e.g., avoiding highways, minimizing tolls).
|
|
4902
4807
|
*
|
|
4903
4808
|
* @remarks
|
|
4904
4809
|
* More alternatives increase response time. Alternatives are returned in order of
|
|
@@ -5090,7 +4995,7 @@ export type DiscoverPlacesParams = {
|
|
|
5090
4995
|
*
|
|
5091
4996
|
* @group Places Search
|
|
5092
4997
|
*/
|
|
5093
|
-
export type DiscoverPlacesResponse =
|
|
4998
|
+
export type DiscoverPlacesResponse = FuzzySearchResponse;
|
|
5094
4999
|
/**
|
|
5095
5000
|
* Finds places by text query, within geometries or along a route, from one universal function.
|
|
5096
5001
|
*
|
|
@@ -5102,12 +5007,17 @@ export type DiscoverPlacesResponse = Places<SearchPlaceProps, FuzzySearchFeature
|
|
|
5102
5007
|
* With a `route`, each result's properties are {@link AlongRoutePlaceProps}, which add the detour a stop
|
|
5103
5008
|
* at the place costs.
|
|
5104
5009
|
*
|
|
5105
|
-
* @param
|
|
5010
|
+
* @param queryOrParams - A query string, which runs a fuzzy search the same as `{ query }`, or the
|
|
5011
|
+
* {@link FuzzySearchParams}, {@link GeometrySearchParams} or {@link AlongRouteSearchParams}.
|
|
5012
|
+
* Pass the params form to set any other option, `signal` included.
|
|
5106
5013
|
*
|
|
5107
5014
|
* @returns The matching places.
|
|
5108
5015
|
*
|
|
5109
5016
|
* @example
|
|
5110
5017
|
* ```typescript
|
|
5018
|
+
* // Free-text search
|
|
5019
|
+
* const cafes = await discoverPlaces('coffee shop Amsterdam');
|
|
5020
|
+
*
|
|
5111
5021
|
* // Free-text search near a location
|
|
5112
5022
|
* const results = await discoverPlaces({
|
|
5113
5023
|
* query: 'pizza restaurant',
|
|
@@ -5141,22 +5051,23 @@ export type DiscoverPlacesResponse = Places<SearchPlaceProps, FuzzySearchFeature
|
|
|
5141
5051
|
*
|
|
5142
5052
|
* @group Places Search
|
|
5143
5053
|
*/
|
|
5144
|
-
export declare function discoverPlaces(
|
|
5054
|
+
export declare function discoverPlaces(queryOrParams: Extract<DiscoverPlacesParams, {
|
|
5145
5055
|
route: unknown;
|
|
5146
5056
|
}> & {
|
|
5147
5057
|
sortBy: 'detourOffset';
|
|
5148
5058
|
}): Promise<AlongRouteSearchResponse<AlongRoutePlaceProps & Required<Pick<AlongRoutePlaceProps, 'detourOffsetInMeters'>>>>;
|
|
5149
|
-
export declare function discoverPlaces(
|
|
5059
|
+
export declare function discoverPlaces(queryOrParams: Extract<DiscoverPlacesParams, {
|
|
5150
5060
|
route: unknown;
|
|
5151
5061
|
}>): Promise<AlongRouteSearchResponse>;
|
|
5152
|
-
export declare function discoverPlaces(
|
|
5062
|
+
export declare function discoverPlaces(queryOrParams: string | DiscoverPlacesParams): Promise<DiscoverPlacesResponse>;
|
|
5153
5063
|
/**
|
|
5154
5064
|
* Searches for a single place by text query.
|
|
5155
5065
|
*
|
|
5156
|
-
* It
|
|
5157
|
-
* results are found.
|
|
5066
|
+
* It runs the fuzzy search {@link discoverPlaces} runs for params without `route` or `geometries`, and returns
|
|
5067
|
+
* the first result. It throws an error if no results are found.
|
|
5158
5068
|
*
|
|
5159
5069
|
* @param queryOrParams - The search query, or the full {@link FuzzySearchParams} without `limit`.
|
|
5070
|
+
* Pass the params form to set any other option, `signal` included.
|
|
5160
5071
|
* @returns The first matching place.
|
|
5161
5072
|
* @throws {SDKError} With the code `NOT_FOUND` and the service `'FuzzySearch'` if no results are found for the query
|
|
5162
5073
|
*
|
|
@@ -5293,8 +5204,8 @@ type SearchSuggestionsParams = CommonServiceParams & {
|
|
|
5293
5204
|
/**
|
|
5294
5205
|
* Maximum results in the list.
|
|
5295
5206
|
*
|
|
5296
|
-
* @
|
|
5297
|
-
* @remarks
|
|
5207
|
+
* @default 5
|
|
5208
|
+
* @remarks At least 1 and at most 10: a value outside that range is raised or capped to it.
|
|
5298
5209
|
*/
|
|
5299
5210
|
limit?: number;
|
|
5300
5211
|
/** What the result set is restricted to. */
|
|
@@ -5303,9 +5214,17 @@ type SearchSuggestionsParams = CommonServiceParams & {
|
|
|
5303
5214
|
kinds?: SearchSuggestionKind[];
|
|
5304
5215
|
/** Countries to restrict to, as ISO 3166-1 alpha-2 or alpha-3 codes. */
|
|
5305
5216
|
countries?: NonNullable<GeographicFilters['countries']>;
|
|
5306
|
-
/**
|
|
5217
|
+
/**
|
|
5218
|
+
* Geography types to restrict `area` results to.
|
|
5219
|
+
*
|
|
5220
|
+
* @remarks Setting it leaves only areas among the search results: no `place`, `address` or `street`.
|
|
5221
|
+
*/
|
|
5307
5222
|
areaTypes?: NonNullable<PlaceFilters['geographyTypes']>;
|
|
5308
|
-
/**
|
|
5223
|
+
/**
|
|
5224
|
+
* POI categories to restrict `place` results to. A parent code also matches its sub-categories.
|
|
5225
|
+
*
|
|
5226
|
+
* @remarks Setting it leaves only places among the search results: no `address`, `street` or `area`.
|
|
5227
|
+
*/
|
|
5309
5228
|
poiTypes?: NonNullable<PlaceFilters['poiCategories']>;
|
|
5310
5229
|
/** Restricts results to a box. How it combines with `geoBias` is on {@link getSearchSuggestions}. */
|
|
5311
5230
|
boundingBox?: HasBBox;
|
|
@@ -5315,7 +5234,8 @@ type SearchSuggestionsParams = CommonServiceParams & {
|
|
|
5315
5234
|
*
|
|
5316
5235
|
* @remarks
|
|
5317
5236
|
* `position` ranks nearer results higher without excluding anything, and is what `distanceInMeters`
|
|
5318
|
-
* is measured from. It is only a point. `filters.boundingBox` restricts the results
|
|
5237
|
+
* is measured from. It is only a point. `filters.boundingBox` restricts the results, and with a box
|
|
5238
|
+
* set the position ranks no places, it only measures them.
|
|
5319
5239
|
*/
|
|
5320
5240
|
geoBias?: Pick<PointGeoBias, 'position'>;
|
|
5321
5241
|
};
|
|
@@ -5465,6 +5385,7 @@ type TrafficAreaAnalyticsDays = {
|
|
|
5465
5385
|
* ```typescript
|
|
5466
5386
|
* // Continuous range
|
|
5467
5387
|
* const result = await trafficAreaAnalytics({
|
|
5388
|
+
* apiKey: 'YOUR_MOVE_PORTAL_KEY', // this service only
|
|
5468
5389
|
* startDate: '2024-08-01',
|
|
5469
5390
|
* endDate: '2024-08-07',
|
|
5470
5391
|
* functionalRoadClasses: ['MOTORWAY', 'MAJOR_ROAD', 'OTHER_MAJOR_ROAD', 'SECONDARY_ROAD', 'LOCAL_CONNECTING_ROAD', 'LOCAL_ROAD_HIGH_IMPORTANCE'],
|
|
@@ -5481,6 +5402,7 @@ type TrafficAreaAnalyticsDays = {
|
|
|
5481
5402
|
* ```typescript
|
|
5482
5403
|
* // Specific dates
|
|
5483
5404
|
* const result = await trafficAreaAnalytics({
|
|
5405
|
+
* apiKey: 'YOUR_MOVE_PORTAL_KEY', // this service only
|
|
5484
5406
|
* days: ['2024-08-05', '2024-08-12', '2024-08-19', '2024-08-26'],
|
|
5485
5407
|
* functionalRoadClasses: ['MOTORWAY', 'MAJOR_ROAD', 'OTHER_MAJOR_ROAD'],
|
|
5486
5408
|
* hours: [8, 9, 17, 18],
|
|
@@ -5574,12 +5496,11 @@ type TrafficAreaAnalyticsBaseParams = {
|
|
|
5574
5496
|
* - `travelTime`: average travel time per 10 km (minutes)
|
|
5575
5497
|
* - `networkLength`: total length of road segments with data (meters)
|
|
5576
5498
|
*
|
|
5577
|
-
* @returns Promise resolving to a {@link TrafficAreaAnalytics} FeatureCollection
|
|
5578
|
-
*
|
|
5579
5499
|
* @example
|
|
5580
5500
|
* ```typescript
|
|
5581
5501
|
* // Basic speed and congestion analysis for Amsterdam
|
|
5582
5502
|
* const result = await trafficAreaAnalytics({
|
|
5503
|
+
* apiKey: 'YOUR_MOVE_PORTAL_KEY', // this service only
|
|
5583
5504
|
* days: ['2024-08-06'],
|
|
5584
5505
|
* functionalRoadClasses: ['MOTORWAY', 'MAJOR_ROAD', 'OTHER_MAJOR_ROAD', 'SECONDARY_ROAD', 'LOCAL_CONNECTING_ROAD', 'LOCAL_ROAD_HIGH_IMPORTANCE'],
|
|
5585
5506
|
* hours: [7, 8, 9, 17, 18],
|
|
@@ -5602,6 +5523,7 @@ type TrafficAreaAnalyticsBaseParams = {
|
|
|
5602
5523
|
* ```typescript
|
|
5603
5524
|
* // Full metrics over a multi-day period
|
|
5604
5525
|
* const result = await trafficAreaAnalytics({
|
|
5526
|
+
* apiKey: 'YOUR_MOVE_PORTAL_KEY', // this service only
|
|
5605
5527
|
* startDate: new Date('2024-08-01'),
|
|
5606
5528
|
* endDate: new Date('2024-08-07'),
|
|
5607
5529
|
* functionalRoadClasses: 'all',
|
|
@@ -5791,10 +5713,6 @@ type TrafficIncidentDetailsParams = TrafficIncidentDetailsByBBoxParams | Traffic
|
|
|
5791
5713
|
* - Time information: start/end times and whether the incident is `present` or `future`
|
|
5792
5714
|
* - Events: one or more detailed event descriptions
|
|
5793
5715
|
*
|
|
5794
|
-
* @param params - Traffic Incident Details parameters (bbox, polygon or ids)
|
|
5795
|
-
*
|
|
5796
|
-
* @returns Promise resolving to a {@link TrafficIncidentDetails} object containing the matching incidents
|
|
5797
|
-
*
|
|
5798
5716
|
* @example
|
|
5799
5717
|
* ```typescript
|
|
5800
5718
|
* // Query by bounding box (Amsterdam area)
|