@maptiler/sdk 3.0.1 → 3.1.0-rc1
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/.editorconfig +13 -0
- package/.husky/pre-commit +1 -0
- package/README.md +24 -6
- package/dist/eslint.config.d.mts +2 -0
- package/dist/maptiler-sdk.mjs +3300 -2171
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +1 -1
- package/dist/src/Map.d.ts +21 -0
- package/dist/src/config.d.ts +1 -1
- package/dist/src/custom-layers/CubemapLayer/CubemapLayer.d.ts +29 -0
- package/dist/src/custom-layers/CubemapLayer/constants.d.ts +3 -0
- package/dist/src/custom-layers/CubemapLayer/index.d.ts +2 -0
- package/dist/src/custom-layers/CubemapLayer/loadCubemapTexture.d.ts +6 -0
- package/dist/src/custom-layers/CubemapLayer/types.d.ts +37 -0
- package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +23 -0
- package/dist/src/custom-layers/RadialGradientLayer/index.d.ts +2 -0
- package/dist/src/custom-layers/RadialGradientLayer/types.d.ts +11 -0
- package/dist/src/custom-layers/extractCustomLayerStyle.d.ts +18 -0
- package/dist/src/custom-layers/index.d.ts +5 -0
- package/dist/src/index.d.ts +2 -2
- package/dist/src/tools.d.ts +3 -5
- package/dist/src/utils/geo-utils.d.ts +6 -0
- package/dist/src/utils/math-utils.d.ts +4 -0
- package/dist/src/utils/webgl-utils.d.ts +49 -0
- package/eslint.config.mjs +61 -0
- package/package.json +24 -9
- package/tsconfig.json +10 -6
- package/biome.json +0 -50
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 @@
|
|
|
1
|
+
npx lint-staged
|
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
|
-
|
|
333
|
-
map.enableGlobeProjection(animate);
|
|
332
|
+
map.enableGlobeProjection();
|
|
334
333
|
// or
|
|
335
|
-
map.enableMercatorProjection(
|
|
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
|
+
```
|