terra-draw 0.0.1-alpha.7 → 0.0.1-alpha.71
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/.devcontainer/Dockerfile +8 -0
- package/.devcontainer/devcontainer.json +27 -0
- package/.devcontainer/post-create.sh +16 -0
- package/README.md +30 -6
- package/dist/adapters/arcgis-maps-sdk.adapter.d.ts +106 -0
- package/dist/adapters/google-maps.adapter.d.ts +90 -39
- package/dist/adapters/leaflet.adapter.d.ts +99 -33
- package/dist/adapters/mapbox-gl.adapter.d.ts +91 -37
- package/dist/adapters/maplibre-gl.adapter.d.ts +72 -0
- package/dist/adapters/openlayers.adapter.d.ts +120 -0
- package/dist/common.d.ts +118 -98
- package/dist/geometry/boolean/is-valid-coordinate.d.ts +4 -0
- package/dist/geometry/boolean/point-in-polygon.d.ts +2 -2
- package/dist/geometry/boolean/self-intersects.d.ts +2 -2
- package/dist/geometry/centroid.d.ts +2 -2
- package/dist/geometry/coordinates-identical.d.ts +2 -2
- package/dist/geometry/get-coordinates-as-points.d.ts +6 -6
- package/dist/geometry/get-midpoints.d.ts +14 -7
- package/dist/geometry/helpers.d.ts +4 -4
- package/dist/geometry/limit-decimal-precision.d.ts +1 -1
- package/dist/geometry/measure/area.d.ts +2 -0
- package/dist/geometry/measure/bearing.d.ts +9 -0
- package/dist/geometry/measure/destination.d.ts +2 -0
- package/dist/geometry/measure/haversine-distance.d.ts +2 -2
- package/dist/geometry/measure/pixel-distance-to-line.d.ts +10 -10
- package/dist/geometry/measure/pixel-distance.d.ts +7 -7
- package/dist/geometry/measure/rhumb-bearing.d.ts +2 -2
- package/dist/geometry/measure/rhumb-destination.d.ts +2 -2
- package/dist/geometry/measure/rhumb-distance.d.ts +2 -2
- package/dist/geometry/measure/slice-along.d.ts +2 -0
- package/dist/geometry/midpoint-coordinate.d.ts +4 -2
- package/dist/geometry/project/web-mercator.d.ts +20 -0
- package/dist/geometry/shape/create-bbox.d.ts +10 -0
- package/dist/geometry/shape/create-circle.d.ts +13 -7
- package/dist/geometry/shape/great-circle-coordinates.d.ts +2 -0
- package/dist/geometry/shape/web-mercator-distortion.d.ts +2 -0
- package/dist/geometry/transform/rotate.d.ts +9 -2
- package/dist/geometry/transform/scale.d.ts +9 -2
- package/dist/geometry/web-mercator-centroid.d.ts +11 -0
- package/dist/modes/base.behavior.d.ts +21 -19
- package/dist/modes/base.mode.d.ts +66 -33
- package/dist/modes/circle/circle.mode.d.ts +66 -35
- package/dist/modes/click-bounding-box.behavior.d.ts +6 -7
- package/dist/modes/freehand/freehand.mode.d.ts +63 -37
- package/dist/modes/insert-coordinates.behavior.d.ts +9 -0
- package/dist/modes/linestring/linestring.mode.d.ts +78 -40
- package/dist/modes/pixel-distance.behavior.d.ts +7 -7
- package/dist/modes/point/point.mode.d.ts +44 -26
- package/dist/modes/polygon/behaviors/closing-points.behavior.d.ts +19 -19
- package/dist/modes/polygon/polygon.mode.d.ts +69 -49
- package/dist/modes/rectangle/rectangle.mode.d.ts +55 -0
- package/dist/modes/render/render.mode.d.ts +52 -23
- package/dist/modes/select/behaviors/drag-coordinate-resize.behavior.d.ts +62 -0
- package/dist/modes/select/behaviors/drag-coordinate.behavior.d.ts +20 -13
- package/dist/modes/select/behaviors/drag-feature.behavior.d.ts +20 -17
- package/dist/modes/select/behaviors/{features-at-mouse-event.behavior.d.ts → feature-at-pointer-event.behavior.d.ts} +15 -15
- package/dist/modes/select/behaviors/midpoint.behavior.d.ts +19 -18
- package/dist/modes/select/behaviors/rotate-feature.behavior.d.ts +14 -13
- package/dist/modes/select/behaviors/scale-feature.behavior.d.ts +14 -13
- package/dist/modes/select/behaviors/selection-point.behavior.d.ts +19 -18
- package/dist/modes/select/select.mode.d.ts +119 -78
- package/dist/modes/snapping.behavior.d.ts +16 -13
- package/dist/modes/static/static.mode.d.ts +32 -30
- package/dist/store/spatial-index/quickselect.d.ts +2 -2
- package/dist/store/spatial-index/rbush.d.ts +35 -35
- package/dist/store/spatial-index/spatial-index.d.ts +18 -18
- package/dist/store/store-feature-validation.d.ts +16 -0
- package/dist/store/store.d.ts +59 -48
- package/dist/terra-draw.cjs +1 -1
- package/dist/terra-draw.cjs.map +1 -1
- package/dist/terra-draw.d.ts +222 -48
- package/dist/terra-draw.modern.js +1 -1
- package/dist/terra-draw.modern.js.map +1 -1
- package/dist/terra-draw.module.js +1 -1
- package/dist/terra-draw.module.js.map +1 -1
- package/dist/terra-draw.umd.js +1 -1
- package/dist/terra-draw.umd.js.map +1 -1
- package/dist/util/geoms.d.ts +3 -3
- package/dist/util/id.d.ts +1 -1
- package/dist/util/styling.d.ts +2 -2
- package/dist/validations/linestring.validation.d.ts +2 -0
- package/dist/validations/max-size.validation.d.ts +2 -0
- package/dist/validations/min-size.validation.d.ts +2 -0
- package/dist/validations/not-self-intersecting.validation.d.ts +2 -0
- package/dist/validations/point.validation.d.ts +2 -0
- package/dist/validations/polygon.validation.d.ts +3 -0
- package/e2e/README.md +29 -0
- package/e2e/package-lock.json +4274 -0
- package/e2e/package.json +26 -0
- package/e2e/playwright.config.ts +77 -0
- package/e2e/public/favicon.ico +0 -0
- package/e2e/public/index.html +52 -0
- package/e2e/tests/leaflet.spec.ts +657 -0
- package/e2e/tests/setup.ts +181 -0
- package/e2e/webpack.config.js +36 -0
- package/jest.nocheck.config.ts +17 -0
- package/package.json +158 -87
- package/readme.gif +0 -0
- package/tsconfig.json +25 -12
- package/CODE_OF_CONDUCT.md +0 -36
- package/CONTRIBUTING.md +0 -17
- package/DEVELOPMENT.md +0 -77
- package/dist/bundle.js +0 -6
- package/dist/bundle.js.LICENSE.txt +0 -4
- package/dist/geometry/create-circle.d.ts +0 -6
- package/dist/geometry/get-pixel-distance-to-line.d.ts +0 -10
- package/dist/geometry/get-pixel-distance.d.ts +0 -7
- package/dist/geometry/haversine-distance.d.ts +0 -1
- package/dist/geometry/point-in-polygon.d.ts +0 -1
- package/dist/geometry/self-intersects.d.ts +0 -2
- package/dist/modes/circle.mode.d.ts +0 -18
- package/dist/modes/freehand.mode.d.ts +0 -20
- package/dist/modes/line-string.mode.d.ts +0 -21
- package/dist/modes/point.mode.d.ts +0 -14
- package/dist/modes/polygon/behaviors/start-end-point.behavior.d.ts +0 -11
- package/dist/modes/polygon.mode.d.ts +0 -21
- package/dist/modes/select.mode.d.ts +0 -21
- package/dist/modes/static.mode.d.ts +0 -10
- package/jest.config.ts +0 -27
package/dist/util/geoms.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Feature, LineString, Polygon, Position } from "geojson";
|
|
2
|
-
export declare function createPolygon(coordinates?: Position[][]): Feature<Polygon>;
|
|
3
|
-
export declare function createLineString(coordinates: Position[]): Feature<LineString>;
|
|
1
|
+
import { Feature, LineString, Polygon, Position } from "geojson";
|
|
2
|
+
export declare function createPolygon(coordinates?: Position[][]): Feature<Polygon>;
|
|
3
|
+
export declare function createLineString(coordinates: Position[]): Feature<LineString>;
|
package/dist/util/id.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const uuid4: () => string;
|
|
1
|
+
export declare const uuid4: () => string;
|
package/dist/util/styling.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TerraDrawAdapterStyling } from "../common";
|
|
2
|
-
export declare const getDefaultStyling: () => TerraDrawAdapterStyling;
|
|
1
|
+
import { TerraDrawAdapterStyling } from "../common";
|
|
2
|
+
export declare const getDefaultStyling: () => TerraDrawAdapterStyling;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GeoJSONStoreFeatures } from "../terra-draw";
|
|
2
|
+
export declare function ValidatePolygonFeature(feature: GeoJSONStoreFeatures, coordinatePrecision: number): boolean;
|
|
3
|
+
export declare function ValidateNonIntersectingPolygonFeature(feature: GeoJSONStoreFeatures, coordinatePrecision: number): boolean;
|
package/e2e/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# E2E Testing with Playwright
|
|
2
|
+
|
|
3
|
+
We provide a basic end-to-end (E2E) test suite via Playwright, testing against the Leaflet Adapter. The test suite aims to emulate how an end user would interact with and use Terra Draw. Here we can attempt to catch bugs earlier in the pipeline and ensure that new behaviours in the future adhere to a given specification.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Installation can be down via npm like so:
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Running
|
|
14
|
+
|
|
15
|
+
You can run the tests headless (i.e. no opening of Chromimum) like so:
|
|
16
|
+
|
|
17
|
+
```shell
|
|
18
|
+
npm run test
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or you can run them headed (i.e. Chromimum will open and you will see the tests run) like so:
|
|
22
|
+
|
|
23
|
+
```shell
|
|
24
|
+
npm run test:headed
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Tests
|
|
28
|
+
|
|
29
|
+
Tests are located in the `tests` folder. You will see the `leaflet.spec.ts` file, this is where the tests are kept for the E2E tests written for the Leaflet Adapter. There are also some convienence methods written in the `setup.ts` file which can be leveraged to write tests more easily.
|