@tomtom-org/maps-sdk 0.29.1 → 0.30.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 CHANGED
@@ -2,7 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [0.29.1](https://github.com/tomtom-internal/maps-sdk-js/compare/v0.29.0...v0.29.1) (2025-11-04)
5
+ ## [0.30.0](https://github.com/tomtom-internal/maps-sdk-js/compare/v0.29.2...v0.30.0) (2025-11-05)
6
+
7
+
8
+ ### Features
9
+
10
+ * enable tomtom user agent headers by default ([30bcc22](https://github.com/tomtom-internal/maps-sdk-js/commit/30bcc2264e5cd335c19b8f01699bc20de1141947))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * route example content ([4b56065](https://github.com/tomtom-internal/maps-sdk-js/commit/4b56065916e512a7d3ea2d2af00e02fbc17b1c77))
16
+
17
+ ## [0.29.2](https://github.com/tomtom-internal/maps-sdk-js/compare/v0.29.1...v0.29.2) (2025-11-04)
6
18
 
7
19
 
8
20
  ### Features
package/README.md CHANGED
@@ -1,19 +1,15 @@
1
- [![TomTom Logo](tomtom-logo-big.svg)](https://www.tomtom.com/)
2
- # Maps SDK for JavaScript
1
+ [//]: # ([![TomTom Logo](./tomtom-logo-big.svg)](https://www.tomtom.com/))
2
+
3
+ # TomTom Maps SDK for JavaScript
4
+
3
5
  [**Examples**](https://docs.tomtom.com/maps-sdk-js/examples/) |
4
- [**Documentation**](https://docs.tomtom.com/maps-sdk-js/introduction/overview)
6
+ [**Documentation**](https://docs.tomtom.com/maps-sdk-js/introduction/overview) |
5
7
 
6
8
  [![NPM Version](https://img.shields.io/npm/v/@tomtom-org/maps-sdk.svg)](https://www.npmjs.com/package/@tomtom-org/maps-sdk)
7
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
8
-
9
- [![Quality Gate Status](https://sonar.tomtomgroup.com/api/project_badges/measure?project=tomtom-internal_maps-sdk-js_AYHTCTXCqdbqIGrKswTc&metric=alert_status&token=squ_0df68ac0b54248e036ef46514c17158ed9e8d642)](https://sonar.tomtomgroup.com/dashboard?id=tomtom-internal_maps-sdk-js_AYHTCTXCqdbqIGrKswTc)
10
- [![Reliability Rating](https://sonar.tomtomgroup.com/api/project_badges/measure?project=tomtom-internal_maps-sdk-js_AYHTCTXCqdbqIGrKswTc&metric=reliability_rating&token=squ_0df68ac0b54248e036ef46514c17158ed9e8d642)](https://sonar.tomtomgroup.com/dashboard?id=tomtom-internal_maps-sdk-js_AYHTCTXCqdbqIGrKswTc)
11
- [![Maintainability Rating](https://sonar.tomtomgroup.com/api/project_badges/measure?project=tomtom-internal_maps-sdk-js_AYHTCTXCqdbqIGrKswTc&metric=sqale_rating&token=squ_0df68ac0b54248e036ef46514c17158ed9e8d642)](https://sonar.tomtomgroup.com/dashboard?id=tomtom-internal_maps-sdk-js_AYHTCTXCqdbqIGrKswTc)
12
- [![Security Rating](https://sonar.tomtomgroup.com/api/project_badges/measure?project=tomtom-internal_maps-sdk-js_AYHTCTXCqdbqIGrKswTc&metric=security_rating&token=squ_0df68ac0b54248e036ef46514c17158ed9e8d642)](https://sonar.tomtomgroup.com/dashboard?id=tomtom-internal_maps-sdk-js_AYHTCTXCqdbqIGrKswTc)
13
9
 
14
10
  TomTom Maps SDK for JavaScript is a **JavaScript** library for building applications using [**TomTom** location maps and services](https://docs.tomtom.com/).
15
11
 
16
- [![SDK Example Thumbnails](sdk-examples-collage.png)](https://docs.tomtom.com/maps-sdk-js/examples/)
12
+ [//]: # ([![SDK Example Thumbnails](./sdk-examples-collage.png)](https://docs.tomtom.com/maps-sdk-js/examples/))
17
13
 
18
14
  It leverages the power of [MapLibre GL JS](https://github.com/maplibre/maplibre-gl-js) and [GeoJSON](https://geojson.org/)
19
15
  to seamlessly integrate TomTom maps and services with convenient out-of-the-box support, while staying highly customizable and extensible.
@@ -54,43 +50,6 @@ Explore comprehensive guides and interactive examples to get the most out of Map
54
50
  <br/><br/>
55
51
 
56
52
  ## 📦 Bundles
57
- ```mermaid
58
- flowchart TD
59
- App["Your application"]
60
- MapLibre["MapLibre GL JS"]
61
- subgraph SDK["SDK"]
62
- direction TB
63
- Map["Map"]
64
- Services["Services"]
65
- Core["Core"]
66
- end
67
-
68
- App --> Map
69
- App --> MapLibre
70
- App --> Services
71
- App --> Core
72
-
73
- Map -.-> Core
74
- Map -.-> MapLibre
75
-
76
- Services -.-> Core
77
-
78
- classDef mapClass fill:#fffde7,stroke:#ff6f00,color:#ff6f00;
79
- classDef servicesClass fill:#f3e5f5,stroke:#4a148c,color:#4a148c;
80
- classDef coreClass fill:#e8f5e9,stroke:#1b5e20,color:#1b5e20;
81
- classDef maplibreClass fill:#295DAA,stroke:#295DAA,color:white;
82
-
83
- class Map mapClass;
84
- class Services servicesClass;
85
- class Core coreClass;
86
- class MapLibre maplibreClass;
87
-
88
- click Map "##_Map" "Go to Map section"
89
- click Services "#services" "Go to Services section"
90
- click Core "#core" "Go to Core section"
91
- click MapLibre "https://maplibre.org/maplibre-gl-js/docs/" "Go to MapLibre GL JS documentation"
92
- ```
93
-
94
53
  * [Map](#map): MapLibre-powered library for readily styled, service-compatible and interactive TomTom Maps
95
54
  * * [MapLibre](https://maplibre.org/maplibre-gl-js/docs/) is an open source peer dependency so your application can also use it directly
96
55
  * [Services](#services): Functions with GeoJSON services for TomTom location APIs
@@ -263,8 +263,7 @@ const bboxFromGeoJSON = (hasBBox) => {
263
263
  const bboxExpandedWithGeoJSON = (geoJson, bboxToExpand) => bboxExpandedWithBBox(bboxFromGeoJSON(geoJson), bboxToExpand);
264
264
  const bboxCenter = (bbox) => [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2];
265
265
  const generateId = () => Date.now().toString(36) + Math.random().toString(36).substring(2);
266
- const TOMTOM_USER_AGENT_SDK_NAME = "TomTomSDKsMapsJS";
267
- const SDK_VERSION = "__SDK_VERSION__";
266
+ const TOMTOM_USER_AGENT_SDK_NAME = "MapsSDKJS";
268
267
  const validateTrackingId = (trackingId) => {
269
268
  if (!/^[a-zA-Z0-9-]{1,100}$/.test(trackingId)) {
270
269
  throw new TypeError(
@@ -274,9 +273,7 @@ const validateTrackingId = (trackingId) => {
274
273
  return trackingId;
275
274
  };
276
275
  const generateTomTomHeaders = (params) => ({
277
- ...params.tomtomUserAgent && {
278
- "TomTom-User-Agent": `${TOMTOM_USER_AGENT_SDK_NAME}/${SDK_VERSION}`
279
- },
276
+ "TomTom-User-Agent": `${TOMTOM_USER_AGENT_SDK_NAME}/${"0.30.0"}`,
280
277
  // TODO: restore if we implement oauth2 access
281
278
  // optional oauth2 access token:
282
279
  // ...(params.apiAccessToken && { Authorization: `Bearer ${params.apiAccessToken}` }),