@maptiler/sdk 3.4.0-rc1 → 3.4.0-rc3
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/dist/maptiler-sdk.d.ts +2 -0
- package/dist/maptiler-sdk.mjs +11601 -0
- package/dist/maptiler-sdk.mjs.map +1 -0
- package/dist/playwright.config.d.ts +9 -0
- package/dist/src/ColorRamp.d.ts +359 -0
- package/dist/src/MLAdapters/AttributionControl.d.ts +5 -0
- package/dist/src/MLAdapters/BoxZoomHandler.d.ts +7 -0
- package/dist/src/MLAdapters/CanvasSource.d.ts +5 -0
- package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +5 -0
- package/dist/src/MLAdapters/FullscreenControl.d.ts +5 -0
- package/dist/src/MLAdapters/GeoJSONSource.d.ts +5 -0
- package/dist/src/MLAdapters/GeolocateControl.d.ts +5 -0
- package/dist/src/MLAdapters/ImageSource.d.ts +5 -0
- package/dist/src/MLAdapters/KeyboardHandler.d.ts +5 -0
- package/dist/src/MLAdapters/LogoControl.d.ts +5 -0
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +5 -0
- package/dist/src/MLAdapters/MapTouchEvent.d.ts +5 -0
- package/dist/src/MLAdapters/MapWheelEvent.d.ts +5 -0
- package/dist/src/MLAdapters/Marker.d.ts +5 -0
- package/dist/src/MLAdapters/NavigationControl.d.ts +5 -0
- package/dist/src/MLAdapters/Popup.d.ts +5 -0
- package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/RasterTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/ScaleControl.d.ts +5 -0
- package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +5 -0
- package/dist/src/MLAdapters/Style.d.ts +5 -0
- package/dist/src/MLAdapters/TerrainControl.d.ts +5 -0
- package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +5 -0
- package/dist/src/MLAdapters/VectorTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/VideoSource.d.ts +5 -0
- package/dist/src/Map.d.ts +405 -0
- package/dist/src/Point.d.ts +177 -0
- package/dist/src/Telemetry.d.ts +40 -0
- package/dist/src/caching.d.ts +4 -0
- package/dist/src/config.d.ts +85 -0
- package/dist/src/constants/defaults.d.ts +15 -0
- package/dist/src/controls/MaptilerGeolocateControl.d.ts +21 -0
- package/dist/src/controls/MaptilerLogoControl.d.ts +19 -0
- package/dist/src/controls/MaptilerNavigationControl.d.ts +17 -0
- package/dist/src/controls/MaptilerProjectionControl.d.ts +14 -0
- package/dist/src/controls/MaptilerTerrainControl.d.ts +16 -0
- package/dist/src/controls/Minimap.d.ts +57 -0
- package/dist/src/controls/index.d.ts +6 -0
- package/dist/src/converters/index.d.ts +1 -0
- package/dist/src/converters/xml.d.ts +54 -0
- package/dist/src/custom-layers/AnimatedRouteLayer.d.ts +291 -0
- package/dist/src/helpers/index.d.ts +3 -0
- package/dist/src/helpers/screenshot.d.ts +18 -0
- package/dist/src/helpers/stylehelper.d.ts +28 -0
- package/dist/src/helpers/vectorlayerhelpers.d.ts +508 -0
- package/dist/src/index.d.ts +88 -0
- package/dist/src/language.d.ts +107 -0
- package/dist/src/mapstyle.d.ts +17 -0
- package/dist/src/tools.d.ts +84 -0
- package/dist/src/types.d.ts +1 -0
- package/dist/src/utils/MaptilerAnimation/AnimationManager.d.ts +41 -0
- package/dist/src/utils/MaptilerAnimation/MaptilerAnimation.d.ts +238 -0
- package/dist/src/utils/MaptilerAnimation/animation-helpers.d.ts +182 -0
- package/dist/src/utils/MaptilerAnimation/easing.d.ts +3 -0
- package/dist/src/utils/MaptilerAnimation/index.d.ts +7 -0
- package/dist/src/utils/MaptilerAnimation/types.d.ts +57 -0
- package/dist/src/utils/array.d.ts +1 -0
- package/dist/src/utils/dom.d.ts +2 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/vite.config-e2e.d.ts +2 -0
- package/dist/vite.config-test.d.ts +2 -0
- package/dist/vite.config-umd.d.ts +2 -0
- package/dist/vitest-setup-tests.d.ts +1 -0
- package/eslint.config.mjs +71 -0
- package/package.json +3 -3
- package/tsconfig.json +3 -2
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config-es.ts +1 -0
- package/vite.config-umd.ts +17 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as MaptilerAnimation } from './MaptilerAnimation';
|
|
2
|
+
export type * from './MaptilerAnimation';
|
|
3
|
+
export default MaptilerAnimation;
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './easing';
|
|
6
|
+
export { type KeyframeableGeometry, type KeyframeableGeoJSONFeature, lerp, lerpArrayValues, parseGeoJSONFeatureToKeyframes, createBezierPathFromCoordinates, getAverageDistance, simplifyPath, resamplePath, } from './animation-helpers';
|
|
7
|
+
export type * from './animation-helpers';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as MaptilerAnimation } from './MaptilerAnimation';
|
|
2
|
+
export declare enum EasingFunctionName {
|
|
3
|
+
Linear = "Linear",
|
|
4
|
+
QuadraticIn = "QuadraticIn",
|
|
5
|
+
QuadraticOut = "QuadraticOut",
|
|
6
|
+
QuadraticInOut = "QuadraticInOut",
|
|
7
|
+
CubicIn = "CubicIn",
|
|
8
|
+
CubicOut = "CubicOut",
|
|
9
|
+
CubicInOut = "CubicInOut",
|
|
10
|
+
SinusoidalIn = "SinusoidalIn",
|
|
11
|
+
SinusoidalOut = "SinusoidalOut",
|
|
12
|
+
SinusoidalInOut = "SinusoidalInOut",
|
|
13
|
+
ExponentialIn = "ExponentialIn",
|
|
14
|
+
ExponentialOut = "ExponentialOut",
|
|
15
|
+
ExponentialInOut = "ExponentialInOut",
|
|
16
|
+
ElasticIn = "ElasticIn",
|
|
17
|
+
ElasticOut = "ElasticOut",
|
|
18
|
+
ElasticInOut = "ElasticInOut",
|
|
19
|
+
BounceIn = "BounceIn",
|
|
20
|
+
BounceOut = "BounceOut",
|
|
21
|
+
BounceInOut = "BounceInOut"
|
|
22
|
+
}
|
|
23
|
+
export type Keyframe = {
|
|
24
|
+
props: Record<string, number | null>;
|
|
25
|
+
delta: number;
|
|
26
|
+
easing?: EasingFunctionName;
|
|
27
|
+
userData?: Record<string, any>;
|
|
28
|
+
};
|
|
29
|
+
export declare enum AnimationEventTypes {
|
|
30
|
+
Pause = "pause",
|
|
31
|
+
Reset = "reset",
|
|
32
|
+
Play = "play",
|
|
33
|
+
Stop = "stop",
|
|
34
|
+
TimeUpdate = "timeupdate",
|
|
35
|
+
Scrub = "scrub",
|
|
36
|
+
PlaybackRateChange = "playbackratechange",
|
|
37
|
+
AnimationStart = "animationstart",
|
|
38
|
+
AnimationEnd = "animationend",
|
|
39
|
+
Keyframe = "keyframe",
|
|
40
|
+
Iteration = "iteration"
|
|
41
|
+
}
|
|
42
|
+
export type NumericArrayWithNull = (number | null)[];
|
|
43
|
+
export type AnimationEvent = {
|
|
44
|
+
type: AnimationEventTypes;
|
|
45
|
+
target: MaptilerAnimation;
|
|
46
|
+
currentTime: number;
|
|
47
|
+
currentDelta: number;
|
|
48
|
+
playbackRate: number;
|
|
49
|
+
keyframe?: Keyframe | null;
|
|
50
|
+
nextKeyframe?: Keyframe | null;
|
|
51
|
+
props: Record<string, number>;
|
|
52
|
+
previousProps: Record<string, number>;
|
|
53
|
+
iteration?: number;
|
|
54
|
+
};
|
|
55
|
+
export type AnimationEventListenersRecord = Record<AnimationEventTypes, AnimationEventCallback[]>;
|
|
56
|
+
export type AnimationEventCallback = (event: AnimationEvent) => void;
|
|
57
|
+
export { MaptilerAnimation };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function arraysAreTheSameLength(...arrays: unknown[][]): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/eslint.config.mjs
CHANGED
|
@@ -8,6 +8,77 @@ export default tseslint.config(
|
|
|
8
8
|
tseslint.configs.strictTypeChecked,
|
|
9
9
|
tseslint.configs.stylisticTypeChecked,
|
|
10
10
|
tseslint.configs.recommendedTypeChecked,
|
|
11
|
+
{
|
|
12
|
+
// forked from https://www.npmjs.com/package/eslint-plugin-restrict-imports
|
|
13
|
+
plugins: {
|
|
14
|
+
import: {
|
|
15
|
+
rules: {
|
|
16
|
+
"default-imports-only": {
|
|
17
|
+
meta: {
|
|
18
|
+
type: "suggestion",
|
|
19
|
+
docs: {},
|
|
20
|
+
schema: [
|
|
21
|
+
{
|
|
22
|
+
bannedImport: {
|
|
23
|
+
locations: ["filePaths"],
|
|
24
|
+
message: "string",
|
|
25
|
+
fixedLocation: "string",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
create: function (context) {
|
|
31
|
+
const filePath = context.getFilename();
|
|
32
|
+
const options = context.options[0] || {
|
|
33
|
+
"^/(.*)": {
|
|
34
|
+
locations: ["(.*)"],
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
ImportDeclaration: (node) => {
|
|
40
|
+
Object.entries(options).forEach(([bannedImport, config]) => {
|
|
41
|
+
const importLocationRegex = new RegExp(bannedImport);
|
|
42
|
+
|
|
43
|
+
if (config.ignoreTypeImports && node.importKind === "type") return;
|
|
44
|
+
|
|
45
|
+
if (importLocationRegex.test(node.source.value)) {
|
|
46
|
+
config.locations.forEach((fp) => {
|
|
47
|
+
const bannedLocationRegex = new RegExp(fp);
|
|
48
|
+
|
|
49
|
+
if (bannedLocationRegex.test(filePath)) {
|
|
50
|
+
node.specifiers.forEach((specifier) => {
|
|
51
|
+
if (specifier.type !== "ImportDefaultSpecifier") {
|
|
52
|
+
context.report({
|
|
53
|
+
message: config.message ?? `Importing from '${bannedImport}' is banned in '${fp}'`,
|
|
54
|
+
node,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
rules: {
|
|
70
|
+
"import/default-imports-only": [
|
|
71
|
+
"error",
|
|
72
|
+
{
|
|
73
|
+
"maplibre-gl$": {
|
|
74
|
+
locations: ["^(?!.*\.d\.ts$).*\.((ts|js))$"],
|
|
75
|
+
message: `Maplibre-gl uses CJS modules, only default imports are supported, named imports may fail on some setups.`,
|
|
76
|
+
ignoreTypeImports: true,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
11
82
|
{
|
|
12
83
|
languageOptions: {
|
|
13
84
|
parserOptions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maptiler/sdk",
|
|
3
|
-
"version": "3.4.0-
|
|
3
|
+
"version": "3.4.0-rc3",
|
|
4
4
|
"description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
|
|
5
5
|
"author": "MapTiler",
|
|
6
6
|
"module": "dist/maptiler-sdk.mjs",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"dev": "concurrently \"vite -c vite.config-dev.ts\" \"npm run dev-umd\"",
|
|
48
48
|
"dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts",
|
|
49
49
|
"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",
|
|
50
|
-
"build-umd": "tsc && NODE_ENV=production vite build -c vite.config-umd.ts",
|
|
51
|
-
"build-es": "tsc && NODE_ENV=production vite build -c vite.config-es.ts",
|
|
50
|
+
"build-umd": "tsc -b && NODE_ENV=production vite build -c vite.config-umd.ts",
|
|
51
|
+
"build-es": "tsc -b && NODE_ENV=production vite build -c vite.config-es.ts",
|
|
52
52
|
"build": "npm run build-es; npm run build-umd; npm run build-css",
|
|
53
53
|
"make": "npm run install:clean && npm run build",
|
|
54
54
|
"e2e:serve": "tsc --project ./e2e && NODE_ENV=development vite -c vite.config-e2e.ts",
|
package/tsconfig.json
CHANGED
|
@@ -23,13 +23,14 @@
|
|
|
23
23
|
"declaration": true,
|
|
24
24
|
"allowSyntheticDefaultImports": true,
|
|
25
25
|
"allowJs": true,
|
|
26
|
+
"noEmitOnError": true,
|
|
26
27
|
},
|
|
27
28
|
"include": [
|
|
28
29
|
"src",
|
|
29
|
-
"
|
|
30
|
-
"./eslint.config.mjs",
|
|
30
|
+
"test",
|
|
31
31
|
"./vite.config-test.ts",
|
|
32
32
|
"./vite.config-e2e.ts",
|
|
33
|
+
"./vite.config-umd.ts",
|
|
33
34
|
"./playwright.config.ts",
|
|
34
35
|
"./vitest-setup-tests.ts"
|
|
35
36
|
],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/ColorRamp.ts","./src/Map.ts","./src/Point.ts","./src/Telemetry.ts","./src/caching.ts","./src/config.ts","./src/declarations.d.ts","./src/index.ts","./src/language.ts","./src/mapstyle.ts","./src/tools.ts","./src/types.ts","./src/MLAdapters/AttributionControl.ts","./src/MLAdapters/BoxZoomHandler.ts","./src/MLAdapters/CanvasSource.ts","./src/MLAdapters/CooperativeGesturesHandler.ts","./src/MLAdapters/FullscreenControl.ts","./src/MLAdapters/GeoJSONSource.ts","./src/MLAdapters/GeolocateControl.ts","./src/MLAdapters/ImageSource.ts","./src/MLAdapters/KeyboardHandler.ts","./src/MLAdapters/LogoControl.ts","./src/MLAdapters/MapMouseEvent.ts","./src/MLAdapters/MapTouchEvent.ts","./src/MLAdapters/MapWheelEvent.ts","./src/MLAdapters/Marker.ts","./src/MLAdapters/NavigationControl.ts","./src/MLAdapters/Popup.ts","./src/MLAdapters/RasterDEMTileSource.ts","./src/MLAdapters/RasterTileSource.ts","./src/MLAdapters/ScaleControl.ts","./src/MLAdapters/ScrollZoomHandler.ts","./src/MLAdapters/Style.ts","./src/MLAdapters/TerrainControl.ts","./src/MLAdapters/TwoFingersTouchPitchHandler.ts","./src/MLAdapters/VectorTileSource.ts","./src/MLAdapters/VideoSource.ts","./src/constants/defaults.ts","./src/controls/MaptilerGeolocateControl.ts","./src/controls/MaptilerLogoControl.ts","./src/controls/MaptilerNavigationControl.ts","./src/controls/MaptilerProjectionControl.ts","./src/controls/MaptilerTerrainControl.ts","./src/controls/Minimap.ts","./src/controls/index.ts","./src/converters/index.ts","./src/converters/xml.ts","./src/custom-layers/AnimatedRouteLayer.ts","./src/helpers/index.ts","./src/helpers/screenshot.ts","./src/helpers/stylehelper.ts","./src/helpers/vectorlayerhelpers.ts","./src/utils/array.ts","./src/utils/dom.ts","./src/utils/index.ts","./src/utils/MaptilerAnimation/AnimationManager.ts","./src/utils/MaptilerAnimation/MaptilerAnimation.ts","./src/utils/MaptilerAnimation/animation-helpers.ts","./src/utils/MaptilerAnimation/easing.ts","./src/utils/MaptilerAnimation/index.ts","./src/utils/MaptilerAnimation/types.ts","./test/exports.test.ts","./test/AnimatedRouteLayer/AnimatedRouteLayer.test.ts","./test/MaptilerAnimation/MaptilerAnimation.test.ts","./test/MaptilerAnimation/animation-helpers.test.ts","./test/MaptilerAnimation/easing-function.test.ts","./test/converters/xml.test.ts","./test/fixtures/animations/average-distance.fixture.ts","./test/fixtures/animations/keyframes.fixture.ts","./test/fixtures/animations/simplify-path.fixture.ts","./vite.config-test.ts","./vite.config-e2e.ts","./vite.config-umd.ts","./playwright.config.ts","./vitest-setup-tests.ts"],"version":"5.7.3"}
|
package/vite.config-es.ts
CHANGED
package/vite.config-umd.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolve } from
|
|
2
|
-
import { defineConfig } from
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
3
|
import packagejson from "./package.json";
|
|
4
4
|
|
|
5
5
|
const isProduction = process.env.NODE_ENV === "production";
|
|
@@ -12,11 +12,21 @@ export default defineConfig({
|
|
|
12
12
|
emptyOutDir: isProduction,
|
|
13
13
|
sourcemap: true,
|
|
14
14
|
lib: {
|
|
15
|
-
entry: resolve(__dirname,
|
|
16
|
-
name:
|
|
17
|
-
fileName: (
|
|
18
|
-
formats: [
|
|
19
|
-
}
|
|
15
|
+
entry: resolve(__dirname, "src/index.ts"),
|
|
16
|
+
name: "maptilersdk",
|
|
17
|
+
fileName: (_, __) => "maptiler-sdk.umd.min.js",
|
|
18
|
+
formats: ["umd"],
|
|
19
|
+
},
|
|
20
|
+
rollupOptions: {
|
|
21
|
+
// make sure to externalize deps that shouldn't be bundled
|
|
22
|
+
// into your library
|
|
23
|
+
external: ["./e2e"],
|
|
24
|
+
output: {
|
|
25
|
+
// Provide global variables to use in the UMD build
|
|
26
|
+
// for externalized deps
|
|
27
|
+
globals: {},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
20
30
|
},
|
|
21
31
|
define: {
|
|
22
32
|
__MT_SDK_VERSION__: JSON.stringify(packagejson.version),
|