@maptiler/sdk 3.4.0-rc3 → 3.4.0

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 (82) hide show
  1. package/.husky/pre-commit +2 -2
  2. package/README.md +133 -155
  3. package/dist/eslint.mjs +133 -0
  4. package/dist/maptiler-sdk.mjs +3788 -2749
  5. package/dist/maptiler-sdk.mjs.map +1 -1
  6. package/dist/src/Map.d.ts +22 -3
  7. package/dist/src/Telemetry.d.ts +1 -20
  8. package/dist/src/controls/Minimap.d.ts +1 -1
  9. package/dist/src/custom-layers/CubemapLayer/CubemapLayer.d.ts +216 -0
  10. package/dist/src/custom-layers/CubemapLayer/constants.d.ts +3 -0
  11. package/dist/src/custom-layers/CubemapLayer/index.d.ts +2 -0
  12. package/dist/src/custom-layers/CubemapLayer/loadCubemapTexture.d.ts +41 -0
  13. package/dist/src/custom-layers/CubemapLayer/types.d.ts +67 -0
  14. package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +128 -0
  15. package/dist/src/custom-layers/RadialGradientLayer/index.d.ts +2 -0
  16. package/dist/src/custom-layers/RadialGradientLayer/types.d.ts +50 -0
  17. package/dist/src/custom-layers/extractCustomLayerStyle.d.ts +17 -0
  18. package/dist/src/custom-layers/index.d.ts +5 -0
  19. package/dist/src/helpers/index.d.ts +2 -0
  20. package/dist/src/index.d.ts +2 -1
  21. package/dist/src/utils/geo-utils.d.ts +6 -0
  22. package/dist/src/utils/index.d.ts +0 -3
  23. package/dist/src/utils/math-utils.d.ts +8 -0
  24. package/dist/src/utils/webgl-utils.d.ts +49 -0
  25. package/eslint.config.mjs +5 -5
  26. package/package.json +20 -17
  27. package/tsconfig.json +12 -7
  28. package/typedoc.json +2 -3
  29. package/dist/playwright.config.d.ts +0 -9
  30. package/dist/src/custom-layers/AnimatedRouteLayer.d.ts +0 -291
  31. package/dist/src/utils/MaptilerAnimation/AnimationManager.d.ts +0 -41
  32. package/dist/src/utils/MaptilerAnimation/MaptilerAnimation.d.ts +0 -238
  33. package/dist/src/utils/MaptilerAnimation/animation-helpers.d.ts +0 -182
  34. package/dist/src/utils/MaptilerAnimation/easing.d.ts +0 -3
  35. package/dist/src/utils/MaptilerAnimation/index.d.ts +0 -7
  36. package/dist/src/utils/MaptilerAnimation/types.d.ts +0 -57
  37. package/dist/src/utils/array.d.ts +0 -1
  38. package/dist/vite.config-e2e.d.ts +0 -2
  39. package/dist/vite.config-test.d.ts +0 -2
  40. package/dist/vite.config-umd.d.ts +0 -2
  41. package/dist/vitest-setup-tests.d.ts +0 -1
  42. package/e2e/global.d.ts +0 -12
  43. package/e2e/public/animated-route.geojson +0 -82
  44. package/e2e/public/animatedRouteLayer.html +0 -24
  45. package/e2e/public/mapLoad.html +0 -24
  46. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-0-chromium-darwin.png +0 -0
  47. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-1-chromium-darwin.png +0 -0
  48. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-10-chromium-darwin.png +0 -0
  49. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-11-chromium-darwin.png +0 -0
  50. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-12-chromium-darwin.png +0 -0
  51. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-13-chromium-darwin.png +0 -0
  52. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-14-chromium-darwin.png +0 -0
  53. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-15-chromium-darwin.png +0 -0
  54. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-16-chromium-darwin.png +0 -0
  55. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-17-chromium-darwin.png +0 -0
  56. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-18-chromium-darwin.png +0 -0
  57. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-19-chromium-darwin.png +0 -0
  58. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-2-chromium-darwin.png +0 -0
  59. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-3-chromium-darwin.png +0 -0
  60. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-4-chromium-darwin.png +0 -0
  61. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-5-chromium-darwin.png +0 -0
  62. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-6-chromium-darwin.png +0 -0
  63. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-7-chromium-darwin.png +0 -0
  64. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-8-chromium-darwin.png +0 -0
  65. package/e2e/snapshots/tests/AnimatedRouteLayer.test.ts-snapshots/animated-route-9-chromium-darwin.png +0 -0
  66. package/e2e/snapshots/tests/map-load.test.ts-snapshots/mapLoad-chromium-darwin.png +0 -0
  67. package/e2e/tests/AnimatedRouteLayer.test.ts +0 -45
  68. package/e2e/tests/consts.ts +0 -0
  69. package/e2e/tests/expected-results/animatedRouteLayer-1.json +0 -202
  70. package/e2e/tests/helpers/fetchGeojson.ts +0 -21
  71. package/e2e/tests/helpers/getMapInstanceForFixture.ts +0 -86
  72. package/e2e/tests/map-load.test.ts +0 -14
  73. package/e2e/tests/mocks/maptiler-style.json +0 -27
  74. package/e2e/tests/mocks/tile.png +0 -0
  75. package/e2e/tsconfig.json +0 -10
  76. package/playwright.config.ts +0 -82
  77. package/tsconfig.tsbuildinfo +0 -1
  78. package/vite.config-dev.ts +0 -34
  79. package/vite.config-e2e.ts +0 -13
  80. package/vite.config-es.ts +0 -53
  81. package/vite.config-test.ts +0 -17
  82. package/vite.config-umd.ts +0 -35
@@ -1,45 +0,0 @@
1
- import { expect, test } from "@playwright/test";
2
- import getMapInstanceForFixture from "./helpers/getMapInstanceForFixture";
3
- import { AnimatedRouteLayer } from "index";
4
- import { Map } from "@maptiler/sdk";
5
- import expected from "./expected-results/animatedRouteLayer-1.json" assert { type: "json" };
6
-
7
- test("Follows the correct path taking screenshots at each interval", async ({ page }) => {
8
- await getMapInstanceForFixture({
9
- fixture: "animatedRouteLayer",
10
- page,
11
- timeout: 10000,
12
- });
13
-
14
- expect(await page.title()).toBe("MapTiler E2E Animated Route Layer");
15
-
16
- await page.exposeFunction("notifyScreenshotStateReady", async (data: Record<string, TTestTransferData>) => {
17
- await expect(page).toHaveScreenshot(`animated-route-${data.frame}.png`);
18
- expect(data).toEqual(expected[data.frame as number]);
19
- });
20
-
21
- await page.clock.install();
22
-
23
- await page.evaluate(async () => {
24
- const NUM_SCREENSHOTS = 20;
25
- const NUM_FRAMES_BETWEEN_SCREENSHOTS = 20;
26
-
27
- const { animatedRouteLayer } = window.__pageObjects as { animatedRouteLayer: AnimatedRouteLayer };
28
- const map = window.__map as Map;
29
-
30
- for (let i = 0; i < NUM_SCREENSHOTS; i++) {
31
- for (let j = 0; j < NUM_FRAMES_BETWEEN_SCREENSHOTS; j++) {
32
- animatedRouteLayer.updateManual();
33
- }
34
- await window.notifyScreenshotStateReady({
35
- frame: i,
36
- center: map.getCenter().toArray(),
37
- zoom: map.getZoom(),
38
- pitch: map.getPitch(),
39
- bearing: map.getBearing(),
40
- });
41
- }
42
- });
43
-
44
- await page.clock.runFor(10000);
45
- });
File without changes
@@ -1,202 +0,0 @@
1
- [
2
- {
3
- "frame": 0,
4
- "center": [
5
- -5.466042011463379,
6
- 55.4577906319048
7
- ],
8
- "zoom": 13.598461538461539,
9
- "pitch": 31.96923076923077,
10
- "bearing": 11.519999999999984
11
- },
12
- {
13
- "frame": 1,
14
- "center": [
15
- -5.460399670970225,
16
- 55.4563116595035
17
- ],
18
- "zoom": 13.696923076923076,
19
- "pitch": 33.93846153846154,
20
- "bearing": 23.039999999999967
21
- },
22
- {
23
- "frame": 2,
24
- "center": [
25
- -5.454680854842297,
26
- 55.454199187343335
27
- ],
28
- "zoom": 13.795384615384616,
29
- "pitch": 35.90769230769231,
30
- "bearing": 34.55999999999994
31
- },
32
- {
33
- "frame": 3,
34
- "center": [
35
- -5.449154714432449,
36
- 55.45161563359928
37
- ],
38
- "zoom": 13.893846153846155,
39
- "pitch": 37.87692307692308,
40
- "bearing": 46.08000000000004
41
- },
42
- {
43
- "frame": 4,
44
- "center": [
45
- -5.4440854476088205,
46
- 55.448695922972746
47
- ],
48
- "zoom": 13.992307692307692,
49
- "pitch": 39.84615384615384,
50
- "bearing": 57.5999999999999
51
- },
52
- {
53
- "frame": 5,
54
- "center": [
55
- -5.439747931704942,
56
- 55.4455842681447
57
- ],
58
- "zoom": 14.09076923076923,
59
- "pitch": 41.8153846153846,
60
- "bearing": 69.11999999999988
61
- },
62
- {
63
- "frame": 6,
64
- "center": [
65
- -5.436381601488342,
66
- 55.44242356593315
67
- ],
68
- "zoom": 14.189230769230766,
69
- "pitch": 43.78461538461536,
70
- "bearing": 80.63999999999987
71
- },
72
- {
73
- "frame": 7,
74
- "center": [
75
- -5.434285966180362,
76
- 55.43932695213108
77
- ],
78
- "zoom": 14.287692307692307,
79
- "pitch": 45.753846153846105,
80
- "bearing": 92.15999999999974
81
- },
82
- {
83
- "frame": 8,
84
- "center": [
85
- -5.433268915702869,
86
- 55.43589535070747
87
- ],
88
- "zoom": 14.386153846153844,
89
- "pitch": 47.723076923076874,
90
- "bearing": 103.67999999999961
91
- },
92
- {
93
- "frame": 9,
94
- "center": [
95
- -5.433177455811488,
96
- 55.43198983159487
97
- ],
98
- "zoom": 14.484615384615381,
99
- "pitch": 49.69230769230762,
100
- "bearing": 115.19999999999958
101
- },
102
- {
103
- "frame": 10,
104
- "center": [
105
- -5.433880699537133,
106
- 55.42784291729489
107
- ],
108
- "zoom": 14.577142857142853,
109
- "pitch": 51.54285714285707,
110
- "bearing": 126.71999999999957
111
- },
112
- {
113
- "frame": 11,
114
- "center": [
115
- -5.435326079044055,
116
- 55.423654806187365
117
- ],
118
- "zoom": 14.668571428571424,
119
- "pitch": 53.37142857142849,
120
- "bearing": 138.23999999999944
121
- },
122
- {
123
- "frame": 12,
124
- "center": [
125
- -5.437416792145254,
126
- 55.419638086917715
127
- ],
128
- "zoom": 14.759999999999996,
129
- "pitch": 55.1999999999999,
130
- "bearing": 149.75999999999942
131
- },
132
- {
133
- "frame": 13,
134
- "center": [
135
- -5.440072094355931,
136
- 55.41599788270592
137
- ],
138
- "zoom": 14.851428571428567,
139
- "pitch": 57.028571428571325,
140
- "bearing": 161.2799999999993
141
- },
142
- {
143
- "frame": 14,
144
- "center": [
145
- -5.4432174520051015,
146
- 55.412956866373364
147
- ],
148
- "zoom": 14.942857142857138,
149
- "pitch": 58.85714285714275,
150
- "bearing": 172.79999999999927
151
- },
152
- {
153
- "frame": 15,
154
- "center": [
155
- -5.446829788111814,
156
- 55.41064796034502
157
- ],
158
- "zoom": 14.963076923076928,
159
- "pitch": 59.26153846153856,
160
- "bearing": -175.5692307692314
161
- },
162
- {
163
- "frame": 16,
164
- "center": [
165
- -5.451519315760324,
166
- 55.40879433251729
167
- ],
168
- "zoom": 14.864615384615387,
169
- "pitch": 57.292307692307745,
170
- "bearing": -163.75384615384647
171
- },
172
- {
173
- "frame": 17,
174
- "center": [
175
- -5.457134643435197,
176
- 55.407280629375585
177
- ],
178
- "zoom": 14.766153846153847,
179
- "pitch": 55.32307692307692,
180
- "bearing": -151.9384615384615
181
- },
182
- {
183
- "frame": 18,
184
- "center": [
185
- -5.463405013806986,
186
- 55.40615466316898
187
- ],
188
- "zoom": 14.667692307692304,
189
- "pitch": 53.3538461538461,
190
- "bearing": -140.1230769230766
191
- },
192
- {
193
- "frame": 19,
194
- "center": [
195
- -5.469987343492665,
196
- 55.405428197723374
197
- ],
198
- "zoom": 14.569230769230764,
199
- "pitch": 51.38461538461526,
200
- "bearing": -128.30769230769158
201
- }
202
- ]
@@ -1,21 +0,0 @@
1
- import { KeyframeableGeoJSONFeature } from "utils";
2
-
3
- type GeoJSON = {
4
- type: "FeatureCollection";
5
- features: KeyframeableGeoJSONFeature[];
6
- };
7
-
8
- export default async function fetchGeoJSON(assetUrl: string): Promise<GeoJSON> {
9
- try {
10
- const response = await fetch(assetUrl);
11
-
12
- if (!response.ok) {
13
- throw new Error(`Failed to fetch GeoJSON: ${response.statusText}`);
14
- }
15
-
16
- const geojson = await response.json();
17
- return geojson as GeoJSON;
18
- } catch (e) {
19
- throw e;
20
- }
21
- }
@@ -1,86 +0,0 @@
1
- import { Page, expect } from "@playwright/test";
2
- import path from "path";
3
-
4
- interface IgetMapInstanceForFixture {
5
- fixture: string;
6
- page: Page;
7
- mockStyle?: boolean;
8
- mockTiles?: boolean;
9
- debug?: boolean;
10
- timeout?: number;
11
- }
12
-
13
- export default async function getMapInstanceForFixture({ fixture, page, mockStyle = true, mockTiles = true, debug = false, timeout = 10000 }: IgetMapInstanceForFixture) {
14
- await page.addInitScript((plt) => {
15
- console.log(plt);
16
- window.__pageLoadTimeout = plt;
17
- }, timeout);
18
-
19
- if (mockStyle) {
20
- // mock style response
21
- await page.route("https://api.maptiler.com/maps/*/*.json*", async (route) => {
22
- if (debug) console.info(`ℹ️ Style intercepted at ${route.request().url()}`);
23
- await route.fulfill({
24
- status: 200,
25
- contentType: "application/json",
26
- path: path.resolve(import.meta.dirname, "../mocks/maptiler-style.json"),
27
- });
28
- });
29
- }
30
-
31
- if (mockTiles) {
32
- // mocks the tile response always returning the mock tile
33
- await page.route("https://api.maptiler.com/tiles/*/*/*/*.jpg?key=*&*", (route) => {
34
- if (debug) console.info(`ℹ️ Tile intercepted at ${route.request().url()}`);
35
- return route.fulfill({
36
- status: 200,
37
- contentType: "image/png",
38
- path: path.resolve(import.meta.dirname, "../mocks/tile.png"),
39
- });
40
- });
41
- }
42
-
43
- page.on("console", (msg) => {
44
- console.log("FIXTURE LOG:", msg.text());
45
- if (debug) {
46
- console.log("DEBUG FIXTURE LOG:", msg.location(), msg.text());
47
- }
48
- });
49
-
50
- page.addListener("requestfinished", async (request) => {
51
- const response = await request.response();
52
- if (response && response.status() >= 400) {
53
- console.error(`\n\nFailed to load ${request.url()}\n status: ${response.status()}\n\n`);
54
- expect(response.status()).toBeLessThan(400);
55
- }
56
- });
57
-
58
- await page.goto(`http://localhost:5173/${fixture}.html`, {
59
- waitUntil: "domcontentloaded",
60
- });
61
-
62
- try {
63
- const map = await page.evaluateHandle(() => {
64
- return Promise.race([
65
- new Promise(async (resolve) => {
66
- console.log("Window.__map", window.__map);
67
- window.__map.on("idle", () => {;
68
- resolve(window.__map);
69
- });
70
- }),
71
- new Promise((_, reject) => {
72
- setTimeout(() => {
73
- reject(new Error("Map did not load in time"));
74
- }, window.__pageLoadTimeout);
75
- }),
76
- ]);
77
- });
78
-
79
- return {
80
- map,
81
- };
82
- } catch (e) {
83
- console.error(e);
84
- return {};
85
- }
86
- }
@@ -1,14 +0,0 @@
1
- import { expect, test } from "@playwright/test";
2
-
3
- import getMapInstanceForFixture from "./helpers/getMapInstanceForFixture";
4
-
5
- test("Awaits until map ready and takes snapshot", async ({ page }) => {
6
- await getMapInstanceForFixture({
7
- fixture: "mapLoad",
8
- page,
9
- });
10
-
11
- expect(await page.title()).toBe("MapTiler E2E Map Load");
12
-
13
- await expect(page).toHaveScreenshot("mapLoad.png");
14
- });
@@ -1,27 +0,0 @@
1
- {
2
- "version": 8,
3
- "sources": {
4
- "raster": {
5
- "type": "raster",
6
- "tiles": [
7
- "https://api.maptiler.com/tiles/satellite/{z}/{x}/{y}.jpg?key=DOESNT_MATTER"
8
- ],
9
- "tileSize": 256
10
- }
11
- },
12
- "layers": [
13
- {
14
- "id": "raster",
15
- "type": "raster",
16
- "source": "raster",
17
- "minzoom": 0,
18
- "maxzoom": 22
19
- }
20
- ],
21
- "metadata": {
22
- "maptiler": {
23
- "version": "1.0.0",
24
- "attribution": "© MapTiler © OpenStreetMap contributors"
25
- }
26
- }
27
- }
Binary file
package/e2e/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../tsconfig.json",
3
- "compilerOptions": {
4
- "types": ["./global.d.ts"],
5
- "noUnusedLocals": false,
6
- "noUnusedParameters": false,
7
- "moduleResolution": "node",
8
- "resolveJsonModule": true
9
- }
10
- }
@@ -1,82 +0,0 @@
1
- import { defineConfig, devices } from "@playwright/test";
2
-
3
- /**
4
- * Read environment variables from file.
5
- * https://github.com/motdotla/dotenv
6
- */
7
- // import dotenv from 'dotenv';
8
- // import path from 'path';
9
- // dotenv.config({ path: path.resolve(__dirname, '.env') });
10
-
11
- /**
12
- * See https://playwright.dev/docs/test-configuration.
13
- */
14
- export default defineConfig({
15
- testDir: "e2e",
16
- // testMatch: '**/*.test.ts',
17
- /* Run tests in files in parallel */
18
- fullyParallel: true,
19
- /* Fail the build on CI if you accidentally left test.only in the source code. */
20
- forbidOnly: !!process.env.CI,
21
- /* Retry on CI only */
22
- retries: process.env.CI ? 2 : 0,
23
- /* Opt out of parallel tests on CI. */
24
- workers: process.env.CI ? 1 : undefined,
25
- /* Reporter to use. See https://playwright.dev/docs/test-reporters */
26
- reporter: "html",
27
- tsconfig: "./e2e/tsconfig.json",
28
-
29
- /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
30
- use: {
31
- /* Base URL to use in actions like `await page.goto('/')`. */
32
- // baseURL: 'http://127.0.0.1:3000',
33
-
34
- /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
35
- trace: "on-first-retry",
36
- },
37
-
38
- snapshotDir: "./e2e/snapshots",
39
- /* Configure projects for major browsers */
40
- projects: [
41
- {
42
- name: "chromium",
43
- use: { ...devices["Desktop Chrome"] },
44
- },
45
-
46
- // {
47
- // name: 'firefox',
48
- // use: { ...devices['Desktop Firefox'] },
49
- // },
50
-
51
- // {
52
- // name: 'webkit',
53
- // use: { ...devices['Desktop Safari'] },
54
- // },
55
- /* Test against mobile viewports. */
56
- // {
57
- // name: 'Mobile Chrome',
58
- // use: { ...devices['Pixel 5'] },
59
- // },
60
- // {
61
- // name: 'Mobile Safari',
62
- // use: { ...devices['iPhone 12'] },
63
- // },
64
-
65
- /* Test against branded browsers. */
66
- // {
67
- // name: 'Microsoft Edge',
68
- // use: { ...devices['Desktop Edge'], channel: 'msedge' },
69
- // },
70
- // {
71
- // name: 'Google Chrome',
72
- // use: { ...devices['Desktop Chrome'], channel: 'chrome' },
73
- // },
74
- ],
75
-
76
- /* Run your local dev server before starting the tests */
77
- // webServer: {
78
- // command: 'npm run e2e:serve',
79
- // url: 'http://localhost:5173',
80
- // reuseExistingServer: !process.env.CI,
81
- // },
82
- });
@@ -1 +0,0 @@
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"}
@@ -1,34 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
- import packagejson from "./package.json";
3
-
4
- export default defineConfig({
5
- server: {
6
- port: 3000,
7
- },
8
- define: {
9
- __MT_SDK_VERSION__: JSON.stringify(packagejson.version),
10
- },
11
- plugins: [
12
- {
13
- name: 'url-override',
14
- /**
15
- * Changing logged URLs to include the path to the demo directory.
16
- */
17
- configureServer: (server) => {
18
- const printUrls = server.printUrls;
19
-
20
- server.printUrls = () => {
21
- if (server.resolvedUrls !== null) {
22
- for (const [key, value] of Object.entries(server.resolvedUrls)) {
23
- for (let i = 0; i < value.length; i++) {
24
- server.resolvedUrls[key][i] += "demos/index.html";
25
- }
26
- }
27
- }
28
-
29
- printUrls();
30
- }
31
- }
32
- }
33
- ],
34
- });
@@ -1,13 +0,0 @@
1
- import { defineConfig } from "vite";
2
-
3
- export default defineConfig({
4
- build: {
5
- rollupOptions: {
6
- input: {
7
- mapLoad: "public/mapLoad.html",
8
- animatedRoutLayer: "public/animatedRouteLayer.html",
9
- },
10
- },
11
- },
12
- root: "./e2e",
13
- });
package/vite.config-es.ts DELETED
@@ -1,53 +0,0 @@
1
- import { resolve } from 'path';
2
- import { defineConfig } from 'vite';
3
- import dts from 'vite-plugin-dts';
4
- import packagejson from "./package.json";
5
-
6
- const isProduction = process.env.NODE_ENV === "production";
7
-
8
- const plugins = [
9
- dts({insertTypesEntry: true}),
10
- ];
11
-
12
- export default defineConfig({
13
- mode: isProduction ? "production" : "development",
14
- build: {
15
- minify: isProduction,
16
- emptyOutDir: isProduction,
17
- outDir: "dist",
18
- sourcemap: true,
19
- lib: {
20
- // Could also be a dictionary or array of multiple entry points
21
- entry: resolve(__dirname, 'src/index.ts'),
22
- name: 'maptilersdk',
23
- // the proper extensions will be added
24
- fileName: (format, entryName) => "maptiler-sdk.mjs",
25
- formats: ['es'],
26
- },
27
-
28
- rollupOptions: {
29
- // make sure to externalize deps that shouldn't be bundled
30
- // into your library
31
- external: [
32
- "./e2e/",
33
- "maplibre-gl",
34
- "@maptiler/client",
35
- "@mapbox/point-geometry",
36
- "uuid",
37
- "@mapbox/unitbezier",
38
- "events",
39
- "js-base64",
40
- "geojson-validation",
41
- ],
42
- output: {
43
- // Provide global variables to use in the UMD build
44
- // for externalized deps
45
- globals: {},
46
- },
47
- },
48
- },
49
- define: {
50
- __MT_SDK_VERSION__: JSON.stringify(packagejson.version),
51
- },
52
- plugins,
53
- })
@@ -1,17 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
- import packagejson from "./package.json";
3
-
4
- export default defineConfig({
5
- test: {
6
- include: ["test/**/*.test.ts"],
7
- typecheck: {
8
- tsconfig: "./tsconfig.json",
9
- },
10
- // environment: "jsdom",
11
- globals: true,
12
- setupFiles: ["@vitest/web-worker", "./vitest-setup-tests.ts"],
13
- },
14
- define: {
15
- __MT_SDK_VERSION__: JSON.stringify(packagejson.version),
16
- },
17
- });