@tomtom-org/maps-sdk 0.63.0 → 1.0.0-rc.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 +142 -0
- package/LICENSE.txt +4 -4
- package/README.md +125 -106
- package/THIRD_PARTY.txt +1 -1
- package/core/dist/core.es.js +1 -2
- package/core/dist/index.d.ts +1155 -2350
- package/map/dist/THIRD_PARTY.txt +1 -1
- package/map/dist/chunks/{maplibre-gl-DJlOK9hg.js → maplibre-gl-1WcmwgIT.js} +1 -2
- package/map/dist/chunks/maplibre-gl-worker.js +1 -0
- package/map/dist/index.d.ts +6655 -7140
- package/map/dist/map.es.js +1 -2
- package/map/dist/third-party.json +1 -1
- package/package.json +6 -4
- package/services/dist/index.d.ts +798 -2541
- package/services/dist/services.es.js +1 -2
- package/core/dist/core.es.js.map +0 -1
- package/map/dist/chunks/maplibre-gl-DJlOK9hg.js.map +0 -1
- package/map/dist/map.es.js.map +0 -1
- package/services/dist/services.es.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,147 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#2482](https://github.com/tomtom-internal/maps-sdk-js/pull/2482) [`e6590f2`](https://github.com/tomtom-internal/maps-sdk-js/commit/e6590f20417dea946a55d3201d50d29ce32a9697) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - core, services, map: 1.0.0, the first stable release of the SDK. The *Upgrading to 1.0 from a 0.x release* guide lists every change to apply from a 0.x release.
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- [#2490](https://github.com/tomtom-internal/maps-sdk-js/pull/2490) [`62c5726`](https://github.com/tomtom-internal/maps-sdk-js/commit/62c572635b97c084af81b08b2b6b84f338c193ca) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** core, services, map: the error codes take the TomTom Navigation SDK's names: `API_KEY_REJECTED` is `INVALID_CREDENTIALS`, `SERVICE_UNAVAILABLE` is `LIVE_SERVICE_NOT_AVAILABLE`, `NETWORK_ERROR` is `NETWORK_NOT_AVAILABLE` and `UNEXPECTED` is `INTERNAL`
|
|
12
|
+
**Breaking:** core, services, map: a `403` is `INSUFFICIENT_PERMISSIONS`, a valid key not allowed the request, and `INVALID_CREDENTIALS` is a `401` only, a key the API does not know
|
|
13
|
+
- services, map: `SDKError.canRetry` and `TomTomMapError.canRetry` are `true` for `RATE_LIMITED`, `LIVE_SERVICE_NOT_AVAILABLE` and `NETWORK_NOT_AVAILABLE`, the failures that clear on their own
|
|
14
|
+
- services: a `403` keeps the API's message, and `SDKServiceError.apiErrorCode` holds the API's own code: `'Forbidden'` when the API is not enabled for the key, `'InvalidReferer'` when its domain restriction refused the page
|
|
15
|
+
- services: `calculateReachableRange` and `calculateReachableRanges`, in Private Preview, name the access a key lacks, and link the Private Preview terms, in the message; the access is also in `SDKServiceError.privatePreviewAccess`, `{ product, requestAccessURL }`
|
|
16
|
+
- map: a style, tile, sprite or glyph answered `403` reaches the error handlers as `INSUFFICIENT_PERMISSIONS`
|
|
17
|
+
|
|
18
|
+
- [#2512](https://github.com/tomtom-internal/maps-sdk-js/pull/2512) [`f8e49db`](https://github.com/tomtom-internal/maps-sdk-js/commit/f8e49dbf1876097b2a0c62cf5e6c1e1feb494178) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: the sky, space, incident delay and hillshade knobs are named as every other knob is: a part's settings sit under it, and no name repeats its parent
|
|
19
|
+
- map: `StylingFoundationsModule` knob ids `view.sky`, `view.skyColor`, `view.horizonColor` and `view.spaceColor` are `view.sky.visible`, `view.sky.color`, `view.sky.horizonColor` and `view.space.color`, in `styleColorKnobIds`, `getStyleColor` and map presets too
|
|
20
|
+
- map: `TrafficIncidentsModule` `filters: { delays: { mustHaveDelay, minDelayMinutes } }` is `filters: { delays: { required, minMinutes } }`, and the knob ids follow
|
|
21
|
+
- map: `TerrainModule` `hillshade: { lightDirection, exaggeration, shadowColor, highlightColor, accentColor }` is `hillshade: { light: { direction }, intensity, colors: { shaded, lit, steep } }`, and the knob ids follow, in `styleColorKnobIds` and `getStyleColor` too; `exaggeration` is now only the raised surface's vertical scale
|
|
22
|
+
- agent-toolkit: `setMapStyling`'s globe example sets `view.sky.visible`
|
|
23
|
+
|
|
24
|
+
- [#2485](https://github.com/tomtom-internal/maps-sdk-js/pull/2485) [`ac09c1e`](https://github.com/tomtom-internal/maps-sdk-js/commit/ac09c1e37d192837467d6575ce8bc99464e11455) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: `PlacesKnob` and the traffic knob types list only the kinds their catalogues hold, so a `switch` over their `kind` drops the cases no entry reaches
|
|
25
|
+
- `PlacesKnob` no longer includes `text`
|
|
26
|
+
- `TrafficFlowKnob`, `TrafficIncidentsKnob`, `TrafficIncidentDetailsKnob` and `TrafficAreaAnalyticsKnob` no longer include `image`
|
|
27
|
+
|
|
28
|
+
- [#2505](https://github.com/tomtom-internal/maps-sdk-js/pull/2505) [`308c3af`](https://github.com/tomtom-internal/maps-sdk-js/commit/308c3af3a5375b12293b2018413f4f78286739d6) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: the last config properties and knob ids off the shared vocabulary follow it: a size preset is a `*Preset`, a fill style sits under `fill`, and a unit is named once
|
|
29
|
+
- map: `GeometriesModule` and `ReachableRangesModule` take `fill: { style }` instead of `fillStyle`, and `TrafficAreaAnalyticsModule` `regionPolygon: { fill: { style } }` instead of `regionPolygon.fillStyle`; a feature's `properties.fillStyle` stays
|
|
30
|
+
- map: `RoutingModule` `width`, `sections.<type>.width` and `waypoints.size` are `widthPreset`, `sections.<type>.widthPreset` and `waypoints.sizePreset`
|
|
31
|
+
- map: `PlacesModule` `cluster.source` takes `radius`, `maxZoom`, `minPoints` and `properties` instead of MapLibre's `clusterRadius`, `clusterMaxZoom`, `clusterMinPoints` and `clusterProperties`, typed by `PlacesClusterSourceConfig`
|
|
32
|
+
- map: `PlacesModule` `label.offset` is `label.distance`, since an `offset` is an `[x, y]` displacement on every module
|
|
33
|
+
- map: `TrafficAreaAnalyticsModule` `height.maxHeightMeters` and `height.minHeightMeters` are `height.maxMeters` and `height.minMeters`, in `setHeight` too
|
|
34
|
+
- map: each renamed property's knob id follows it
|
|
35
|
+
- agent-toolkit: the tools keep their parameters, and the plugin needs SDK 1.0.0-rc.0
|
|
36
|
+
|
|
37
|
+
- [#2489](https://github.com/tomtom-internal/maps-sdk-js/pull/2489) [`640b53b`](https://github.com/tomtom-internal/maps-sdk-js/commit/640b53bf1c0ea20ce996053ee2f1a664310a381d) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: the map loads TomTom standard styles only, so a custom style URL or style JSON no longer loads
|
|
38
|
+
- `StyleInput` no longer takes `{ type: 'custom', url }` or `{ type: 'custom', json }`, and `CustomStyle` and `CustomStyleSource` are no longer exported
|
|
39
|
+
- `lightDarkTheme` is gone with them: `map.styleLightDarkTheme` follows from the standard style ID
|
|
40
|
+
- Restyle a standard style at runtime with `StylingFoundationsModule` and `setMapColors` instead
|
|
41
|
+
|
|
42
|
+
- [#2495](https://github.com/tomtom-internal/maps-sdk-js/pull/2495) [`530b895`](https://github.com/tomtom-internal/maps-sdk-js/commit/530b8955ebe0d6724b9dc14d5a0d08a37e4b4df8) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** core, services, map: the SDK no longer offers real-time EV charging availability, nor routes and reachable ranges planned on a vehicle consumption model; search results keep their static EV station data
|
|
43
|
+
- services: `evChargingStationsAvailability`, `getPlacesWithEVAvailability`, `getPlaceWithEVAvailability` and `hasChargingAvailability` are removed
|
|
44
|
+
- services: long-distance EV routing is removed: `vehicle.preferences`, `chargingStopsStrategy` and `chargingStopsStrategies`
|
|
45
|
+
- services: `vehicle` takes `model.dimensions.weightKG`, `state.heading` and `restrictions` only: `engineType`, `model.engine`, `model.variantId` and the charge and fuel state are removed, with the electric, combustion and generic vehicle types
|
|
46
|
+
- core: the reachable-range budgets `remainingChargePCT`, `spentChargePCT` and `spentFuelLiters` are removed; a budget is `timeMinutes` or `distanceKM`
|
|
47
|
+
- core: route and leg summaries lose their battery, charge and fuel fields and `chargingInformationAtEndOfLeg`, with `ChargingStop`
|
|
48
|
+
- core: `ChargingPark.availability`, `ChargingPoint.status` and `dataSources.chargingAvailability` are removed; `StaticChargingPoint` becomes `ChargingPoint`, and `ChargingStation` takes no type parameter
|
|
49
|
+
- map: `PlacesModule` loses `evAvailability`, `categoryIcons` entries lose `availabilityLevel`, and `RoutingModule` loses `chargingStops`, with their knobs, events and shown data
|
|
50
|
+
|
|
51
|
+
The *Upgrading to 1.0 from a 0.x release* guide lists every removed name.
|
|
52
|
+
|
|
53
|
+
- [#2507](https://github.com/tomtom-internal/maps-sdk-js/pull/2507) [`9ab7e7c`](https://github.com/tomtom-internal/maps-sdk-js/commit/9ab7e7c4e5e97950f9c6ba06ff228ac99393a3d4) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: each standard style ID is the Orbis style it loads, in camelCase
|
|
54
|
+
- map: `standardLight`, `standardDark`, `drivingLight`, `drivingDark` and `satellite` are `streetLight`, `streetDark`, `streetLightDriving`, `streetDarkDriving` and `streetSatellite`; `monoLight` and `monoDark` stay
|
|
55
|
+
- agent-toolkit: `setMapStandardStyle` takes the new IDs, `resetState` reverts to `streetLight`, and the plugin needs SDK 1.0.0-rc.0
|
|
56
|
+
- map-theme, landmarks-3d: their docs name the new IDs
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- [#2500](https://github.com/tomtom-internal/maps-sdk-js/pull/2500) [`d19d11d`](https://github.com/tomtom-internal/maps-sdk-js/commit/d19d11d41546bac2dd870560b9508bb0b3a2ce2a) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: the `maplibre-gl` peer dependency moves up to `^6.12.0`
|
|
61
|
+
|
|
62
|
+
- [#2506](https://github.com/tomtom-internal/maps-sdk-js/pull/2506) [`12099bd`](https://github.com/tomtom-internal/maps-sdk-js/commit/12099bdc040f3ce2d3990266bfb42024cda7956c) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - core, services, map: the package ships without source maps, so a stack trace through the SDK points into its minified bundles, which keep their function names
|
|
63
|
+
- An app's own source maps still lead a trace to the SDK's frames (`map/dist/map.es.js:1:84523`); share such a trace in a report and TomTom maps it back to the source
|
|
64
|
+
|
|
65
|
+
- [#2505](https://github.com/tomtom-internal/maps-sdk-js/pull/2505) [`308c3af`](https://github.com/tomtom-internal/maps-sdk-js/commit/308c3af3a5375b12293b2018413f4f78286739d6) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: `TerrainModule` sets the hillshade light's height and what its direction turns with, and the `multidirectional` method fans its four lights around the light's direction
|
|
66
|
+
- map: `hillshade.light.altitude`, in degrees above the horizon, and `hillshade.light.alignment`, `viewport` or `map` (`hillshadeLightAlignments`), in the config and as `terrainKnobCatalogue` knobs
|
|
67
|
+
- map: with `method: 'multidirectional'`, `hillshade.light.direction` is the centre of four lights spread over 135°
|
|
68
|
+
|
|
69
|
+
- [#2503](https://github.com/tomtom-internal/maps-sdk-js/pull/2503) [`a472dd0`](https://github.com/tomtom-internal/maps-sdk-js/commit/a472dd0183bbb6fb9c0da96ee18363e17b903b1f) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: `TrafficIncidentsModule` can show planned incidents, and its incident descriptions follow the map language
|
|
70
|
+
|
|
71
|
+
- `timeValidity: ['present', 'future']` brings scheduled roadworks and closures in next to the incidents under way, also as the `timeValidity` knob
|
|
72
|
+
- `description` is in the map language, or the nearest one the traffic service has (`pt-PT` for `pt-BR`), else English; `map.setLanguage` reloads the incident tiles when that changes
|
|
73
|
+
- core: `trafficIncidentTimeValidities` lists every `TrafficIncidentTimeValidity`, `present` first
|
|
74
|
+
|
|
75
|
+
## 0.64.0
|
|
76
|
+
|
|
77
|
+
### Minor Changes
|
|
78
|
+
|
|
79
|
+
- [#2477](https://github.com/tomtom-internal/maps-sdk-js/pull/2477) [`5b00d34`](https://github.com/tomtom-internal/maps-sdk-js/commit/5b00d34ea25ef436fe6ae53fa46b986837e4fcf7) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: CustomGeoJSONModule places its layers with `beforeLayerConfig`, as every other module does, and can still put a layer below any layer outside the style
|
|
80
|
+
- map: a layer's `beforeID: mapStyleLayerIDs.lowestLabel` is `beforeLayerConfig: 'lowestLabel'`; `beforeLayerConfig: { layerID }` goes below another layer, such as one of this or another module's
|
|
81
|
+
- map: `beforeLayerConfig` on the module places every layer that sets none, `'top'` by default
|
|
82
|
+
- agent-toolkit: `setByodLayers` keeps its `beforeID` parameter and needs SDK 0.64.0
|
|
83
|
+
|
|
84
|
+
- [#2477](https://github.com/tomtom-internal/maps-sdk-js/pull/2477) [`5b00d34`](https://github.com/tomtom-internal/maps-sdk-js/commit/5b00d34ea25ef436fe6ae53fa46b986837e4fcf7) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: the event-state methods are `setEventState`, `clearEventState` and `clearEventStates`, and the style-owned modules' `getShown()` is `getRenderedFeatures()`
|
|
85
|
+
- map: `putEventState`, `cleanEventState` and `cleanEventStates` are renamed on every data-owned module and its named scopes; `PutEventStateOptions`, `CleanEventStateOptions` and `CleanEventStatesOptions` are `SetEventStateOptions`, `ClearEventStateOptions` and `ClearEventStatesOptions`
|
|
86
|
+
- map: `POIsModule`, `TrafficFlowModule` and `TrafficIncidentsModule` `getShown()` is `getRenderedFeatures()`, what their tiles render in view; the data-owned modules keep `getShown()`, the data `show` was given
|
|
87
|
+
|
|
88
|
+
- [#2477](https://github.com/tomtom-internal/maps-sdk-js/pull/2477) [`5b00d34`](https://github.com/tomtom-internal/maps-sdk-js/commit/5b00d34ea25ef436fe6ae53fa46b986837e4fcf7) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: every module's `highlight` names the part it changes, then the property, so the hovered and clicked look reads the same across modules
|
|
89
|
+
- RoutingModule: `highlight: { outlineWidthFactor }` is `highlight: { outline: { widthFactor } }`, knob id `highlight.outline.widthFactor`
|
|
90
|
+
- GeometriesModule and ReachableRangesModule: `highlight: { fillOpacityFactor, lineWidthFactor }` is `highlight: { fill: { opacityFactor }, line: { widthFactor } }`, knob ids `highlight.fill.opacityFactor` and `highlight.line.widthFactor`
|
|
91
|
+
- TrafficIncidentDetailsModule: `highlight: { outlineColor, widthFactor }` is `highlight: { outline: { color }, line: { widthFactor } }`, knob ids `highlight.outline.color` and `highlight.line.widthFactor`
|
|
92
|
+
|
|
93
|
+
- [#2480](https://github.com/tomtom-internal/maps-sdk-js/pull/2480) [`060ab3d`](https://github.com/tomtom-internal/maps-sdk-js/commit/060ab3dd3a9e01bbaa8f870fdad1703e674bd110) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services, map: a `commonBaseURL` on `http:` is refused unless it is a loopback address (`localhost`, `127.0.0.0/8`, `[::1]`), so the API key never travels in the clear
|
|
94
|
+
- services: such a call rejects with an `SDKError` coded `INSECURE_BASE_URL` before any request, even with `validateRequest: false`
|
|
95
|
+
- map: the `TomTomMap` constructor throws a `TomTomMapError` coded `INSECURE_BASE_URL`
|
|
96
|
+
- a relative base URL, such as `/api`, still follows the page
|
|
97
|
+
|
|
98
|
+
- [#2477](https://github.com/tomtom-internal/maps-sdk-js/pull/2477) [`5b00d34`](https://github.com/tomtom-internal/maps-sdk-js/commit/5b00d34ea25ef436fe6ae53fa46b986837e4fcf7) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map, services: internals that were exported without documentation are no longer exported
|
|
99
|
+
- map: `EventsProxy`, `sharedInstance`, `TomTomMapSource`, `InternalTomTomMapParams`, `poiLayerIDs`, `buildRoutingLayers` and `ROUTE_LINE_OUTLINE_COLOR`, whose value the upgrade guide gives
|
|
100
|
+
- services: the geometry data wire-format types `GeometryDataResponseAPI` and `AdditionalDataAPI`
|
|
101
|
+
- flyover: the arrow marker keeps its default fill, now defined in the plugin rather than imported from the SDK
|
|
102
|
+
|
|
103
|
+
- [#2477](https://github.com/tomtom-internal/maps-sdk-js/pull/2477) [`5b00d34`](https://github.com/tomtom-internal/maps-sdk-js/commit/5b00d34ea25ef436fe6ae53fa46b986837e4fcf7) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: a shape's edge is its outline and a label's is its halo, in every module
|
|
104
|
+
- map: the map colour `labelOutline` is `labelHalo`, knob id `colors.labelHalo`
|
|
105
|
+
- map: PlacesModule `cluster.badge.strokeColor` and `strokeWidth` are `outlineColor` and `outlineWidth`, knob ids `cluster.badge.outlineColor` and `cluster.badge.outlineWidth`
|
|
106
|
+
- map-theme: `deriveMapColors`, `deriveMapColorsFromCss` and `deriveMapColorsFromImage` return `labelHalo` in place of `labelOutline`, and need SDK 0.64.0
|
|
107
|
+
|
|
108
|
+
- [#2477](https://github.com/tomtom-internal/maps-sdk-js/pull/2477) [`5b00d34`](https://github.com/tomtom-internal/maps-sdk-js/commit/5b00d34ea25ef436fe6ae53fa46b986837e4fcf7) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: ReachableRangesModule's border labels are `lineLabel`, as GeometriesModule names the labels along a line
|
|
109
|
+
- `label` is `lineLabel`, its knob ids `lineLabel.*`, and `ReachableRangeLabelConfig` is `ReachableRangeLineLabelConfig`
|
|
110
|
+
|
|
111
|
+
- [#2477](https://github.com/tomtom-internal/maps-sdk-js/pull/2477) [`5b00d34`](https://github.com/tomtom-internal/maps-sdk-js/commit/5b00d34ea25ef436fe6ae53fa46b986837e4fcf7) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services: `getSearchSuggestions` takes `limit` and `geoBias: { position }`, as the other searches name them
|
|
112
|
+
- `getSearchSuggestions({ maxResults: 8, origin: [4.9, 52.37] })` is `getSearchSuggestions({ limit: 8, geoBias: { position: [4.9, 52.37] } })`; defaults and behaviour are unchanged
|
|
113
|
+
|
|
114
|
+
- [#2480](https://github.com/tomtom-internal/maps-sdk-js/pull/2480) [`060ab3d`](https://github.com/tomtom-internal/maps-sdk-js/commit/060ab3dd3a9e01bbaa8f870fdad1703e674bd110) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services, map: every SDK error names what went wrong in a `code`, one of `SDKErrorCode`, and carries the `sdkVersion` that raised it
|
|
115
|
+
- core: `sdkErrorCodes` lists the codes: `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`
|
|
116
|
+
- services: a request that gets no response rejects with `NETWORK_ERROR`, keeping what `fetch` threw as its `cause`
|
|
117
|
+
- **Breaking:** services: `SDKError`'s third constructor argument is an options object, `{ code, issues?, cause? }`, instead of the Zod issues
|
|
118
|
+
- map: `TomTomMap.addErrorHandler` receives every failure after construction as a `TomTomMapError`: a style, tile, sprite or glyph that failed to load, with its `status` and `sourceId`, and a lost WebGL context
|
|
119
|
+
- map: the `TomTomMap` constructor throws a `TomTomMapError` with `WEBGL_UNSUPPORTED` when the browser has no WebGL2, and `setStyle` rejects with one when the style fails to load
|
|
120
|
+
|
|
121
|
+
- [#2480](https://github.com/tomtom-internal/maps-sdk-js/pull/2480) [`060ab3d`](https://github.com/tomtom-internal/maps-sdk-js/commit/060ab3dd3a9e01bbaa8f870fdad1703e674bd110) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** core, services, map: 37 internal helpers and types are no longer exported, or no longer in the published types
|
|
122
|
+
- **Breaking:** core: `bboxExpandedWithPosition`, `bboxExpandedWithBBox`, `bboxExpandedWithGeoJSON`, `toPointFeature`
|
|
123
|
+
- **Breaking:** services: `ServiceTemplate`, `ParseResponseError`, `ParsedFetchResponse`, `RequestOptions`, `parseDefaultResponseError`, `buildResponseError`, `buildValidationError`
|
|
124
|
+
- **Breaking:** map: `renderedRefId`, `findFeatureByRefId`, `filterLayersBySources`, `withEventState`, `combineEventScopes`, `scopedLayerSpecs`, `reservedScopeNames`, `assertNoReservedScopeNames`, `getIconIDForPlace`, `getPOIGroupForPlace`, `getPOILayerCategoryForPlace`, `STOP_DISPLAY_LABEL`, `getStyleCategories`
|
|
125
|
+
- **Breaking:** core: helpers its packages share are left out of the published types, so TypeScript no longer resolves them: `mergeFromGlobal`, `TomTomHeaders`, `generateTomTomHeaders`, `bboxOnlyIfWithArea`, `getPositionStrict`, `toPointGeometry`, `poiCategoriesToID`, `poiCategoriesToIDs`, `poiIDsToCategories`, `getRoutePlanningLocationType`, `iconToTrafficIncidentCategory`, `trafficIncidentToIconCategory`, `MILE_IN_METERS`
|
|
126
|
+
|
|
127
|
+
### Patch Changes
|
|
128
|
+
|
|
129
|
+
- [#2479](https://github.com/tomtom-internal/maps-sdk-js/pull/2479) [`b6ec343`](https://github.com/tomtom-internal/maps-sdk-js/commit/b6ec3438fb953ba344dbdc5a9c3cf5c0c4190e03) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: `MapLibreOptions` no longer accepts `transformRequest`, which the SDK sets itself, so a value that never took effect is now a type error
|
|
130
|
+
- route TomTom requests through a proxy of your own with `commonBaseURL` instead
|
|
131
|
+
|
|
132
|
+
- [#2475](https://github.com/tomtom-internal/maps-sdk-js/pull/2475) [`564bee4`](https://github.com/tomtom-internal/maps-sdk-js/commit/564bee4d44d79a2a6a66290115f3214afadfa090) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: a Vite build or dev server renders the map with no MapLibre worker setup: `TomTomMap` starts MapLibre's web worker from the copy Vite builds out of your own `maplibre-gl`, served from your app's origin
|
|
133
|
+
- `registerMapLibreWorker: false` keeps MapLibre's own worker lookup
|
|
134
|
+
- MapLibre's own lookup also stays in place when you already called its `setWorkerUrl`, when MapLibre loads unbundled from a CDN, and under webpack's default classic workers
|
|
135
|
+
|
|
136
|
+
- [#2479](https://github.com/tomtom-internal/maps-sdk-js/pull/2479) [`b6ec343`](https://github.com/tomtom-internal/maps-sdk-js/commit/b6ec3438fb953ba344dbdc5a9c3cf5c0c4190e03) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - core: a partial `retry` passed to `TomTomConfig.instance.put` takes its missing fields from the default retry config
|
|
137
|
+
- `put({ retry: { timeoutMs: 10000 } })` no longer leaves `initialWaitMs` and `backoffFactor` undefined, which made `429` retries wait `NaN` milliseconds
|
|
138
|
+
|
|
139
|
+
- [#2480](https://github.com/tomtom-internal/maps-sdk-js/pull/2480) [`060ab3d`](https://github.com/tomtom-internal/maps-sdk-js/commit/060ab3dd3a9e01bbaa8f870fdad1703e674bd110) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - core: `sendUserAgentHeader: false` in the global config, or in a map's or a service call's params, stops requests from carrying the `tomtom-user-agent` header
|
|
140
|
+
|
|
141
|
+
- [#2479](https://github.com/tomtom-internal/maps-sdk-js/pull/2479) [`b6ec343`](https://github.com/tomtom-internal/maps-sdk-js/commit/b6ec3438fb953ba344dbdc5a9c3cf5c0c4190e03) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - services, map: import as values the catalogues that only exported their types
|
|
142
|
+
- services: `arrivalSides`, `chargingStopsStrategies` and `functionalRoadClasses` from `@tomtom-org/maps-sdk/services`, as `routeTypes` already is
|
|
143
|
+
- map: `AREA_ANALYTICS_DEFAULTS` from `@tomtom-org/maps-sdk/map`
|
|
144
|
+
|
|
3
145
|
## 0.63.0
|
|
4
146
|
|
|
5
147
|
### Minor Changes
|
package/LICENSE.txt
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
TOMTOM MAPS SDK FOR JAVASCRIPT LICENSE AGREEMENT (“AGREEMENT”)
|
|
2
2
|
|
|
3
|
-
Last update:
|
|
3
|
+
Last update: October 2026
|
|
4
4
|
|
|
5
|
-
By downloading or accessing the “TomTom Maps SDK for JavaScript” (the “SDK”), you are entering into a binding agreement with TomTom Global Content B.V. (“TomTom”). The SDK comprises all software, binaries and source code made available by TomTom for it, whether through the TomTom Developer Portal or public code repositories (e.g. GitHub). This Agreement with TomTom consists of the terms and conditions below together with the Data Processing Schedule. You should not use the SDK if you cannot agree to both.
|
|
5
|
+
By downloading or accessing the “TomTom Maps SDK for JavaScript” (the “SDK”), you are entering into a binding agreement with TomTom Global Content B.V. (“TomTom”). The SDK comprises all software, binaries and source code made available by TomTom for it, whether through the TomTom Developer Portal, package registries (e.g. npm) or otherwise. The example applications that TomTom publishes in public code repositories (e.g. GitHub) are not part of the SDK: they are licensed separately, under the license distributed with them. This Agreement with TomTom consists of the terms and conditions below together with the Data Processing Schedule. You should not use the SDK if you cannot agree to both.
|
|
6
6
|
|
|
7
7
|
You may not use the SDK or accept this Agreement if you are barred from receiving it under the laws of the European Union or of any other country, including the country in which you are resident or from which you use the SDK. If you accept this Agreement on behalf of your employer or another entity, you represent and warrant that you have full legal authority to bind that employer or entity. If you do not have that authority, you may not accept this Agreement or use the SDK on their behalf.
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ You may not use the SDK or accept this Agreement if you are barred from receivin
|
|
|
14
14
|
|
|
15
15
|
3.1. You agree to use the SDK only for purposes permitted by (a) this Agreement and (b) any applicable law, regulation or generally accepted practice or guideline in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
|
|
16
16
|
|
|
17
|
-
3.2. Other than as permitted by applicable legislation, you are prohibited from copying (except for backup purposes), modifying, adapting, (re)distributing, renting, lending, publicly presenting, decompiling, reverse engineering, disassembling or creating derivative works of the SDK or any part of it. Notwithstanding the foregoing,
|
|
17
|
+
3.2. Other than as permitted by applicable legislation, you are prohibited from copying (except for backup purposes), modifying, adapting, (re)distributing, renting, lending, publicly presenting, decompiling, reverse engineering, disassembling or creating derivative works of the SDK or any part of it. Notwithstanding the foregoing, you may inspect the SDK as distributed to you, including any source code embedded in its source maps, solely for the purpose of debugging your Permitted Application, provided that it is not shared or redistributed. The readability of the SDK’s source code in its distribution does not constitute “Open-Source” licensing and grants you no rights under any Open Source Initiative (OSI) approved license, nor shall it be construed as a grant of rights to modify, fork or redistribute the SDK beyond those expressly granted in Clause 1 and this Clause 3.2.
|
|
18
18
|
|
|
19
19
|
3.3. You may not use the SDK in connection with any illegal, fraudulent, dishonest or unethical activity or behaviour, and in particular not to create or develop, or help others create or develop, a product, service or library that competes, directly or indirectly, with the SDK or the TomTom APIs.
|
|
20
20
|
|
|
@@ -78,7 +78,7 @@ You may not use the SDK or accept this Agreement if you are barred from receivin
|
|
|
78
78
|
|
|
79
79
|
11.4. The TomTom APIs and the SDK are provided as “Commercial Computer Software” or “restricted computer software”. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions set forth in 48 C.F.R. Section 12.212 or 48 C.F.R. 227.2702, as applicable, or successor provisions. In respect of the Map API and Search API, the manufacturer is TomTom Global Content B.V.
|
|
80
80
|
|
|
81
|
-
11.5. By submitting any suggestion, bug fix or code contribution (“Contribution”) to TomTom (e.g. via a GitHub
|
|
81
|
+
11.5. By submitting any suggestion, bug fix or code contribution (“Contribution”) to TomTom (e.g. via a GitHub issue or discussion), you grant TomTom a perpetual, irrevocable, worldwide, royalty-free and non-exclusive license to use, reproduce, modify and distribute the Contribution as part of the SDK. You represent that you have the legal right to grant this license and that the Contribution does not infringe any third-party intellectual property rights.
|
|
82
82
|
|
|
83
83
|
THIRD PARTY SOFTWARE NOTICES
|
|
84
84
|
|
package/README.md
CHANGED
|
@@ -2,158 +2,177 @@
|
|
|
2
2
|
|
|
3
3
|
# TomTom Maps SDK for JavaScript
|
|
4
4
|
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
5
|
+
[**Examples**](https://docs.tomtom.com/maps-sdk-js/examples/) |
|
|
6
|
+
[**Documentation**](https://docs.tomtom.com/maps-sdk-js/introduction/overview) |
|
|
7
|
+
[**API reference**](https://docs.tomtom.com/maps-sdk-js/api-reference/index.html) |
|
|
8
|
+
[**Release notes**](https://docs.tomtom.com/maps-sdk-js/introduction/release-notes)
|
|
9
9
|
|
|
10
10
|
[](https://www.npmjs.com/package/@tomtom-org/maps-sdk)
|
|
11
11
|
|
|
12
12
|

|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
**Maps SDK for JavaScript** is a **JavaScript/TypeScript** library for building applications with **TomTom** maps and location APIs.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
It is built on [MapLibre GL JS](https://docs.tomtom.com/maps-sdk-js/guides/map/about-maplibre) and [GeoJSON](https://geojson.org/): TomTom maps and services work together out of the box, and the MapLibre map stays fully exposed, so its API and plugin ecosystem work alongside the SDK.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
to seamlessly integrate TomTom maps and services with convenient out-of-the-box support, while staying highly customizable and extensible.
|
|
20
|
-
<br/><br/>
|
|
18
|
+
> Some capabilities of the SDK are released under [Public Preview](https://docs.tomtom.com/legal/public-preview) to collect feedback from the community. The [release notes](https://docs.tomtom.com/maps-sdk-js/introduction/release-notes) list what changes in each release.
|
|
21
19
|
|
|
22
|
-
##
|
|
23
|
-
We have released some capabilities in the Maps SDK under [Public Preview](https://docs.tomtom.com/legal/public-preview) to collect feedback from the community.
|
|
24
|
-
- While our goal is to keep the design of the interface stable, breaking changes will occur, particularly in the earlier versions.
|
|
25
|
-
- The versions will follow a 0.MAJOR.MINOR pattern for the time being.
|
|
26
|
-
- Stay tuned with our release `CHANGELOG.md` files.
|
|
27
|
-
<br/><br/>
|
|
20
|
+
## Quickstart
|
|
28
21
|
|
|
29
|
-
|
|
22
|
+
1. **Get your TomTom API key** at [my.tomtom.com](https://my.tomtom.com/), following [these instructions](https://docs.tomtom.com/platform/documentation/dashboard/api-key-management). Before you ship, decide [where your API key runs](https://docs.tomtom.com/maps-sdk-js/guides/security/where-your-api-key-runs).
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
# npm and Yarn install the peer dependencies for you
|
|
33
|
-
npm i @tomtom-org/maps-sdk
|
|
24
|
+
2. **Install the SDK:**
|
|
34
25
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
```bash
|
|
27
|
+
# npm and Yarn install the peer dependencies for you
|
|
28
|
+
npm install @tomtom-org/maps-sdk
|
|
38
29
|
|
|
39
|
-
|
|
30
|
+
# pnpm does not, unless you ask it to
|
|
31
|
+
echo "auto-install-peers=true" >> .npmrc && pnpm add @tomtom-org/maps-sdk
|
|
32
|
+
```
|
|
40
33
|
|
|
41
|
-
**
|
|
34
|
+
3. **Using an AI coding agent? Install the SDK skill** in your project root, for Claude Code, Cursor, GitHub Copilot, Windsurf and [many more](https://www.npmjs.com/package/skills#available-agents):
|
|
42
35
|
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
```bash
|
|
37
|
+
npx skills add tomtom-international/maps-sdk-js --skill tomtom-maps-sdk-js
|
|
38
|
+
```
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
The skill loads the SDK's patterns, coordinate conventions, service APIs and pitfalls into the agent's context, so the agent writes code against the real API instead of guessing it. Commit it so the whole team gets it. [AI coding with the SDK](https://docs.tomtom.com/maps-sdk-js/guides/ai-coding) lists the topics it covers and how to invoke them.
|
|
47
41
|
|
|
48
|
-
**
|
|
42
|
+
4. **Start building.** Services return GeoJSON, and map modules show it unchanged:
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- **Your own GeoJSON (BYOD)** — `CustomGeoJSONModule`
|
|
55
|
-
- **Traffic** — flow (`TrafficFlowModule`), incidents (`TrafficIncidentsModule`, `TrafficIncidentDetailsModule`) and area analytics (`TrafficAreaAnalyticsModule`)
|
|
56
|
-
- **Terrain** — hillshade shading and 3D elevation, `TerrainModule`
|
|
57
|
-
- **Click, hover and context-menu events**, one typed surface per module — `module.events.on(…)`
|
|
44
|
+
```ts
|
|
45
|
+
import { TomTomConfig } from '@tomtom-org/maps-sdk/core';
|
|
46
|
+
import { PlacesModule, RoutingModule, TomTomMap } from '@tomtom-org/maps-sdk/map';
|
|
47
|
+
import { calculateRoute, discoverPlaces } from '@tomtom-org/maps-sdk/services';
|
|
58
48
|
|
|
59
|
-
|
|
49
|
+
TomTomConfig.instance.put({ apiKey: 'YOUR_API_KEY', language: 'en-GB' });
|
|
60
50
|
|
|
61
|
-
|
|
62
|
-
- **Geocoding and reverse geocoding** — `geocode`, `geocodeOne`, `reverseGeocode`
|
|
63
|
-
- **Routing** — `calculateRoute`, with up to five alternatives, turn-by-turn guidance, toll/ferry/traffic sections and vehicle restrictions
|
|
64
|
-
- **Isochrones (reachable range)** — `calculateReachableRange`, `calculateReachableRanges`, by time, distance, fuel or electric-energy budget (private preview: the API key needs Calculate Reachable Range access)
|
|
65
|
-
- **EV charging** — `evChargingStationsAvailability`, `getPlaceWithEVAvailability`
|
|
66
|
-
- **Traffic** — `trafficIncidentDetails`, `trafficAreaAnalytics`
|
|
67
|
-
- **Geometry data** — `geometryData` for administrative boundaries
|
|
68
|
-
- **Cancellation** — `createLatestRequest` keeps only the latest of a series (search-as-you-type, refetch on map move); every call also accepts an abort signal
|
|
69
|
-
<br/><br/>
|
|
51
|
+
const map = new TomTomMap({ mapLibre: { container: 'map', center: [4.9, 52.37], zoom: 12 } });
|
|
70
52
|
|
|
71
|
-
|
|
53
|
+
const places = await PlacesModule.create(map);
|
|
54
|
+
await places.show(await discoverPlaces({ query: 'coffee', geoBias: { position: [4.9, 52.37] } }));
|
|
72
55
|
|
|
73
|
-
|
|
56
|
+
const routing = await RoutingModule.create(map);
|
|
57
|
+
await routing.showRoutes(await calculateRoute({ locations: [[4.9, 52.37], [5.12, 52.09]] }));
|
|
58
|
+
```
|
|
74
59
|
|
|
75
|
-
|
|
76
|
-
import { NavigationControl } from 'maplibre-gl';
|
|
60
|
+
Then follow the [Map quickstart](https://docs.tomtom.com/maps-sdk-js/guides/map/quickstart) or the [Services quickstart](https://docs.tomtom.com/maps-sdk-js/guides/services/quickstart), or start from a runnable app in the [examples gallery](https://docs.tomtom.com/maps-sdk-js/examples/).
|
|
77
61
|
|
|
78
|
-
|
|
79
|
-
map.mapLibreMap.on('moveend', () => console.log(map.mapLibreMap.getCenter()));
|
|
80
|
-
```
|
|
62
|
+
### Requirements
|
|
81
63
|
|
|
82
|
-
|
|
83
|
-
|
|
64
|
+
- **Node.js 24+** at install time, the minimum the package declares, whether or not you target the browser.
|
|
65
|
+
- **A browser with WebGL** for the Map bundle.
|
|
66
|
+
- **A bundler** such as Vite or webpack: the SDK ships as ES modules. Under Vite, `TomTomMap` sets up MapLibre's web worker on its own; [Vite projects](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup#vite-projects) says when another bundler, such as webpack, needs it set up by hand.
|
|
67
|
+
- **Peer dependencies**, installed by the commands above: MapLibre GL JS 6.12+, Turf 7, culori 4, Lodash 4 and Zod 4.
|
|
68
|
+
- **TypeScript is optional**: the type definitions ship with the package, with no `@types` package to install.
|
|
84
69
|
|
|
85
|
-
|
|
70
|
+
[Project setup](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup) has the full requirements and the [React, Vue and Node.js](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup#framework-specific-setup) setups.
|
|
86
71
|
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
npx skills add tomtom-international/maps-sdk-js --skill tomtom-maps-sdk-js
|
|
90
|
-
```
|
|
72
|
+
## Bundles
|
|
91
73
|
|
|
92
|
-
|
|
74
|
+
One package, `@tomtom-org/maps-sdk`, carries three bundles:
|
|
93
75
|
|
|
94
|
-
|
|
76
|
+
| Bundle | Import path | Runs in | Holds |
|
|
77
|
+
| --- | --- | --- | --- |
|
|
78
|
+
| [**Map**](https://docs.tomtom.com/maps-sdk-js/guides/map/quickstart) | `@tomtom-org/maps-sdk/map` | Browser | `TomTomMap` and its modules for places, routes, traffic and more |
|
|
79
|
+
| [**Services**](https://docs.tomtom.com/maps-sdk-js/guides/services/quickstart) | `@tomtom-org/maps-sdk/services` | Browser, Node.js, React Native | One function per TomTom API, most returning GeoJSON |
|
|
80
|
+
| [**Core**](https://docs.tomtom.com/maps-sdk-js/guides/core/quickstart) | `@tomtom-org/maps-sdk/core` | Anywhere | The shared configuration, types and utilities |
|
|
95
81
|
|
|
96
|
-
|
|
97
|
-
- **[Context7 index](https://context7.com/tomtom-international/maps-sdk-js)** — this repository, indexed for agents using the Context7 MCP server
|
|
98
|
-
- **[`examples/`](https://github.com/tomtom-international/maps-sdk-js/tree/main/examples)** — 95 runnable apps, the best code to copy from
|
|
99
|
-
<br/><br/>
|
|
100
|
-
## How it works
|
|
82
|
+
[How the SDK works](https://docs.tomtom.com/maps-sdk-js/guides/how-the-sdk-works) shows how the three fit together. Everything is tree-shakable: your bundle carries only the modules and services you import.
|
|
101
83
|
|
|
102
|
-
|
|
84
|
+
## What you can build
|
|
103
85
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
86
|
+
### Map
|
|
87
|
+
|
|
88
|
+
An interactive vector map in seven [TomTom styles](https://docs.tomtom.com/maps-sdk-js/guides/map/styles#built-in-styles) (`streetLight`, `streetDark`, `streetLightDriving`, `streetDarkDriving`, `monoLight`, `monoDark` and `streetSatellite`), [switching between them](https://docs.tomtom.com/maps-sdk-js/guides/map/styles#dynamic-style-switching) at runtime, in the [map language](https://docs.tomtom.com/maps-sdk-js/guides/map/styles#map-language) of your choice. [Map modules](https://docs.tomtom.com/maps-sdk-js/guides/map/modules) draw on it:
|
|
89
|
+
|
|
90
|
+
- **[Places](https://docs.tomtom.com/maps-sdk-js/guides/map/places)**: search results as markers, with [styling](https://docs.tomtom.com/maps-sdk-js/guides/map/places-styling), clustering, and [connections and entry points](https://docs.tomtom.com/maps-sdk-js/guides/map/places-connections-and-entry-points)
|
|
91
|
+
- **[Routes](https://docs.tomtom.com/maps-sdk-js/guides/map/routes)**: alternatives, waypoints, [route sections](https://docs.tomtom.com/maps-sdk-js/guides/map/routes-sections) for traffic, tolls and ferries, and [route styling](https://docs.tomtom.com/maps-sdk-js/guides/map/routes-styling)
|
|
92
|
+
- **[Geometries](https://docs.tomtom.com/maps-sdk-js/guides/map/geometries)** and **[reachable ranges](https://docs.tomtom.com/maps-sdk-js/guides/map/reachable-ranges)**: polygons, administrative boundaries and isochrones
|
|
93
|
+
- **[Custom GeoJSON](https://docs.tomtom.com/maps-sdk-js/guides/map/custom)**: your own data, on layers that survive style switches and take part in the map's events
|
|
94
|
+
- **[Traffic](https://docs.tomtom.com/maps-sdk-js/guides/map/traffic)**: [flow](https://docs.tomtom.com/maps-sdk-js/guides/map/traffic-flow), [incidents](https://docs.tomtom.com/maps-sdk-js/guides/map/traffic-incidents), [planned ones](https://docs.tomtom.com/maps-sdk-js/guides/map/traffic-incidents#planned-incidents) included, [incident details](https://docs.tomtom.com/maps-sdk-js/guides/map/traffic-incident-details) and [area analytics](https://docs.tomtom.com/maps-sdk-js/guides/map/traffic-area-analytics-module)
|
|
95
|
+
- **[Base map](https://docs.tomtom.com/maps-sdk-js/guides/map/base-map)** and **[POIs](https://docs.tomtom.com/maps-sdk-js/guides/map/pois)**: show or hide layer groups such as 3D buildings and road shields, and filter the base map's points of interest
|
|
96
|
+
- **[Terrain](https://docs.tomtom.com/maps-sdk-js/guides/map/terrain)**: hillshade relief with its own light and colours, and 3D elevation
|
|
97
|
+
- **[Events](https://docs.tomtom.com/maps-sdk-js/guides/map/events)**: click, hover and context-menu events on every module, and module events such as `config-change`
|
|
98
|
+
|
|
99
|
+
[Map styling](https://docs.tomtom.com/maps-sdk-js/guides/map/styling) restyles the loaded map through **semantic knobs** instead of layer ids:
|
|
108
100
|
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
- **Every setting as data**: each module lists its settings in a knob catalogue, and `setKnob`, `getKnob` and `resetKnob` [set one by its id](https://docs.tomtom.com/maps-sdk-js/guides/map/modules#setting-a-knob-by-its-id), validated, on any module.
|
|
102
|
+
- **Map-wide sizes and colours**: label, icon and road sizes, and the [ten map colours and the accent](https://docs.tomtom.com/maps-sdk-js/guides/map/styling-map-colors) that routes, geometries and pins take.
|
|
103
|
+
- **[Presets](https://docs.tomtom.com/maps-sdk-js/guides/map/styling#presets)**: `applyMapPreset` sets a whole look in one call.
|
|
104
|
+
- **[Globe and sky](https://docs.tomtom.com/maps-sdk-js/guides/map/styling-globe-and-sky)**: globe projection, sky and horizon.
|
|
105
|
+
- **[Geopolitical views](https://docs.tomtom.com/maps-sdk-js/guides/core/geopolitical-views)**: disputed borders and territories as one country sees them, on the map and in search.
|
|
111
106
|
|
|
112
|
-
|
|
107
|
+
### Services
|
|
113
108
|
|
|
114
|
-
|
|
115
|
-
const places = await PlacesModule.create(map);
|
|
116
|
-
places.show(await discoverPlaces({ query: 'coffee' }));
|
|
109
|
+
Typed GeoJSON from the TomTom APIs, with or without a map:
|
|
117
110
|
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
- **[Search](https://docs.tomtom.com/maps-sdk-js/guides/services/places/search)**: `discoverPlaces`, [search suggestions](https://docs.tomtom.com/maps-sdk-js/guides/services/places/suggest), [place details](https://docs.tomtom.com/maps-sdk-js/guides/services/places/place-by-id) and [POI categories](https://docs.tomtom.com/maps-sdk-js/guides/services/places/poi-categories)
|
|
112
|
+
- **[Geocoding](https://docs.tomtom.com/maps-sdk-js/guides/services/places/geocoding)** and **[reverse geocoding](https://docs.tomtom.com/maps-sdk-js/guides/services/places/reverse-geocoding)**: `geocode`, `geocodeOne` and `reverseGeocode`
|
|
113
|
+
- **[Routing](https://docs.tomtom.com/maps-sdk-js/guides/services/routing/quickstart)**: `calculateRoute`, with alternatives, [guidance](https://docs.tomtom.com/maps-sdk-js/guides/services/routing/guidance) and [vehicle restrictions](https://docs.tomtom.com/maps-sdk-js/guides/services/routing/vehicle)
|
|
114
|
+
- **[Reachable ranges](https://docs.tomtom.com/maps-sdk-js/guides/services/routing/reachable-ranges)**: isochrones by time or distance budget, in Private Preview
|
|
115
|
+
- **Traffic**: [incident details](https://docs.tomtom.com/maps-sdk-js/guides/services/traffic/traffic-incident-details) and [area analytics](https://docs.tomtom.com/maps-sdk-js/guides/services/traffic/traffic-area-analytics)
|
|
116
|
+
- **[Geometry data](https://docs.tomtom.com/maps-sdk-js/guides/services/places/geometry-data)**: administrative boundaries for a search result
|
|
117
|
+
- **[Request options and errors](https://docs.tomtom.com/maps-sdk-js/guides/services/request-options-and-errors)**: request validation, [cancellation](https://docs.tomtom.com/maps-sdk-js/guides/services/request-options-and-errors#cancelling-a-request) and deadlines, and [errors](https://docs.tomtom.com/maps-sdk-js/guides/services/request-options-and-errors#error-handling) that name what went wrong with an `SDKErrorCode`
|
|
118
|
+
|
|
119
|
+
### Plugins
|
|
120
|
+
|
|
121
|
+
Separate packages, each declaring the SDK as a peer dependency:
|
|
122
|
+
|
|
123
|
+
| Plugin | What it does |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| [**Agent Toolkit**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/overview) | Lets your users plan routes, search places and restyle the map in natural language, with the LLM and chat UI of your choice |
|
|
126
|
+
| [**Map Theme**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/map-theme) | Themes the map from a brand's swatches, your page's CSS, a logo or a photo |
|
|
127
|
+
| [**Map Effects**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/map-effects) | Post-processing such as bloom, depth of field, colour grading and vignette, on any style |
|
|
128
|
+
| [**Fly-over**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/flyover) | A camera that flies along a route, framing the junctions ahead |
|
|
129
|
+
| [**Viewport places**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/viewport-places) | Keeps search results for the visible map area on the map as it moves |
|
|
130
|
+
| [**Landmarks 3D**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/landmarks-3d) | Detailed 3D models of recognizable buildings, in Private Preview |
|
|
131
|
+
|
|
132
|
+
## Coming from MapLibre GL JS
|
|
133
|
+
|
|
134
|
+
The map **is** a MapLibre map. `TomTomMap` wraps a MapLibre `Map` and keeps it reachable as `map.mapLibreMap`, so the MapLibre code, controls and plugins you already have keep working:
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
import { NavigationControl } from 'maplibre-gl';
|
|
138
|
+
|
|
139
|
+
map.mapLibreMap.addControl(new NavigationControl(), 'top-right');
|
|
140
|
+
map.mapLibreMap.on('moveend', () => console.log(map.mapLibreMap.getCenter()));
|
|
120
141
|
```
|
|
121
|
-
<br/><br/>
|
|
122
142
|
|
|
123
|
-
|
|
143
|
+
Where the SDK has a feature for the job, prefer it: it survives style switches and style releases, and its events coordinate across modules. [About MapLibre](https://docs.tomtom.com/maps-sdk-js/guides/map/about-maplibre#when-to-use-tomtom-sdk-vs-direct-maplibre) says which to use when.
|
|
124
144
|
|
|
125
|
-
|
|
126
|
-
- **[Getting Started](https://docs.tomtom.com/maps-sdk-js/introduction/overview)** — introduction and project setup
|
|
127
|
-
- **[API Reference](https://docs.tomtom.com/maps-sdk-js/api-reference/index.html)** — complete API documentation
|
|
128
|
-
- **[Release Notes](https://docs.tomtom.com/maps-sdk-js/introduction/release-notes)** — what's new and breaking changes
|
|
129
|
-
- **[What the SDK sends, and where](https://docs.tomtom.com/maps-sdk-js/guides/security/what-the-sdk-sends)** — the data your users' browsers send to TomTom, for your privacy notice
|
|
130
|
-
<br/><br/>
|
|
145
|
+
## Security and privacy
|
|
131
146
|
|
|
132
|
-
|
|
147
|
+
- [**Where your API key runs**](https://docs.tomtom.com/maps-sdk-js/guides/security/where-your-api-key-runs): a key used from the browser can be read by anyone who opens the page; a key used from Node.js cannot.
|
|
148
|
+
- [**Proxying your API calls**](https://docs.tomtom.com/maps-sdk-js/guides/security/proxying-api-calls): keep the key on your server by routing the SDK's requests through your own proxy, then [harden that proxy](https://docs.tomtom.com/maps-sdk-js/guides/security/hardening-your-proxy).
|
|
149
|
+
- [**What the SDK sends, and where**](https://docs.tomtom.com/maps-sdk-js/guides/security/what-the-sdk-sends): the data your users' browsers send to TomTom, for your privacy notice.
|
|
133
150
|
|
|
134
|
-
|
|
135
|
-
|--------|-------------|-----------|
|
|
136
|
-
| **[Map](https://docs.tomtom.com/maps-sdk-js/guides/map/quickstart)** — interactive maps in [styles](https://docs.tomtom.com/maps-sdk-js/guides/map/styles), with [POIs](https://docs.tomtom.com/maps-sdk-js/guides/map/pois), [traffic](https://docs.tomtom.com/maps-sdk-js/guides/map/traffic), [places](https://docs.tomtom.com/maps-sdk-js/guides/map/places), [routes](https://docs.tomtom.com/maps-sdk-js/guides/map/routes) and [geometries](https://docs.tomtom.com/maps-sdk-js/guides/map/geometries) | `@tomtom-org/maps-sdk/map` | web |
|
|
137
|
-
| **[Services](https://docs.tomtom.com/maps-sdk-js/guides/services/quickstart)** — [GeoJSON](https://geojson.org/) services for [places](https://docs.tomtom.com/maps-sdk-js/guides/services/places/quickstart), [routing](https://docs.tomtom.com/maps-sdk-js/guides/services/routing/quickstart), geocoding and more | `@tomtom-org/maps-sdk/services` | web, Node.js, React Native |
|
|
138
|
-
| **[Core](https://docs.tomtom.com/maps-sdk-js/api-reference/modules/core.html)** — shared config, types and utilities; no separate install needed | `@tomtom-org/maps-sdk/core` | web, Node.js, React Native |
|
|
151
|
+
## Resources for AI agents
|
|
139
152
|
|
|
140
|
-
|
|
153
|
+
Besides the [coding skill](#quickstart), these entry points serve agents and the people configuring them:
|
|
141
154
|
|
|
142
|
-
|
|
155
|
+
- **Bundled `.d.ts` declarations**: the API surface an editor and an agent complete against.
|
|
156
|
+
- **Markdown pages**: [project setup](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup.md), and the [map](https://docs.tomtom.com/maps-sdk-js/guides/map/quickstart.md), [services](https://docs.tomtom.com/maps-sdk-js/guides/services/quickstart.md) and [core](https://docs.tomtom.com/maps-sdk-js/guides/core/quickstart.md) quickstarts, published for agents to read.
|
|
157
|
+
- **[Context7 index](https://context7.com/tomtom-international/maps-sdk-js)**: this repository, indexed for agents using the Context7 MCP server.
|
|
158
|
+
- **[`examples/`](https://github.com/tomtom-international/maps-sdk-js/tree/main/examples)**: over 110 runnable apps, the best code to copy from.
|
|
143
159
|
|
|
144
|
-
|
|
145
|
-
The SDK packages (`@tomtom-org/maps-sdk/*` - core, services, map) and plugins (`@tomtom-org/maps-sdk-plugin-*`) are distributed under a **proprietary license**.
|
|
160
|
+
[AI and the SDK](https://docs.tomtom.com/maps-sdk-js/introduction/ai) covers both the coding skill and the [Agent Toolkit](https://docs.tomtom.com/maps-sdk-js/guides/plugins/agent-toolkit/overview), for putting an LLM in front of your users.
|
|
146
161
|
|
|
147
|
-
|
|
162
|
+
## Documentation
|
|
148
163
|
|
|
149
|
-
|
|
164
|
+
- [**Introduction**](https://docs.tomtom.com/maps-sdk-js/introduction/overview) and [**project setup**](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup)
|
|
165
|
+
- [**Guides**](https://docs.tomtom.com/maps-sdk-js/guides/how-the-sdk-works), starting with how the SDK works
|
|
166
|
+
- [**Examples**](https://docs.tomtom.com/maps-sdk-js/examples/), live in your browser with their code
|
|
167
|
+
- [**API reference**](https://docs.tomtom.com/maps-sdk-js/api-reference/index.html), every exported symbol with its signature and types
|
|
168
|
+
- [**Release notes**](https://docs.tomtom.com/maps-sdk-js/introduction/release-notes) and the [changelog](./CHANGELOG.md)
|
|
169
|
+
- [**Migrating from V6**](https://docs.tomtom.com/maps-sdk-js/guides/migration/v6-to-new-sdk), for apps on the TomTom Maps SDK for Web V6
|
|
150
170
|
|
|
151
|
-
|
|
152
|
-
All example code in the `examples/` directory is **open-source** under the Apache V2.0 License.
|
|
171
|
+
## License
|
|
153
172
|
|
|
154
|
-
|
|
173
|
+
This repository uses a **dual-licensing model**:
|
|
155
174
|
|
|
156
|
-
|
|
175
|
+
- **SDK packages and plugins**: `@tomtom-org/maps-sdk` (core, services, map) and the `@tomtom-org/maps-sdk-plugin-*` packages are distributed under a **proprietary license**, in [LICENSE.txt](./LICENSE.txt). They require a TomTom API key and agreement to our terms of service.
|
|
176
|
+
- **Examples**: the code in `examples/` is **open source** under the Apache 2.0 license, in [examples/LICENSE](./examples/LICENSE). Copy, modify and use it in your projects.
|
|
157
177
|
|
|
158
|
-
|
|
159
|
-
This repository is source-available for transparency and learning. This is a read-only mirror - see [CONTRIBUTING.md](./CONTRIBUTING.md) for how to provide feedback through issues and discussions.
|
|
178
|
+
The [GitHub repository](https://github.com/tomtom-international/maps-sdk-js) carries the examples, the changelogs and the AI coding skill; the SDK's sources are not published. It is a read-only mirror: report bugs in its [issues](https://github.com/tomtom-international/maps-sdk-js/issues) and ask questions in its [discussions](https://github.com/tomtom-international/maps-sdk-js/discussions).
|