@maptiler/sdk 3.0.1 → 3.0.2

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.
Files changed (37) hide show
  1. package/.editorconfig +13 -0
  2. package/.husky/pre-commit +2 -0
  3. package/README.md +24 -6
  4. package/dist/eslint.config.d.mts +2 -0
  5. package/dist/maptiler-sdk.mjs +1321 -1307
  6. package/dist/maptiler-sdk.mjs.map +1 -1
  7. package/dist/src/MLAdapters/MapMouseEvent.d.ts +1 -1
  8. package/dist/src/Map.d.ts +7 -1
  9. package/dist/src/config.d.ts +2 -2
  10. package/dist/src/{MaptilerGeolocateControl.d.ts → controls/MaptilerGeolocateControl.d.ts} +1 -1
  11. package/dist/src/{MaptilerLogoControl.d.ts → controls/MaptilerLogoControl.d.ts} +2 -2
  12. package/dist/src/{MaptilerNavigationControl.d.ts → controls/MaptilerNavigationControl.d.ts} +1 -1
  13. package/dist/src/{MaptilerProjectionControl.d.ts → controls/MaptilerProjectionControl.d.ts} +1 -1
  14. package/dist/src/{MaptilerTerrainControl.d.ts → controls/MaptilerTerrainControl.d.ts} +1 -1
  15. package/dist/src/{Minimap.d.ts → controls/Minimap.d.ts} +1 -1
  16. package/dist/src/controls/index.d.ts +6 -0
  17. package/dist/src/helpers/index.d.ts +3 -13
  18. package/dist/src/helpers/stylehelper.d.ts +1 -1
  19. package/dist/src/helpers/vectorlayerhelpers.d.ts +1 -1
  20. package/dist/src/index.d.ts +9 -12
  21. package/dist/src/tools.d.ts +3 -7
  22. package/dist/src/utils/dom.d.ts +2 -0
  23. package/dist/src/utils/index.d.ts +1 -0
  24. package/dist/vite.config-test.d.ts +2 -0
  25. package/dist/vitest-setup-tests.d.ts +1 -0
  26. package/eslint.config.mjs +61 -0
  27. package/package.json +27 -11
  28. package/tsconfig.json +13 -6
  29. package/vite.config-dev.ts +4 -0
  30. package/vite.config-es.ts +4 -0
  31. package/vite.config-test.ts +7 -0
  32. package/vite.config-umd.ts +4 -0
  33. package/vitest-setup-tests.ts +4 -0
  34. package/biome.json +0 -50
  35. /package/dist/src/{colorramp.d.ts → ColorRamp.d.ts} +0 -0
  36. /package/dist/src/{defaults.d.ts → constants/defaults.d.ts} +0 -0
  37. /package/dist/src/{unit.d.ts → types.d.ts} +0 -0
package/.editorconfig ADDED
@@ -0,0 +1,13 @@
1
+ # EditorConfig is awesome: https://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ [*]
7
+ indent_style = space
8
+ indent_size = 2
9
+ end_of_line = LF
10
+ charset = utf-8
11
+ trim_trailing_whitespace = false
12
+ insert_final_newline = true
13
+ max_line_length = 180
@@ -0,0 +1,2 @@
1
+ npx lint-staged;
2
+ npm run test;
package/README.md CHANGED
@@ -329,21 +329,17 @@ This will overwrite the `projection` property from the style (if any) and will p
329
329
 
330
330
  - Use the built-in methods:
331
331
  ```ts
332
- const animate = false;
333
- map.enableGlobeProjection(animate);
332
+ map.enableGlobeProjection();
334
333
  // or
335
- map.enableMercatorProjection(animate);
334
+ map.enableMercatorProjection();
336
335
  ```
337
336
 
338
- The animated transition is enabled by default, but can be disabled by passing `false`, as in the example above. Similarly to the `projection` option in the constructor, this will overwrite the projection settings from style (if any) and persist it when the style is updated.
339
-
340
337
  The projection setter built in Maplibre GL JS is also usable:
341
338
  ```ts
342
339
  map.setProjection({type: "mercator"});
343
340
  // or
344
341
  map.setProjection({type: "globe"});
345
342
  ```
346
- but this will not automatically animate the transition and may cause rendering glitches.
347
343
 
348
344
  - Using the `MaptilerProjectionControl`. Not mounted by default, it can easily be added with a single option in the `Map` constructor:
349
345
  ```ts
@@ -1574,3 +1570,25 @@ const tileXY = maptilersdk.math.wgs84ToTileIndex(montBlancPeakWgs84, 14);
1574
1570
  ```
1575
1571
 
1576
1572
  Please find out more about the math package in our [official documentation](https://docs.maptiler.com/client-js/math):
1573
+
1574
+ # Telemetry
1575
+ The telemetry is very valuable to the team at MapTiler because it shares information about where to add the extra effort. It also helps spotting some incompatibility issues that may arise between the SDK and a specific version of a module.
1576
+
1577
+ It consists in sending metrics about usage of the following features:
1578
+ - SDK version [string]
1579
+ - API key [string]
1580
+ - MapTiler sesion ID (if opted-in) [string]
1581
+ - if tile caching is enabled [boolean]
1582
+ - if language specified at initialization [boolean]
1583
+ - if terrain is activated at initialization [boolean]
1584
+ - if globe projection is activated at initialization [boolean]
1585
+
1586
+ In addition, each official module will be added to a list, alongside its version number.
1587
+
1588
+ Telemetry is enabled by default but can be opted-out by setting `telemetry` value of `config` to `false`.
1589
+
1590
+ ```ts
1591
+ import * as maptilersdk from '@maptiler/sdk';
1592
+
1593
+ maptilersdk.config.telemetry = false;
1594
+ ```
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
2
+ export default _default;