@maptiler/sdk 4.2.0 → 5.0.0-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.
- package/README.md +98 -29
- package/dist/ImageViewer/ImageViewer.d.ts +6 -8
- package/dist/ImageViewer/ImageViewerMarker.d.ts +9 -9
- package/dist/Map.d.ts +73 -10
- package/dist/bundler/maplibre-gl-worker.mjs +13839 -0
- package/dist/bundler/next-worker.mjs +16 -0
- package/dist/bundler/next.cjs +42 -0
- package/dist/bundler/next.d.ts +6 -0
- package/dist/bundler/next.mjs +48 -0
- package/dist/bundler/side-effect.d.ts +2 -0
- package/dist/bundler/vite-worker.mjs +11 -0
- package/dist/bundler/webpack-worker.mjs +11 -0
- package/dist/constants/defaults.d.ts +0 -1
- package/dist/controls/MaptilerGeolocateControl.d.ts +1 -1
- package/dist/controls/MaptilerLogoControl.d.ts +1 -2
- package/dist/controls/MaptilerNavigationControl.d.ts +3 -4
- package/dist/controls/Minimap.d.ts +3 -3
- package/dist/eslint.mjs +4 -4
- package/dist/index.d.ts +5 -80
- package/dist/mapstyle.d.ts +4 -3
- package/dist/maptiler-sdk.css +1 -1
- package/dist/maptiler-sdk.mjs +3500 -3443
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/tools.d.ts +6 -7
- package/dist/utils/defaultWorkerUrl.d.ts +17 -0
- package/package.json +20 -3
- package/dist/MLAdapters/AttributionControl.d.ts +0 -5
- package/dist/MLAdapters/BoxZoomHandler.d.ts +0 -7
- package/dist/MLAdapters/CanvasSource.d.ts +0 -5
- package/dist/MLAdapters/CooperativeGesturesHandler.d.ts +0 -5
- package/dist/MLAdapters/FullscreenControl.d.ts +0 -5
- package/dist/MLAdapters/GeoJSONSource.d.ts +0 -5
- package/dist/MLAdapters/GeolocateControl.d.ts +0 -5
- package/dist/MLAdapters/ImageSource.d.ts +0 -5
- package/dist/MLAdapters/KeyboardHandler.d.ts +0 -5
- package/dist/MLAdapters/LogoControl.d.ts +0 -5
- package/dist/MLAdapters/MapMouseEvent.d.ts +0 -5
- package/dist/MLAdapters/MapTouchEvent.d.ts +0 -5
- package/dist/MLAdapters/MapWheelEvent.d.ts +0 -5
- package/dist/MLAdapters/Marker.d.ts +0 -5
- package/dist/MLAdapters/NavigationControl.d.ts +0 -5
- package/dist/MLAdapters/Popup.d.ts +0 -5
- package/dist/MLAdapters/RasterDEMTileSource.d.ts +0 -5
- package/dist/MLAdapters/RasterTileSource.d.ts +0 -5
- package/dist/MLAdapters/ScaleControl.d.ts +0 -5
- package/dist/MLAdapters/ScrollZoomHandler.d.ts +0 -5
- package/dist/MLAdapters/Style.d.ts +0 -5
- package/dist/MLAdapters/TerrainControl.d.ts +0 -5
- package/dist/MLAdapters/TwoFingersTouchPitchHandler.d.ts +0 -5
- package/dist/MLAdapters/VectorTileSource.d.ts +0 -5
- package/dist/MLAdapters/VideoSource.d.ts +0 -5
- package/dist/ml-types.d.ts +0 -638
package/dist/tools.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExpressionSpecification, LayerSpecification, RequestParameters, ResourceType, RequestTransformFunction } from 'maplibre-gl';
|
|
2
2
|
import { Map as MapSDK } from './Map';
|
|
3
|
-
export declare function enableRTL(customPluginURL?: string): Promise<void>;
|
|
4
3
|
export declare function bindAll(fns: Array<string>, context: any): void;
|
|
5
4
|
/**
|
|
6
5
|
* This function is meant to be used as transformRequest by any Map instance created.
|
|
@@ -52,7 +51,7 @@ export declare function displayWebGLContextLostWarning(map: MapSDK): void;
|
|
|
52
51
|
* This replacement happened regardless of how deep in the object the flag is.
|
|
53
52
|
* Note that it does not replace the occurences of ["get", "name"] (local names)
|
|
54
53
|
*/
|
|
55
|
-
export declare function changeFirstLanguage(origExpr:
|
|
54
|
+
export declare function changeFirstLanguage(origExpr: ExpressionSpecification, replacer: ExpressionSpecification, localized: boolean): ExpressionSpecification;
|
|
56
55
|
/**
|
|
57
56
|
* If `localized` is `true`, it checks for the pattern "{name:xx}" (with "xx" being a language iso string).
|
|
58
57
|
* If `localized` is `false`, it check for {name}.
|
|
@@ -65,8 +64,8 @@ export declare function checkNamePattern(str: string, localized: boolean): {
|
|
|
65
64
|
/**
|
|
66
65
|
* Replaces the occurences of {name:xx} in a string by a provided object-expression to return a concat object expression
|
|
67
66
|
*/
|
|
68
|
-
export declare function replaceLanguage(origLang: string, newLang:
|
|
69
|
-
export declare function addFormatElevationExpressionFromString(expression:
|
|
67
|
+
export declare function replaceLanguage(origLang: string, newLang: ExpressionSpecification, localized: boolean): ExpressionSpecification;
|
|
68
|
+
export declare function addFormatElevationExpressionFromString(expression: ExpressionSpecification | string): ExpressionSpecification | string;
|
|
70
69
|
/**
|
|
71
70
|
* Find languages used in string label definition.
|
|
72
71
|
* The returned array contains languages such as "en", "fr" but
|
|
@@ -78,8 +77,8 @@ export declare function findLanguageStr(str: string): Array<string | null>;
|
|
|
78
77
|
* The returned array contains languages such as "en", "fr" but
|
|
79
78
|
* can also contain null that stand for the use of {name}
|
|
80
79
|
*/
|
|
81
|
-
export declare function findLanguageObj(origExpr:
|
|
82
|
-
export declare function computeLabelsLocalizationMetrics(layers:
|
|
80
|
+
export declare function findLanguageObj(origExpr: ExpressionSpecification): Array<string | null>;
|
|
81
|
+
export declare function computeLabelsLocalizationMetrics(layers: LayerSpecification[], map: MapSDK): {
|
|
83
82
|
unlocalized: number;
|
|
84
83
|
localized: Record<string, number>;
|
|
85
84
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL of the MapLibre worker published on the MapTiler CDN alongside the UMD bundle of this SDK version.
|
|
3
|
+
*/
|
|
4
|
+
export declare function getCdnWorkerUrl(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Since MapLibre v6, the worker is loaded from a separate file that bundlers generally don't emit,
|
|
7
|
+
* so in the ES build (npm) the SDK falls back to the worker hosted on the MapTiler CDN.
|
|
8
|
+
* A URL set beforehand, with `setWorkerUrl` or one of the bundler helpers
|
|
9
|
+
* (e.g. `@maptiler/sdk/vite-worker`), always takes precedence.
|
|
10
|
+
* The UMD build keeps MapLibre's default, which finds the worker next to the UMD bundle.
|
|
11
|
+
*/
|
|
12
|
+
export declare function setDefaultWorkerUrl(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Same as MapLibre's `prewarm`, but sets the default worker URL first,
|
|
15
|
+
* as the workers it starts are the ones later used by the maps.
|
|
16
|
+
*/
|
|
17
|
+
export declare function prewarm(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maptiler/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-rc.1",
|
|
4
4
|
"description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
|
|
5
5
|
"author": "MapTiler",
|
|
6
6
|
"module": "dist/maptiler-sdk.mjs",
|
|
@@ -13,6 +13,23 @@
|
|
|
13
13
|
"import": "./dist/maptiler-sdk.mjs",
|
|
14
14
|
"types": "./dist/maptiler-sdk.d.ts"
|
|
15
15
|
},
|
|
16
|
+
"./vite-worker": {
|
|
17
|
+
"types": "./dist/bundler/side-effect.d.ts",
|
|
18
|
+
"import": "./dist/bundler/vite-worker.mjs"
|
|
19
|
+
},
|
|
20
|
+
"./webpack-worker": {
|
|
21
|
+
"types": "./dist/bundler/side-effect.d.ts",
|
|
22
|
+
"import": "./dist/bundler/webpack-worker.mjs"
|
|
23
|
+
},
|
|
24
|
+
"./next-worker": {
|
|
25
|
+
"types": "./dist/bundler/side-effect.d.ts",
|
|
26
|
+
"import": "./dist/bundler/next-worker.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./next": {
|
|
29
|
+
"types": "./dist/bundler/next.d.ts",
|
|
30
|
+
"import": "./dist/bundler/next.mjs",
|
|
31
|
+
"require": "./dist/bundler/next.cjs"
|
|
32
|
+
},
|
|
16
33
|
"./dist/maptiler-sdk.css": {
|
|
17
34
|
"import": "./dist/maptiler-sdk.css"
|
|
18
35
|
},
|
|
@@ -100,13 +117,13 @@
|
|
|
100
117
|
"vitest": "^3.0.9"
|
|
101
118
|
},
|
|
102
119
|
"dependencies": {
|
|
103
|
-
"@maplibre/maplibre-gl-style-spec": "^
|
|
120
|
+
"@maplibre/maplibre-gl-style-spec": "^26.4.4",
|
|
104
121
|
"@maptiler/client": "^3.1.0",
|
|
105
122
|
"eslint-plugin-compat": "^6.1.0",
|
|
106
123
|
"events": "^3.3.0",
|
|
107
124
|
"gl-matrix": "^3.4.4",
|
|
108
125
|
"js-base64": "^3.7.7",
|
|
109
|
-
"maplibre-gl": "
|
|
126
|
+
"maplibre-gl": "6.11.2",
|
|
110
127
|
"uuid": "^14.0.0"
|
|
111
128
|
}
|
|
112
129
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
|
-
import { Map as SDKMap } from '../Map';
|
|
3
|
-
export declare class BoxZoomHandler extends maplibregl.BoxZoomHandler {
|
|
4
|
-
constructor(map: SDKMap | MapMLGL, options: {
|
|
5
|
-
clickTolerance: number;
|
|
6
|
-
});
|
|
7
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { default as maplibregl, GestureOptions, Map as MapMLGL } from 'maplibre-gl';
|
|
2
|
-
import { Map as SDKMap } from '../Map';
|
|
3
|
-
export declare class CooperativeGesturesHandler extends maplibregl.CooperativeGesturesHandler {
|
|
4
|
-
constructor(map: SDKMap | MapMLGL, options: GestureOptions);
|
|
5
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
|
-
import { Map as SDKMap } from '../Map';
|
|
3
|
-
export declare class MapMouseEvent extends maplibregl.MapMouseEvent {
|
|
4
|
-
constructor(type: string, map: SDKMap | MapMLGL, originalEvent: MouseEvent, data?: Record<string, unknown>);
|
|
5
|
-
}
|