@maptiler/sdk 3.2.0-rc.1 → 3.2.1-rc-1

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 -1
  3. package/README.md +12 -5
  4. package/dist/maptiler-sdk.mjs +2117 -2609
  5. package/dist/maptiler-sdk.mjs.map +1 -1
  6. package/dist/src/MLAdapters/ScaleControl.d.ts +0 -3
  7. package/dist/src/Map.d.ts +1 -8
  8. package/dist/src/config.d.ts +1 -1
  9. package/dist/src/{MaptilerGeolocateControl.d.ts → controls/MaptilerGeolocateControl.d.ts} +1 -12
  10. package/dist/src/{MaptilerLogoControl.d.ts → controls/MaptilerLogoControl.d.ts} +2 -6
  11. package/dist/src/controls/MaptilerNavigationControl.d.ts +17 -0
  12. package/dist/src/{MaptilerProjectionControl.d.ts → controls/MaptilerProjectionControl.d.ts} +1 -11
  13. package/dist/src/{MaptilerTerrainControl.d.ts → controls/MaptilerTerrainControl.d.ts} +4 -13
  14. package/dist/src/{Minimap.d.ts → controls/Minimap.d.ts} +1 -1
  15. package/dist/src/controls/index.d.ts +6 -0
  16. package/dist/src/helpers/index.d.ts +3 -13
  17. package/dist/src/helpers/stylehelper.d.ts +1 -1
  18. package/dist/src/helpers/vectorlayerhelpers.d.ts +1 -1
  19. package/dist/src/index.d.ts +8 -12
  20. package/dist/src/tools.d.ts +0 -2
  21. package/dist/src/utils/dom.d.ts +2 -0
  22. package/dist/src/utils/index.d.ts +1 -0
  23. package/dist/vite.config-test.d.ts +2 -0
  24. package/dist/vitest-setup-tests.d.ts +1 -0
  25. package/eslint.config.mjs +1 -0
  26. package/package.json +11 -7
  27. package/tsconfig.json +4 -1
  28. package/vite.config-dev.ts +4 -0
  29. package/vite.config-es.ts +4 -0
  30. package/vite.config-test.ts +7 -0
  31. package/vite.config-umd.ts +4 -0
  32. package/vitest-setup-tests.ts +4 -0
  33. package/dist/src/MaptilerNavigationControl.d.ts +0 -30
  34. package/dist/src/MaptilerScaleControl.d.ts +0 -15
  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
package/.husky/pre-commit CHANGED
@@ -1 +1,2 @@
1
- npx lint-staged
1
+ npx lint-staged;
2
+ npm run test;
package/README.md CHANGED
@@ -40,30 +40,30 @@ In addition to the details and examples provided in this readme, check out the [
40
40
  **Recommended for:** advanced applications
41
41
 
42
42
  ```ts
43
- import * as maptilersdk from '@maptiler/sdk';
43
+ import { config, Map } from '@maptiler/sdk';
44
44
 
45
45
  // Add your MapTiler Cloud API key to the config
46
46
  // (Go to https://cloud.maptiler.com/account/keys/ to get one for free!)
47
- maptilersdk.config.apiKey = 'YOUR_API_KEY';
47
+ config.apiKey = 'YOUR_API_KEY';
48
48
 
49
49
  // Let's say you have a DIV ready to receive a map
50
50
  const mapContainer = document.getElementById('my-container-div');
51
51
 
52
52
  // Instantiate the map
53
- const map = new maptilersdk.Map({
53
+ const map = new Map({
54
54
  container: mapContainer,
55
55
  });
56
56
  ```
57
57
 
58
58
  Alternatively, the `apiKey` can be set as Map option instead of in the `config` object. Yet, this will still internally propagate to the `config` object:
59
59
  ```ts
60
- import * as maptilersdk from '@maptiler/sdk';
60
+ import { Map } from '@maptiler/sdk';
61
61
 
62
62
  // Let's say you have a DIV ready to receive a map
63
63
  const mapContainer = document.getElementById('my-container-div');
64
64
 
65
65
  // Instantiate the map
66
- const map = new maptilersdk.Map({
66
+ const map = new Map({
67
67
  container: mapContainer,
68
68
  apiKey: 'YOUR_API_KEY'
69
69
  });
@@ -230,6 +230,13 @@ Here is the full list:
230
230
  - `MapStyle.TONER.BACKGROUND` (variant)
231
231
  - `MapStyle.TONER.LITE` (variant)
232
232
  - `MapStyle.TONER.LINES` (variant)
233
+ - `MapStyle.OCEAN` reference style with bathymetric highlights, does not have any variants.
234
+ - `MapStyle.LANDSCAPE` reference style terrain map for data overlays and visualisations
235
+ - `MapStyle.LANDSCAPE.DARK` (variant)
236
+ - `MapStyle.LANDSCAPE.VIVID` (variant)
237
+ - `MapStyle.AQUARELLE` reference style watercolor map for creative use
238
+ - `MapStyle.AQUARELLE.DARK` (variant)
239
+ - `MapStyle.AQUARELLE.VIVID` (variant)
233
240
  - `MapStyle.OPENSTREETMAP` (reference style, this one does not have any variants)
234
241
 
235
242