terra-draw 1.0.0-beta.0 → 1.0.0-beta.10
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 +10 -3
- package/dist/adapters/common/adapter-listener.d.ts +22 -0
- package/dist/adapters/common/base.adapter.d.ts +59 -0
- package/dist/adapters/mapbox-gl.adapter.d.ts +0 -1
- package/dist/adapters/openlayers.adapter.d.ts +14 -13
- package/dist/common.d.ts +11 -9
- package/dist/extend.d.ts +4 -0
- package/dist/geometry/calculate-relative-angle.d.ts +9 -0
- package/dist/geometry/clockwise.d.ts +2 -0
- package/dist/geometry/determine-halfplane.d.ts +2 -0
- package/dist/geometry/measure/bearing.d.ts +3 -7
- package/dist/geometry/measure/destination.d.ts +2 -0
- package/dist/geometry/measure/pixel-distance-to-line.d.ts +2 -10
- package/dist/geometry/measure/pixel-distance.d.ts +2 -7
- package/dist/geometry/point-on-line.d.ts +5 -0
- package/dist/geometry/project/web-mercator.d.ts +2 -4
- package/dist/geometry/web-mercator-centroid.d.ts +2 -4
- package/dist/geometry/web-mercator-point-on-line.d.ts +11 -0
- package/dist/modes/angled-rectangle/angled-rectangle.mode.d.ts +57 -0
- package/dist/modes/base.mode.d.ts +3 -1
- package/dist/modes/circle/circle.mode.d.ts +3 -2
- package/dist/modes/coordinate-snapping.behavior.d.ts +16 -0
- package/dist/modes/freehand/freehand.mode.d.ts +8 -2
- package/dist/modes/{snapping.behavior.d.ts → line-snapping.behavior.d.ts} +1 -1
- package/dist/modes/linestring/linestring.mode.d.ts +11 -4
- package/dist/modes/point/point.mode.d.ts +2 -2
- package/dist/modes/polygon/polygon.mode.d.ts +14 -4
- package/dist/modes/rectangle/rectangle.mode.d.ts +2 -2
- package/dist/modes/render/render.mode.d.ts +2 -1
- package/dist/modes/sector/sector.mode.d.ts +60 -0
- package/dist/modes/select/behaviors/drag-feature.behavior.d.ts +2 -2
- package/dist/modes/sensor/sensor.mode.d.ts +69 -0
- package/dist/store/store-feature-validation.d.ts +8 -2
- package/dist/store/store.d.ts +7 -3
- package/dist/terra-draw.cjs +1 -1
- package/dist/terra-draw.cjs.map +1 -1
- package/dist/terra-draw.d.ts +13 -13
- 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/validation-reasons.d.ts +13 -0
- package/dist/validations/common-validations.d.ts +2 -0
- package/dist/validations/linestring.validation.d.ts +4 -1
- package/dist/validations/max-size.validation.d.ts +3 -1
- package/dist/validations/min-size.validation.d.ts +3 -1
- package/dist/validations/not-self-intersecting.validation.d.ts +4 -1
- package/dist/validations/point.validation.d.ts +4 -1
- package/dist/validations/polygon.validation.d.ts +8 -2
- package/e2e/package-lock.json +5 -4
- package/e2e/package.json +1 -1
- package/e2e/public/index.html +3 -0
- package/e2e/tests/leaflet.spec.ts +490 -14
- package/e2e/tests/setup.ts +34 -6
- package/eslint.config.js +31 -0
- package/package.json +30 -30
- package/tsconfig.json +2 -1
- package/readme.gif +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const ValidationReasons: {
|
|
2
|
+
ValidationReasonFeatureNotPoint: string;
|
|
3
|
+
ValidationReasonFeatureInvalidCoordinates: string;
|
|
4
|
+
ValidationReasonFeatureNotPolygon: string;
|
|
5
|
+
ValidationReasonFeatureHasHoles: string;
|
|
6
|
+
ValidationReasonFeatureLessThanFourCoordinates: string;
|
|
7
|
+
ValidationReasonFeatureHasInvalidCoordinates: string;
|
|
8
|
+
ValidationReasonFeatureCoordinatesNotClosed: string;
|
|
9
|
+
ValidationReasonFeatureNotPolygonOrLineString: string;
|
|
10
|
+
ValidationReasonFeatureSelfIntersects: string;
|
|
11
|
+
ValidationReasonFeatureLessThanMinSize: string;
|
|
12
|
+
ValidationReasonModeMismatch: string;
|
|
13
|
+
};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { Validation } from "../common";
|
|
1
2
|
import { GeoJSONStoreFeatures } from "../terra-draw";
|
|
2
|
-
export declare
|
|
3
|
+
export declare const ValidationReasonFeatureIsNotALineString = "Feature is not a LineString";
|
|
4
|
+
export declare const ValidationReasonFeatureHasLessThanTwoCoordinates = "Feature has less than 2 coordinates";
|
|
5
|
+
export declare function ValidateLineStringFeature(feature: GeoJSONStoreFeatures, coordinatePrecision: number): ReturnType<Validation>;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { Validation } from "../common";
|
|
1
2
|
import { GeoJSONStoreFeatures } from "../terra-draw";
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const ValidationMaxAreaSquareMetersReason = "Feature is larger than the maximum area";
|
|
4
|
+
export declare const ValidateMaxAreaSquareMeters: (feature: GeoJSONStoreFeatures, maxSize: number) => ReturnType<Validation>;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { Validation } from "../common";
|
|
1
2
|
import { GeoJSONStoreFeatures } from "../terra-draw";
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const ValidationReasonFeatureLessThanMinSize = "Feature is smaller than the minimum area";
|
|
4
|
+
export declare const ValidateMinAreaSquareMeters: (feature: GeoJSONStoreFeatures, minSize: number) => ReturnType<Validation>;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { GeoJSONStoreFeatures } from "../terra-draw";
|
|
2
|
-
|
|
2
|
+
import { Validation } from "../common";
|
|
3
|
+
export declare const ValidationReasonFeatureNotPolygonOrLineString = "Feature is not a Polygon or LineString";
|
|
4
|
+
export declare const ValidationReasonFeatureSelfIntersects = "Feature intersects itself";
|
|
5
|
+
export declare const ValidateNotSelfIntersecting: (feature: GeoJSONStoreFeatures) => ReturnType<Validation>;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { Validation } from "../common";
|
|
1
2
|
import { GeoJSONStoreFeatures } from "../terra-draw";
|
|
2
|
-
export declare
|
|
3
|
+
export declare const ValidationReasonFeatureNotPoint = "Feature is not a Point";
|
|
4
|
+
export declare const ValidationReasonFeatureInvalidCoordinates = "Feature has invalid coordinates";
|
|
5
|
+
export declare function ValidatePointFeature(feature: GeoJSONStoreFeatures, coordinatePrecision: number): ReturnType<Validation>;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { GeoJSONStoreFeatures } from "../terra-draw";
|
|
2
|
-
|
|
3
|
-
export declare
|
|
2
|
+
import { Validation } from "../common";
|
|
3
|
+
export declare const ValidationReasonFeatureNotPolygon = "Feature is not a Polygon";
|
|
4
|
+
export declare const ValidationReasonFeatureHasHoles = "Feature has holes";
|
|
5
|
+
export declare const ValidationReasonFeatureLessThanFourCoordinates = "Feature has less than 4 coordinates";
|
|
6
|
+
export declare const ValidationReasonFeatureHasInvalidCoordinates = "Feature has invalid coordinates";
|
|
7
|
+
export declare const ValidationReasonFeatureCoordinatesNotClosed = "Feature coordinates are not closed";
|
|
8
|
+
export declare function ValidatePolygonFeature(feature: GeoJSONStoreFeatures, coordinatePrecision: number): ReturnType<Validation>;
|
|
9
|
+
export declare function ValidateNonIntersectingPolygonFeature(feature: GeoJSONStoreFeatures, coordinatePrecision: number): ReturnType<Validation>;
|
package/e2e/package-lock.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@types/node": "20.10.5",
|
|
15
15
|
"dotenv-webpack": "8.0.0",
|
|
16
16
|
"ts-loader": "9.5.1",
|
|
17
|
-
"typescript": "5.
|
|
17
|
+
"typescript": "5.6.3",
|
|
18
18
|
"webpack": "5.73.0",
|
|
19
19
|
"webpack-cli": "4.10.0",
|
|
20
20
|
"webpack-dev-server": "4.11.1"
|
|
@@ -3756,10 +3756,11 @@
|
|
|
3756
3756
|
}
|
|
3757
3757
|
},
|
|
3758
3758
|
"node_modules/typescript": {
|
|
3759
|
-
"version": "5.
|
|
3760
|
-
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.
|
|
3761
|
-
"integrity": "sha512-
|
|
3759
|
+
"version": "5.6.3",
|
|
3760
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
|
|
3761
|
+
"integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
|
|
3762
3762
|
"dev": true,
|
|
3763
|
+
"license": "Apache-2.0",
|
|
3763
3764
|
"bin": {
|
|
3764
3765
|
"tsc": "bin/tsc",
|
|
3765
3766
|
"tsserver": "bin/tsserver"
|
package/e2e/package.json
CHANGED
package/e2e/public/index.html
CHANGED
|
@@ -41,6 +41,9 @@
|
|
|
41
41
|
<button id="linestring">Linestring</button>
|
|
42
42
|
<button id="polygon">Polygon</button>
|
|
43
43
|
<button id="rectangle">Rectangle</button>
|
|
44
|
+
<button id="angled-rectangle">Angled Rectangle</button>
|
|
45
|
+
<button id="sector">Sector</button>
|
|
46
|
+
<button id="sensor">Sensor</button>
|
|
44
47
|
<button id="circle">Circle</button>
|
|
45
48
|
<button id="clear">Clear</button>
|
|
46
49
|
</div>
|