@maptiler/sdk 3.0.0-rc.5 → 3.0.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 → README.md} +2 -0
- package/dist/maptiler-sdk.css +3 -3
- package/dist/maptiler-sdk.d.ts +1 -0
- package/dist/maptiler-sdk.mjs +911 -990
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/src/MLAdapters/AttributionControl.d.ts +0 -1
- package/dist/src/MLAdapters/BoxZoomHandler.d.ts +0 -1
- package/dist/src/MLAdapters/CanvasSource.d.ts +0 -1
- package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +0 -1
- package/dist/src/MLAdapters/FullscreenControl.d.ts +0 -1
- package/dist/src/MLAdapters/GeoJSONSource.d.ts +0 -1
- package/dist/src/MLAdapters/GeolocateControl.d.ts +0 -1
- package/dist/src/MLAdapters/ImageSource.d.ts +0 -1
- package/dist/src/MLAdapters/KeyboardHandler.d.ts +0 -1
- package/dist/src/MLAdapters/LogoControl.d.ts +0 -1
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +0 -1
- package/dist/src/MLAdapters/MapTouchEvent.d.ts +0 -1
- package/dist/src/MLAdapters/MapWheelEvent.d.ts +0 -1
- package/dist/src/MLAdapters/Marker.d.ts +0 -1
- package/dist/src/MLAdapters/NavigationControl.d.ts +0 -1
- package/dist/src/MLAdapters/Popup.d.ts +0 -1
- package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +0 -1
- package/dist/src/MLAdapters/RasterTileSource.d.ts +0 -1
- package/dist/src/MLAdapters/ScaleControl.d.ts +0 -1
- package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +0 -1
- package/dist/src/MLAdapters/Style.d.ts +0 -1
- package/dist/src/MLAdapters/TerrainControl.d.ts +0 -1
- package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +0 -1
- package/dist/src/MLAdapters/VectorTileSource.d.ts +0 -1
- package/dist/src/MLAdapters/VideoSource.d.ts +0 -1
- package/dist/src/Map.d.ts +0 -1
- package/dist/src/MaptilerGeolocateControl.d.ts +0 -1
- package/dist/src/MaptilerLogoControl.d.ts +0 -1
- package/dist/src/MaptilerNavigationControl.d.ts +0 -1
- package/dist/src/MaptilerProjectionControl.d.ts +0 -1
- package/dist/src/MaptilerTerrainControl.d.ts +0 -1
- package/dist/src/Minimap.d.ts +0 -1
- package/dist/src/Telemetry.d.ts +0 -1
- package/dist/src/caching.d.ts +0 -1
- package/dist/src/config.d.ts +0 -1
- package/dist/src/helpers/index.d.ts +0 -1
- package/dist/src/helpers/screenshot.d.ts +0 -1
- package/dist/src/helpers/stylehelper.d.ts +0 -1
- package/dist/src/helpers/vectorlayerhelpers.d.ts +0 -1
- package/dist/src/index.d.ts +1 -2
- package/dist/src/language.d.ts +0 -1
- package/dist/src/mapstyle.d.ts +0 -1
- package/dist/src/tools.d.ts +0 -1
- package/package.json +18 -18
- package/vite.config-dev.ts +30 -0
- /package/{vite.config.ts → vite.config-test.ts} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as maplibregl, GestureOptions, Map as MapMLGL } from 'maplibre-gl';
|
|
2
2
|
import { Map as SDKMap } from '../Map';
|
|
3
|
-
|
|
4
3
|
export declare class CooperativeGesturesHandler extends maplibregl.CooperativeGesturesHandler {
|
|
5
4
|
constructor(map: SDKMap | MapMLGL, options: GestureOptions);
|
|
6
5
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
2
|
import { Map as SDKMap } from '../Map';
|
|
3
|
-
|
|
4
3
|
export declare class MapMouseEvent extends maplibregl.MapMouseEvent {
|
|
5
4
|
constructor(type: string, map: SDKMap | MapMLGL, originalEvent: MouseEvent, data?: any);
|
|
6
5
|
}
|
package/dist/src/Map.d.ts
CHANGED
package/dist/src/Minimap.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Map as SDKMap, MapOptions } from './Map';
|
|
2
2
|
import { ControlPosition, CustomLayerInterface, FillLayerSpecification, FilterSpecification, IControl, LayerSpecification, LineLayerSpecification, SourceSpecification, StyleOptions, StyleSetterOptions, StyleSpecification, StyleSwapOptions } from 'maplibre-gl';
|
|
3
3
|
import { MapStyleVariant, ReferenceMapStyle } from '@maptiler/client';
|
|
4
|
-
|
|
5
4
|
export interface ParentRect {
|
|
6
5
|
lineLayout: LineLayerSpecification["layout"];
|
|
7
6
|
linePaint: LineLayerSpecification["paint"];
|
package/dist/src/Telemetry.d.ts
CHANGED
package/dist/src/caching.d.ts
CHANGED
package/dist/src/config.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { default as EventEmitter } from 'events';
|
|
|
2
2
|
import { LanguageInfo } from './language';
|
|
3
3
|
import { FetchFunction } from '@maptiler/client';
|
|
4
4
|
import { Unit } from './unit';
|
|
5
|
-
|
|
6
5
|
export declare const MAPTILER_SESSION_ID: string;
|
|
7
6
|
/**
|
|
8
7
|
* Configuration class for the SDK
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { takeScreenshot } from './screenshot';
|
|
2
2
|
import { addPolyline, addPolygon, addPoint, addHeatmap } from './vectorlayerhelpers';
|
|
3
|
-
|
|
4
3
|
export type { ZoomStringValues, ZoomNumberValues, PropertyValues, CommonShapeLayerOptions, PolylineLayerOptions, PolygonLayerOptions, PointLayerOptions, HeatmapLayerOptions, } from './vectorlayerhelpers';
|
|
5
4
|
/**
|
|
6
5
|
* Helpers are a set of functions to facilitate the creation of sources and layers
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DataDrivenPropertyValueSpecification, ExpressionSpecification } from 'maplibre-gl';
|
|
2
2
|
import { ColorRamp } from '../colorramp';
|
|
3
3
|
import { DataDrivenStyle, PropertyValues, ZoomNumberValues, ZoomStringValues } from './vectorlayerhelpers';
|
|
4
|
-
|
|
5
4
|
export type ColorPalette = [string, string, string, string];
|
|
6
5
|
export declare const colorPalettes: Array<ColorPalette>;
|
|
7
6
|
export declare function getRandomColor(): string;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { default as maplibregl } from 'maplibre-gl';
|
|
2
|
-
|
|
3
2
|
export type * from 'maplibre-gl';
|
|
4
3
|
/**
|
|
5
4
|
* Get the version of MapTiler SDK
|
|
@@ -84,7 +83,7 @@ export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type Buff
|
|
|
84
83
|
export { getWebGLSupportError } from './tools';
|
|
85
84
|
export { config, SdkConfig } from './config';
|
|
86
85
|
export * from './language';
|
|
87
|
-
export {
|
|
86
|
+
export type { Unit } from './unit';
|
|
88
87
|
export * from './Minimap';
|
|
89
88
|
export * from './converters';
|
|
90
89
|
export * from './colorramp';
|
package/dist/src/language.d.ts
CHANGED
package/dist/src/mapstyle.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReferenceMapStyle, MapStyleVariant } from '@maptiler/client';
|
|
2
|
-
|
|
3
2
|
export declare function styleToStyle(style: string | ReferenceMapStyle | MapStyleVariant | maplibregl.StyleSpecification | null | undefined): {
|
|
4
3
|
style: string | maplibregl.StyleSpecification;
|
|
5
4
|
requiresUrlMonitoring: boolean;
|
package/dist/src/tools.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as maplibregl, RequestParameters, ResourceType, RequestTransformFunction } from 'maplibre-gl';
|
|
2
2
|
import { Map as MapSDK } from './Map';
|
|
3
|
-
|
|
4
3
|
export declare function enableRTL(): void;
|
|
5
4
|
export declare function bindAll(fns: Array<string>, context: any): void;
|
|
6
5
|
export declare function DOMcreate<K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, container?: HTMLElement): HTMLElementTagNameMap[K];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maptiler/sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
|
|
5
5
|
"module": "dist/maptiler-sdk.mjs",
|
|
6
6
|
"types": "dist/maptiler-sdk.d.ts",
|
|
@@ -37,35 +37,35 @@
|
|
|
37
37
|
"biome": "biome check --max-diagnostics=1000",
|
|
38
38
|
"biome:fix": "npx @biomejs/biome check --max-diagnostics=1000 --write",
|
|
39
39
|
"doc": "rm -rf docs/* && typedoc --out docs && cp -r images docs/",
|
|
40
|
-
"test": "vitest run",
|
|
41
|
-
"build-css": "node scripts/replace-path-with-content.js src/style/style_template.css dist/tmp_maptiler-sdk.css && cat node_modules/maplibre-gl/dist/maplibre-gl.css dist/tmp_maptiler-sdk.css > dist/maptiler-sdk.css && rm dist/tmp_maptiler-sdk.css && cp dist/maptiler-sdk.css build/maptiler-sdk.css",
|
|
40
|
+
"test": "vitest run -c vite.config-test.ts",
|
|
41
|
+
"build-css": "mkdir -p dist build && node scripts/replace-path-with-content.js src/style/style_template.css dist/tmp_maptiler-sdk.css && cat node_modules/maplibre-gl/dist/maplibre-gl.css dist/tmp_maptiler-sdk.css > dist/maptiler-sdk.css && rm dist/tmp_maptiler-sdk.css && cp dist/maptiler-sdk.css build/maptiler-sdk.css",
|
|
42
42
|
"build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts",
|
|
43
43
|
"build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts",
|
|
44
44
|
"build": "npm run build-es; npm run build-umd; npm run build-css",
|
|
45
45
|
"make": "npm run biome:fix && npm run build",
|
|
46
|
-
"dev
|
|
47
|
-
"
|
|
46
|
+
"dev": "concurrently \"vite -c vite.config-dev.ts\" \"npm run dev-umd\"",
|
|
47
|
+
"dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts",
|
|
48
|
+
"ncu": "npx npm-check-updates"
|
|
48
49
|
},
|
|
49
50
|
"author": "MapTiler",
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@biomejs/biome": "1.
|
|
52
|
-
"@types/uuid": "^
|
|
52
|
+
"@biomejs/biome": "1.9.4",
|
|
53
|
+
"@types/uuid": "^10.0.0",
|
|
53
54
|
"@types/xmldom": "^0.1.31",
|
|
54
55
|
"@xmldom/xmldom": "^0.8.10",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"vite": "^5.
|
|
60
|
-
"
|
|
61
|
-
"vitest": "^0.34.2"
|
|
56
|
+
"concurrently": "^9.1.2",
|
|
57
|
+
"typedoc": "^0.27.6",
|
|
58
|
+
"typescript": "^5.7.3",
|
|
59
|
+
"vite": "^6.0.7",
|
|
60
|
+
"vite-plugin-dts": "^4.5.0",
|
|
61
|
+
"vitest": "^2.1.8"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@maplibre/maplibre-gl-style-spec": "^
|
|
64
|
+
"@maplibre/maplibre-gl-style-spec": "^23.0.0",
|
|
65
65
|
"@maptiler/client": "^2.2.0",
|
|
66
66
|
"events": "^3.3.0",
|
|
67
|
-
"js-base64": "^3.7.
|
|
68
|
-
"maplibre-gl": "^5.0.
|
|
69
|
-
"uuid": "^
|
|
67
|
+
"js-base64": "^3.7.7",
|
|
68
|
+
"maplibre-gl": "^5.0.1",
|
|
69
|
+
"uuid": "^11.0.5"
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
server: {
|
|
5
|
+
port: 3000,
|
|
6
|
+
},
|
|
7
|
+
plugins: [
|
|
8
|
+
{
|
|
9
|
+
name: 'url-override',
|
|
10
|
+
/**
|
|
11
|
+
* Changing logged URLs to include the path to the demo directory.
|
|
12
|
+
*/
|
|
13
|
+
configureServer: (server) => {
|
|
14
|
+
const printUrls = server.printUrls;
|
|
15
|
+
|
|
16
|
+
server.printUrls = () => {
|
|
17
|
+
if (server.resolvedUrls !== null) {
|
|
18
|
+
for (const [key, value] of Object.entries(server.resolvedUrls)) {
|
|
19
|
+
for (let i = 0; i < value.length; i++) {
|
|
20
|
+
server.resolvedUrls[key][i] += "demos/index.html";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
printUrls();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
});
|
|
File without changes
|