terra-draw 0.0.1-alpha.67 → 0.0.1-alpha.69

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 (44) hide show
  1. package/dist/adapters/google-maps.adapter.d.ts +0 -1
  2. package/dist/common.d.ts +14 -2
  3. package/dist/geometry/measure/bearing.d.ts +2 -0
  4. package/dist/geometry/measure/destination.d.ts +2 -0
  5. package/dist/geometry/measure/slice-along.d.ts +2 -0
  6. package/dist/geometry/shape/create-bbox.d.ts +1 -1
  7. package/dist/geometry/shape/create-circle.d.ts +6 -0
  8. package/dist/geometry/shape/great-circle-coordinates.d.ts +2 -0
  9. package/dist/geometry/shape/web-mercator-distortion.d.ts +2 -0
  10. package/dist/modes/base.mode.d.ts +4 -2
  11. package/dist/modes/circle/circle.mode.d.ts +6 -5
  12. package/dist/modes/insert-coordinates.behavior.d.ts +9 -0
  13. package/dist/modes/linestring/linestring.mode.d.ts +16 -3
  14. package/dist/modes/polygon/polygon.mode.d.ts +1 -2
  15. package/dist/modes/static/static.mode.d.ts +5 -5
  16. package/dist/terra-draw.cjs +1 -1
  17. package/dist/terra-draw.cjs.map +1 -1
  18. package/dist/terra-draw.d.ts +6 -6
  19. package/dist/terra-draw.modern.js +1 -1
  20. package/dist/terra-draw.modern.js.map +1 -1
  21. package/dist/terra-draw.module.js +1 -1
  22. package/dist/terra-draw.module.js.map +1 -1
  23. package/dist/terra-draw.umd.js +1 -1
  24. package/dist/terra-draw.umd.js.map +1 -1
  25. package/dist/validations/linestring.validation.d.ts +2 -0
  26. package/dist/validations/max-size.validation.d.ts +2 -2
  27. package/dist/validations/min-size.validation.d.ts +2 -2
  28. package/dist/validations/not-self-intersecting.validation.d.ts +2 -0
  29. package/dist/validations/point.validation.d.ts +2 -0
  30. package/dist/validations/polygon.validation.d.ts +3 -0
  31. package/e2e/package-lock.json +231 -206
  32. package/e2e/package.json +9 -9
  33. package/e2e/public/favicon.ico +0 -0
  34. package/e2e/public/index.html +0 -1
  35. package/e2e/tests/leaflet.spec.ts +276 -46
  36. package/e2e/tests/setup.ts +18 -10
  37. package/package.json +33 -32
  38. package/tsconfig.json +9 -1
  39. package/dist/geometry/boolean/is-valid-linestring-feature.d.ts +0 -2
  40. package/dist/geometry/boolean/is-valid-point.d.ts +0 -2
  41. package/dist/geometry/boolean/is-valid-polygon-feature.d.ts +0 -3
  42. package/dist/geometry/shape/great-circle-line.d.ts +0 -12
  43. package/dist/modes/great-circle-snapping.behavior.d.ts +0 -14
  44. package/dist/modes/greatcircle/great-circle.mode.d.ts +0 -64
package/e2e/package.json CHANGED
@@ -13,14 +13,14 @@
13
13
  "author": "James Milner",
14
14
  "license": "MIT",
15
15
  "devDependencies": {
16
- "@playwright/test": "^1.40.1",
17
- "@types/jest": "^29.5.12",
18
- "@types/node": "^20.10.5",
19
- "dotenv-webpack": "^8.0.0",
20
- "ts-loader": "^9.5.1",
21
- "typescript": "^4.7.4",
22
- "webpack": "^5.73.0",
23
- "webpack-cli": "^4.10.0",
24
- "webpack-dev-server": "^4.11.1"
16
+ "@playwright/test": "1.40.1",
17
+ "@types/jest": "29.5.12",
18
+ "@types/node": "20.10.5",
19
+ "dotenv-webpack": "8.0.0",
20
+ "ts-loader": "9.5.1",
21
+ "typescript": "5.5.2",
22
+ "webpack": "5.73.0",
23
+ "webpack-cli": "4.10.0",
24
+ "webpack-dev-server": "4.11.1"
25
25
  }
26
26
  }
Binary file
@@ -42,7 +42,6 @@
42
42
  <button id="polygon">Polygon</button>
43
43
  <button id="rectangle">Rectangle</button>
44
44
  <button id="circle">Circle</button>
45
- <button id="greatcircle">Greatcircle</button>
46
45
  <button id="clear">Clear</button>
47
46
  </div>
48
47
 
@@ -8,6 +8,7 @@ import {
8
8
  expectPaths,
9
9
  pageUrl,
10
10
  setupMap,
11
+ TestConfigOptions,
11
12
  } from "./setup";
12
13
 
13
14
  test.describe("page setup", () => {
@@ -77,55 +78,120 @@ test.describe("point mode", () => {
77
78
  test.describe("linestring mode", () => {
78
79
  const mode = "linestring";
79
80
 
80
- test("mode can set and can be used to create a linestring", async ({
81
- page,
82
- }) => {
83
- const mapDiv = await setupMap({ page });
84
- await changeMode({ page, mode });
81
+ const options = [
82
+ { name: "", config: undefined },
83
+ {
84
+ name: " with insert coordinates for web mercator projection",
85
+ config: "insertCoordinates",
86
+ },
87
+ {
88
+ name: " with insert coordinates for globe projection",
89
+ config: "insertCoordinatesGlobe",
90
+ },
91
+ ] as { name: string; config: TestConfigOptions }[];
92
+
93
+ for (const { name, config } of options) {
94
+ test(`mode can set and can be used to create a linestring${name}`, async ({
95
+ page,
96
+ }) => {
97
+ const mapDiv = await setupMap({ page, configQueryParam: config });
98
+ await changeMode({ page, mode });
99
+
100
+ await page.mouse.move(mapDiv.width / 2, mapDiv.height / 2);
101
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 2);
102
+ await page.mouse.move(mapDiv.width / 3, mapDiv.height / 3);
103
+ await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
104
+
105
+ // Close
106
+ await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
107
+
108
+ await expectPaths({ page, count: 1 });
109
+ });
85
110
 
86
- await page.mouse.move(mapDiv.width / 2, mapDiv.height / 2);
87
- await page.mouse.click(mapDiv.width / 2, mapDiv.height / 2);
88
- await page.mouse.move(mapDiv.width / 3, mapDiv.height / 3);
89
- await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
111
+ test(`mode can set and can be used to create a linestring with multiple points${name}`, async ({
112
+ page,
113
+ }) => {
114
+ const mapDiv = await setupMap({ page, configQueryParam: config });
115
+ await changeMode({ page, mode });
90
116
 
91
- await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
117
+ await page.mouse.move(mapDiv.width / 2, mapDiv.height / 2);
118
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 2);
119
+ await page.mouse.move(mapDiv.width / 3, mapDiv.height / 3);
120
+ await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
92
121
 
93
- await expectPaths({ page, count: 1 });
94
- });
122
+ // Draw coordinate 2
123
+ await page.mouse.move(mapDiv.width / 3, mapDiv.height / 2);
124
+ await page.mouse.click(mapDiv.width / 3, mapDiv.height / 2);
95
125
 
96
- test("mode can set and can be used to create multiple linestrings", async ({
97
- page,
98
- }) => {
99
- const mapDiv = await setupMap({ page });
100
- await changeMode({ page, mode });
126
+ // Draw coordinate 3
127
+ await page.mouse.move(mapDiv.width / 2, mapDiv.height / 3);
128
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 3);
101
129
 
102
- // First line
103
- await page.mouse.move(mapDiv.width / 2, mapDiv.height / 2);
104
- await page.mouse.click(mapDiv.width / 2, mapDiv.height / 2);
105
- await page.mouse.move(mapDiv.width / 3, mapDiv.height / 3);
106
- await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
130
+ // Close
131
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 3);
107
132
 
108
- // One point + one line
109
- await expectPaths({ page, count: 2 });
133
+ await expectPaths({ page, count: 1 });
134
+ });
110
135
 
111
- // Close first line
112
- await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
136
+ test(`mode can set and can be used to create a linestring with multiple clicked points${name}`, async ({
137
+ page,
138
+ }) => {
139
+ const mapDiv = await setupMap({ page, configQueryParam: config });
140
+ await changeMode({ page, mode });
113
141
 
114
- // One line
115
- await expectPaths({ page, count: 1 });
142
+ await page.mouse.move(mapDiv.width / 2, mapDiv.height / 2);
143
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 2);
144
+ await page.mouse.move(mapDiv.width / 3, mapDiv.height / 3);
145
+ await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
116
146
 
117
- // Second line
118
- await page.mouse.move(mapDiv.width / 4, mapDiv.height / 4);
119
- await page.mouse.click(mapDiv.width / 4, mapDiv.height / 4);
120
- await page.mouse.move(mapDiv.width / 5, mapDiv.height / 5);
121
- await page.mouse.click(mapDiv.width / 5, mapDiv.height / 5);
147
+ // Draw coordinate 2
148
+ await page.mouse.move(mapDiv.width / 3, mapDiv.height / 2);
149
+ await page.mouse.click(mapDiv.width / 3, mapDiv.height / 2);
122
150
 
123
- // Close second line
124
- await page.mouse.click(mapDiv.width / 5, mapDiv.height / 5);
151
+ // Draw coordinate 3
152
+ await page.mouse.move(mapDiv.width / 2, mapDiv.height / 3);
153
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 3);
125
154
 
126
- // Two lines
127
- await expectPaths({ page, count: 2 });
128
- });
155
+ // Close
156
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 3);
157
+
158
+ await expectPaths({ page, count: 1 });
159
+ });
160
+
161
+ test(`mode can set and can be used to create multiple linestrings${name}`, async ({
162
+ page,
163
+ }) => {
164
+ const mapDiv = await setupMap({ page, configQueryParam: config });
165
+ await changeMode({ page, mode });
166
+
167
+ // First line
168
+ await page.mouse.move(mapDiv.width / 2, mapDiv.height / 2);
169
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 2);
170
+ await page.mouse.move(mapDiv.width / 3, mapDiv.height / 3);
171
+ await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
172
+
173
+ // One point + one line
174
+ await expectPaths({ page, count: 2 });
175
+
176
+ // Close first line
177
+ await page.mouse.click(mapDiv.width / 3, mapDiv.height / 3);
178
+
179
+ // One line
180
+ await expectPaths({ page, count: 1 });
181
+
182
+ // Second line
183
+ await page.mouse.move(mapDiv.width / 4, mapDiv.height / 4);
184
+ await page.mouse.click(mapDiv.width / 4, mapDiv.height / 4);
185
+ await page.mouse.move(mapDiv.width / 5, mapDiv.height / 5);
186
+ await page.mouse.click(mapDiv.width / 5, mapDiv.height / 5);
187
+
188
+ // Close second line
189
+ await page.mouse.click(mapDiv.width / 5, mapDiv.height / 5);
190
+
191
+ // Two lines
192
+ await expectPaths({ page, count: 2 });
193
+ });
194
+ }
129
195
  });
130
196
 
131
197
  test.describe("polygon mode", () => {
@@ -163,6 +229,84 @@ test.describe("polygon mode", () => {
163
229
  // One point + one line
164
230
  await expectPaths({ page, count: 1 });
165
231
  });
232
+
233
+ test("can use validation setting to prevent maximum size", async ({
234
+ page,
235
+ }) => {
236
+ const mapDiv = await setupMap({
237
+ page,
238
+ configQueryParam: "validationFailure",
239
+ });
240
+ await changeMode({ page, mode });
241
+
242
+ // The length of the square sides in pixels
243
+ const sideLength = 100;
244
+
245
+ // Calculating the half of the side length
246
+ const halfLength = sideLength / 2;
247
+
248
+ // Coordinates of the center
249
+ const centerX = mapDiv.width / 2;
250
+ const centerY = mapDiv.height / 2;
251
+
252
+ // Coordinates of the four corners of the square
253
+ const topLeft = { x: centerX - halfLength, y: centerY - halfLength };
254
+ const topRight = { x: centerX + halfLength, y: centerY - halfLength };
255
+ const bottomLeft = { x: centerX - halfLength, y: centerY + halfLength };
256
+ const bottomRight = { x: centerX + halfLength, y: centerY + halfLength };
257
+
258
+ // Perform clicks at each corner
259
+ await page.mouse.click(topLeft.x, topLeft.y);
260
+ await page.mouse.click(topRight.x, topRight.y);
261
+ await page.mouse.click(bottomRight.x, bottomRight.y);
262
+ await page.mouse.click(bottomLeft.x, bottomLeft.y);
263
+
264
+ // Attempt to close the square
265
+ await page.mouse.click(bottomLeft.x, bottomLeft.y);
266
+
267
+ // Square will fail, as triangle will be 705665 square meters, but square will be
268
+ // over the limit of 1000000 square meters.
269
+ await expectPaths({ page, count: 3 });
270
+ });
271
+
272
+ test("can use validation setting to draw underneath maximum size ", async ({
273
+ page,
274
+ }) => {
275
+ const mapDiv = await setupMap({
276
+ page,
277
+ configQueryParam: "validationSuccess",
278
+ });
279
+ await changeMode({ page, mode });
280
+
281
+ // The length of the square sides in pixels
282
+ const sideLength = 100;
283
+
284
+ // Calculating the half of the side length
285
+ const halfLength = sideLength / 2;
286
+
287
+ // Coordinates of the center
288
+ const centerX = mapDiv.width / 2;
289
+ const centerY = mapDiv.height / 2;
290
+
291
+ // Coordinates of the four corners of the square
292
+ const topLeft = { x: centerX - halfLength, y: centerY - halfLength };
293
+ const topRight = { x: centerX + halfLength, y: centerY - halfLength };
294
+ const bottomLeft = { x: centerX - halfLength, y: centerY + halfLength };
295
+ const bottomRight = { x: centerX + halfLength, y: centerY + halfLength };
296
+
297
+ // Perform clicks at each corner
298
+ await page.mouse.click(topLeft.x, topLeft.y);
299
+ await page.mouse.click(topRight.x, topRight.y);
300
+ await page.mouse.click(bottomRight.x, bottomRight.y);
301
+ await page.mouse.click(bottomLeft.x, bottomLeft.y);
302
+
303
+ // Attempt to close the square
304
+ await page.mouse.click(bottomLeft.x, bottomLeft.y);
305
+
306
+ // Square will fail, as triangle will be 705665 square meters, but square will be
307
+ // over the limit of 1000000 square meters.
308
+ await expectPaths({ page, count: 1 });
309
+ });
166
310
  });
167
311
 
168
312
  test.describe("rectangle mode", () => {
@@ -187,7 +331,9 @@ test.describe("rectangle mode", () => {
187
331
  test.describe("circle mode", () => {
188
332
  const mode = "circle";
189
333
 
190
- test("mode can set and can be used to create a circle", async ({ page }) => {
334
+ test("mode can set and can be used to create a web mercator circle", async ({
335
+ page,
336
+ }) => {
191
337
  const mapDiv = await setupMap({ page });
192
338
  await changeMode({ page, mode });
193
339
 
@@ -199,15 +345,11 @@ test.describe("circle mode", () => {
199
345
 
200
346
  await expectPathDimensions({ page, width: 146, height: 146 });
201
347
  });
202
- });
203
348
 
204
- test.describe("greatcircle mode", () => {
205
- const mode = "greatcircle";
206
-
207
- test("mode can set and can be used to create a greatcircle", async ({
349
+ test("mode can set and can be used to create a geodesic circle", async ({
208
350
  page,
209
351
  }) => {
210
- const mapDiv = await setupMap({ page });
352
+ const mapDiv = await setupMap({ page, configQueryParam: "geodesicCircle" });
211
353
  await changeMode({ page, mode });
212
354
 
213
355
  await page.mouse.click(mapDiv.width / 2, mapDiv.height / 2);
@@ -215,6 +357,8 @@ test.describe("greatcircle mode", () => {
215
357
 
216
358
  // One point + one line
217
359
  await expectPaths({ page, count: 1 });
360
+
361
+ await expectPathDimensions({ page, width: 146, height: 146 });
218
362
  });
219
363
  });
220
364
 
@@ -320,7 +464,93 @@ test.describe("select mode", () => {
320
464
  await expectGroupPosition({ page, x: 538, y: 308 });
321
465
  });
322
466
 
323
- test("selected rectangle can has it's shape maintained when coordinates are dragged", async ({
467
+ test("selected polygon can have individual coordinates dragged and fail when validation fails", async ({
468
+ page,
469
+ }) => {
470
+ const mapDiv = await setupMap({
471
+ page,
472
+ configQueryParam: "validationFailure",
473
+ });
474
+
475
+ await changeMode({ page, mode: "polygon" });
476
+
477
+ // Draw a rectangle
478
+ const { topLeft } = await drawRectangularPolygon({
479
+ mapDiv,
480
+ page,
481
+ size: "small",
482
+ });
483
+
484
+ // Change to select mode
485
+ await changeMode({ page, mode });
486
+
487
+ // Before drag
488
+ const x = topLeft.x - 2;
489
+ const y = topLeft.y - 2;
490
+ await expectGroupPosition({ page, x, y });
491
+
492
+ // Select
493
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 2);
494
+ // await expectPaths({ page, count: 9 }); // 8 selection points and 1 square
495
+
496
+ // Drag
497
+ await page.mouse.move(topLeft.x, topLeft.y);
498
+ await page.mouse.down();
499
+ await page.mouse.move(0, 0, { steps: 30 });
500
+ await page.mouse.up();
501
+
502
+ // Deselect
503
+ await page.mouse.click(mapDiv.width - 10, mapDiv.height / 2);
504
+
505
+ // We are attempting to dragg right tothe top left corner but it is not getting there
506
+ // because it is capped by the validation. If this was allowed x would be ~90
507
+ await expectGroupPosition({ page, x: 563, y: 301 });
508
+ });
509
+
510
+ test("selected polygon can have individual coordinates dragged and succeeds when validation succeeds", async ({
511
+ page,
512
+ }) => {
513
+ const mapDiv = await setupMap({
514
+ page,
515
+ configQueryParam: "validationSuccess",
516
+ });
517
+
518
+ await changeMode({ page, mode: "polygon" });
519
+
520
+ // Draw a rectangle
521
+ const { topLeft } = await drawRectangularPolygon({
522
+ mapDiv,
523
+ page,
524
+ size: "small",
525
+ });
526
+
527
+ // Change to select mode
528
+ await changeMode({ page, mode });
529
+
530
+ // Before drag
531
+ const x = topLeft.x - 2;
532
+ const y = topLeft.y - 2;
533
+ await expectGroupPosition({ page, x, y });
534
+
535
+ // Select
536
+ await page.mouse.click(mapDiv.width / 2, mapDiv.height / 2);
537
+ // await expectPaths({ page, count: 9 }); // 8 selection points and 1 square
538
+
539
+ // Drag
540
+ await page.mouse.move(topLeft.x, topLeft.y);
541
+ await page.mouse.down();
542
+ await page.mouse.move(topLeft.x - 50, topLeft.y - 50, { steps: 30 });
543
+ await page.mouse.up();
544
+
545
+ // Deselect
546
+ await page.mouse.click(mapDiv.width - 10, mapDiv.height / 2);
547
+
548
+ // We are attempting to dragg right tothe top left corner but it is not getting there
549
+ // because it is capped by the validation. If this was allowed x would be ~90
550
+ await expectGroupPosition({ page, x: 553, y: 273 });
551
+ });
552
+
553
+ test("selected rectangle has it's shape maintained when coordinates are dragged with resizeable flag", async ({
324
554
  page,
325
555
  }) => {
326
556
  const mapDiv = await setupMap({ page });
@@ -2,17 +2,30 @@ import { Page, expect } from "@playwright/test";
2
2
 
3
3
  export const pageUrl = "http://localhost:3000/";
4
4
 
5
+ export type TestConfigOptions =
6
+ | "validationSuccess"
7
+ | "validationFailure"
8
+ | "insertCoordinates"
9
+ | "insertCoordinatesGlobe"
10
+ | "geodesicCircle";
11
+
5
12
  export const setupMap = async ({
6
13
  page,
14
+ configQueryParam,
7
15
  }: {
8
16
  page: Page;
17
+ configQueryParam?: TestConfigOptions;
9
18
  }): Promise<{
10
19
  x: number;
11
20
  y: number;
12
21
  width: number;
13
22
  height: number;
14
23
  }> => {
15
- await page.goto(pageUrl);
24
+ if (configQueryParam) {
25
+ await page.goto(pageUrl + "?config=" + configQueryParam);
26
+ } else {
27
+ await page.goto(pageUrl);
28
+ }
16
29
 
17
30
  const mapDiv = await page.getByRole("application");
18
31
 
@@ -31,14 +44,7 @@ export const changeMode = async ({
31
44
  mode,
32
45
  }: {
33
46
  page: Page;
34
- mode:
35
- | "point"
36
- | "polygon"
37
- | "linestring"
38
- | "select"
39
- | "rectangle"
40
- | "circle"
41
- | "greatcircle";
47
+ mode: "point" | "polygon" | "linestring" | "select" | "rectangle" | "circle";
42
48
  }) => {
43
49
  const modeText = mode.charAt(0).toUpperCase() + mode.slice(1);
44
50
  const buttons = page.getByTestId("buttons");
@@ -108,6 +114,7 @@ export const expectGroupPosition = async ({
108
114
  export const drawRectangularPolygon = async ({
109
115
  mapDiv,
110
116
  page,
117
+ size = "regular",
111
118
  }: {
112
119
  mapDiv: {
113
120
  x: number;
@@ -116,9 +123,10 @@ export const drawRectangularPolygon = async ({
116
123
  height: number;
117
124
  };
118
125
  page: Page;
126
+ size?: "regular" | "small";
119
127
  }) => {
120
128
  // Draw a rectangle
121
- const sideLength = 100;
129
+ const sideLength = size === "regular" ? 100 : 70;
122
130
  const halfLength = sideLength / 2;
123
131
  const centerX = mapDiv.width / 2;
124
132
  const centerY = mapDiv.height / 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terra-draw",
3
- "version": "0.0.1-alpha.67",
3
+ "version": "0.0.1-alpha.69",
4
4
  "description": "Frictionless map drawing across mapping provider",
5
5
  "scripts": {
6
6
  "docs": "typedoc",
@@ -51,37 +51,37 @@
51
51
  "maplibre"
52
52
  ],
53
53
  "devDependencies": {
54
- "@arcgis/core": "^4.27.6",
55
- "@commitlint/cli": "^17.1.2",
56
- "@commitlint/config-conventional": "^17.1.0",
57
- "@googlemaps/js-api-loader": "^1.14.3",
58
- "@swc/jest": "^0.2.36",
59
- "@types/geojson": "^7946.0.8",
60
- "@types/google.maps": "^3.49.2",
61
- "@types/jest": "^29.5.12",
62
- "@types/leaflet": "^1.7.11",
63
- "@types/mapbox-gl": "^2.7.3",
64
- "@types/rbush": "^3.0.0",
65
- "@typescript-eslint/eslint-plugin": "^7.5.0",
66
- "@typescript-eslint/parser": "^7.5.0",
67
- "eslint": "^8.24.0",
68
- "eslint-config-prettier": "^9.0.0",
69
- "eslint-plugin-prettier": "^5.0.0",
70
- "husky": "^7.0.0",
71
- "jest": "^29.7.0",
72
- "jest-environment-jsdom": "^29.7.0",
73
- "leaflet": "^1.8.0",
74
- "mapbox-gl": "^2.13.0",
54
+ "@arcgis/core": "4.27.6",
55
+ "@commitlint/cli": "17.1.2",
56
+ "@commitlint/config-conventional": "17.1.0",
57
+ "@googlemaps/js-api-loader": "1.14.3",
58
+ "@swc/jest": "0.2.36",
59
+ "@types/geojson": "7946.0.8",
60
+ "@types/google.maps": "3.49.2",
61
+ "@types/jest": "29.5.12",
62
+ "@types/leaflet": "^1.9.12",
63
+ "@types/mapbox-gl": "2.7.3",
64
+ "@types/rbush": "3.0.0",
65
+ "@typescript-eslint/eslint-plugin": "7.14.1",
66
+ "@typescript-eslint/parser": "7.14.1",
67
+ "eslint": "8.57.0",
68
+ "eslint-config-prettier": "9.0.0",
69
+ "eslint-plugin-prettier": "5.0.0",
70
+ "husky": "7.0.0",
71
+ "jest": "29.7.0",
72
+ "jest-environment-jsdom": "29.7.0",
73
+ "leaflet": "^1.9.4",
74
+ "mapbox-gl": "2.13.0",
75
75
  "maplibre-gl": "3.2.0",
76
- "microbundle": "^0.15.0",
77
- "ol": "^7.1.0",
78
- "serve": "^14.1.2",
79
- "standard-version": "^9.5.0",
80
- "ts-jest": "^29.1.2",
81
- "ts-loader": "^9.5.1",
82
- "tsx": "^4.7.2",
83
- "typedoc": "^0.25.12",
84
- "typescript": "^5.4.4"
76
+ "microbundle": "0.15.0",
77
+ "ol": "7.1.0",
78
+ "serve": "14.1.2",
79
+ "standard-version": "9.5.0",
80
+ "ts-jest": "29.1.2",
81
+ "ts-loader": "9.5.1",
82
+ "tsx": "4.7.2",
83
+ "typedoc": "^0.26.2",
84
+ "typescript": "5.5.2"
85
85
  },
86
86
  "commitlint": {
87
87
  "extends": [
@@ -154,5 +154,6 @@
154
154
  "section": "Reverts"
155
155
  }
156
156
  ]
157
- }
157
+ },
158
+ "sideEffects": false
158
159
  }
package/tsconfig.json CHANGED
@@ -15,5 +15,13 @@
15
15
  "exclude": ["src/geometry/**/*.ts", "src/test/**/*.ts", "src/util/**/*.ts"],
16
16
  "out": "docs",
17
17
  "skipErrorChecking": true
18
- }
18
+ },
19
+ "exclude": [
20
+ "node_modules/",
21
+ "guides/",
22
+ "docs/",
23
+ "dist/",
24
+ "development/dist",
25
+ "development/node_modules"
26
+ ]
19
27
  }
@@ -1,2 +0,0 @@
1
- import { GeoJSONStoreFeatures } from "../../terra-draw";
2
- export declare function isValidLineStringFeature(feature: GeoJSONStoreFeatures, coordinatePrecision: number): boolean;
@@ -1,2 +0,0 @@
1
- import { GeoJSONStoreFeatures } from "../../terra-draw";
2
- export declare function isValidPoint(feature: GeoJSONStoreFeatures, coordinatePrecision: number): boolean;
@@ -1,3 +0,0 @@
1
- import { GeoJSONStoreFeatures } from "../../terra-draw";
2
- export declare function isValidPolygonFeature(feature: GeoJSONStoreFeatures, coordinatePrecision: number): boolean;
3
- export declare function isValidNonIntersectingPolygonFeature(feature: GeoJSONStoreFeatures, coordinatePrecision: number): boolean;
@@ -1,12 +0,0 @@
1
- import { Feature, LineString, Position } from "geojson";
2
- import { JSONObject } from "../../store/store";
3
- export declare function greatCircleLine<Properties extends JSONObject>({ start, end, options, }: {
4
- start: Position;
5
- end: Position;
6
- options?: {
7
- numberOfPoints?: number;
8
- offset?: number;
9
- properties?: Properties;
10
- coordinatePrecision?: number;
11
- };
12
- }): Feature<LineString, import("geojson").GeoJsonProperties> | null;
@@ -1,14 +0,0 @@
1
- import { BehaviorConfig, TerraDrawModeBehavior } from "./base.behavior";
2
- import { TerraDrawMouseEvent } from "../common";
3
- import { Position } from "geojson";
4
- import { ClickBoundingBoxBehavior } from "./click-bounding-box.behavior";
5
- import { FeatureId } from "../store/store";
6
- import { PixelDistanceBehavior } from "./pixel-distance.behavior";
7
- export declare class GreatCircleSnappingBehavior extends TerraDrawModeBehavior {
8
- readonly config: BehaviorConfig;
9
- private readonly pixelDistance;
10
- private readonly clickBoundingBox;
11
- constructor(config: BehaviorConfig, pixelDistance: PixelDistanceBehavior, clickBoundingBox: ClickBoundingBoxBehavior);
12
- getSnappableCoordinate: (event: TerraDrawMouseEvent, currentFeatureId?: FeatureId) => Position | undefined;
13
- private getSnappableEnds;
14
- }