@deck.gl-community/editable-layers 9.0.0-alpha.1
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 +82 -0
- package/dist/constants.d.ts +14 -0
- package/dist/constants.js +14 -0
- package/dist/curve-utils.d.ts +2 -0
- package/dist/curve-utils.js +61 -0
- package/dist/edit-modes/composite-mode.d.ts +14 -0
- package/dist/edit-modes/composite-mode.js +47 -0
- package/dist/edit-modes/draw-90degree-polygon-mode.d.ts +11 -0
- package/dist/edit-modes/draw-90degree-polygon-mode.js +179 -0
- package/dist/edit-modes/draw-circle-by-diameter-mode.d.ts +24 -0
- package/dist/edit-modes/draw-circle-by-diameter-mode.js +78 -0
- package/dist/edit-modes/draw-circle-from-center-mode.d.ts +22 -0
- package/dist/edit-modes/draw-circle-from-center-mode.js +70 -0
- package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.d.ts +5 -0
- package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.js +20 -0
- package/dist/edit-modes/draw-ellipse-using-three-points-mode.d.ts +5 -0
- package/dist/edit-modes/draw-ellipse-using-three-points-mode.js +16 -0
- package/dist/edit-modes/draw-line-string-mode.d.ts +25 -0
- package/dist/edit-modes/draw-line-string-mode.js +170 -0
- package/dist/edit-modes/draw-point-mode.d.ts +8 -0
- package/dist/edit-modes/draw-point-mode.js +28 -0
- package/dist/edit-modes/draw-polygon-by-dragging-mode.d.ts +14 -0
- package/dist/edit-modes/draw-polygon-by-dragging-mode.js +87 -0
- package/dist/edit-modes/draw-polygon-mode.d.ts +10 -0
- package/dist/edit-modes/draw-polygon-mode.js +143 -0
- package/dist/edit-modes/draw-rectangle-from-center-mode.d.ts +5 -0
- package/dist/edit-modes/draw-rectangle-from-center-mode.js +17 -0
- package/dist/edit-modes/draw-rectangle-mode.d.ts +5 -0
- package/dist/edit-modes/draw-rectangle-mode.js +11 -0
- package/dist/edit-modes/draw-rectangle-using-three-points-mode.d.ts +5 -0
- package/dist/edit-modes/draw-rectangle-using-three-points-mode.js +28 -0
- package/dist/edit-modes/draw-square-from-center-mode.d.ts +5 -0
- package/dist/edit-modes/draw-square-from-center-mode.js +35 -0
- package/dist/edit-modes/draw-square-mode.d.ts +5 -0
- package/dist/edit-modes/draw-square-mode.js +28 -0
- package/dist/edit-modes/duplicate-mode.d.ts +7 -0
- package/dist/edit-modes/duplicate-mode.js +17 -0
- package/dist/edit-modes/edit-mode.d.ts +11 -0
- package/dist/edit-modes/edit-mode.js +2 -0
- package/dist/edit-modes/elevation-mode.d.ts +13 -0
- package/dist/edit-modes/elevation-mode.js +49 -0
- package/dist/edit-modes/extend-line-string-mode.d.ts +9 -0
- package/dist/edit-modes/extend-line-string-mode.js +72 -0
- package/dist/edit-modes/extrude-mode.d.ts +15 -0
- package/dist/edit-modes/extrude-mode.js +186 -0
- package/dist/edit-modes/geojson-edit-mode.d.ts +33 -0
- package/dist/edit-modes/geojson-edit-mode.js +208 -0
- package/dist/edit-modes/immutable-feature-collection.d.ts +43 -0
- package/dist/edit-modes/immutable-feature-collection.js +300 -0
- package/dist/edit-modes/measure-angle-mode.d.ts +11 -0
- package/dist/edit-modes/measure-angle-mode.js +99 -0
- package/dist/edit-modes/measure-area-mode.d.ts +8 -0
- package/dist/edit-modes/measure-area-mode.js +50 -0
- package/dist/edit-modes/measure-distance-mode.d.ts +19 -0
- package/dist/edit-modes/measure-distance-mode.js +171 -0
- package/dist/edit-modes/modify-mode.d.ts +15 -0
- package/dist/edit-modes/modify-mode.js +203 -0
- package/dist/edit-modes/resize-circle-mode.d.ts +16 -0
- package/dist/edit-modes/resize-circle-mode.js +142 -0
- package/dist/edit-modes/rotate-mode.d.ts +17 -0
- package/dist/edit-modes/rotate-mode.js +151 -0
- package/dist/edit-modes/scale-mode.d.ts +27 -0
- package/dist/edit-modes/scale-mode.js +173 -0
- package/dist/edit-modes/snappable-mode.d.ts +21 -0
- package/dist/edit-modes/snappable-mode.js +109 -0
- package/dist/edit-modes/split-polygon-mode.d.ts +10 -0
- package/dist/edit-modes/split-polygon-mode.js +164 -0
- package/dist/edit-modes/three-click-polygon-mode.d.ts +10 -0
- package/dist/edit-modes/three-click-polygon-mode.js +72 -0
- package/dist/edit-modes/transform-mode.d.ts +9 -0
- package/dist/edit-modes/transform-mode.js +63 -0
- package/dist/edit-modes/translate-mode.d.ts +13 -0
- package/dist/edit-modes/translate-mode.js +113 -0
- package/dist/edit-modes/two-click-polygon-mode.d.ts +13 -0
- package/dist/edit-modes/two-click-polygon-mode.js +93 -0
- package/dist/edit-modes/types.d.ts +86 -0
- package/dist/edit-modes/types.js +1 -0
- package/dist/edit-modes/utils.d.ts +36 -0
- package/dist/edit-modes/utils.js +381 -0
- package/dist/edit-modes/view-mode.d.ts +3 -0
- package/dist/edit-modes/view-mode.js +3 -0
- package/dist/editable-layers/editable-geojson-layer.d.ts +98 -0
- package/dist/editable-layers/editable-geojson-layer.js +450 -0
- package/dist/editable-layers/editable-h3-cluster-layer.d.ts +34 -0
- package/dist/editable-layers/editable-h3-cluster-layer.js +164 -0
- package/dist/editable-layers/editable-layer.d.ts +49 -0
- package/dist/editable-layers/editable-layer.js +195 -0
- package/dist/editable-layers/editable-path-layer.d.ts +9 -0
- package/dist/editable-layers/editable-path-layer.js +34 -0
- package/dist/editable-layers/elevated-edit-handle-layer.d.ts +7 -0
- package/dist/editable-layers/elevated-edit-handle-layer.js +24 -0
- package/dist/editable-layers/junction-scatterplot-layer.d.ts +14 -0
- package/dist/editable-layers/junction-scatterplot-layer.js +41 -0
- package/dist/editable-layers/path-marker-layer/arrow-2d-geometry.d.ts +4 -0
- package/dist/editable-layers/path-marker-layer/arrow-2d-geometry.js +55 -0
- package/dist/editable-layers/path-marker-layer/create-path-markers.d.ts +16 -0
- package/dist/editable-layers/path-marker-layer/create-path-markers.js +75 -0
- package/dist/editable-layers/path-marker-layer/path-marker-layer.d.ts +40 -0
- package/dist/editable-layers/path-marker-layer/path-marker-layer.js +121 -0
- package/dist/editable-layers/path-marker-layer/polyline.d.ts +18 -0
- package/dist/editable-layers/path-marker-layer/polyline.js +37 -0
- package/dist/editable-layers/path-outline-layer/path-outline-layer.d.ts +26 -0
- package/dist/editable-layers/path-outline-layer/path-outline-layer.js +106 -0
- package/dist/editable-layers/selection-layer.d.ts +26 -0
- package/dist/editable-layers/selection-layer.js +167 -0
- package/dist/geojson-types.d.ts +58 -0
- package/dist/geojson-types.js +2 -0
- package/dist/index.cjs +5825 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +62 -0
- package/dist/lib/constants.d.ts +6 -0
- package/dist/lib/constants.js +6 -0
- package/dist/lib/deck-renderer/deck-cache.d.ts +14 -0
- package/dist/lib/deck-renderer/deck-cache.js +51 -0
- package/dist/lib/deck-renderer/deck-drawer.d.ts +63 -0
- package/dist/lib/deck-renderer/deck-drawer.js +232 -0
- package/dist/lib/feature.d.ts +10 -0
- package/dist/lib/feature.js +16 -0
- package/dist/lib/layer-mouse-event.d.ts +11 -0
- package/dist/lib/layer-mouse-event.js +24 -0
- package/dist/lib/layers/junctions-layer.d.ts +8 -0
- package/dist/lib/layers/junctions-layer.js +33 -0
- package/dist/lib/layers/segments-layer.d.ts +18 -0
- package/dist/lib/layers/segments-layer.js +94 -0
- package/dist/lib/layers/texts-layer.d.ts +8 -0
- package/dist/lib/layers/texts-layer.js +32 -0
- package/dist/lib/math.d.ts +11 -0
- package/dist/lib/math.js +22 -0
- package/dist/lib/nebula-layer.d.ts +13 -0
- package/dist/lib/nebula-layer.js +26 -0
- package/dist/lib/nebula.d.ts +34 -0
- package/dist/lib/nebula.js +254 -0
- package/dist/lib/style.d.ts +19 -0
- package/dist/lib/style.js +20 -0
- package/dist/memoize.d.ts +6 -0
- package/dist/memoize.js +40 -0
- package/dist/mode-handlers/composite-mode-handler.d.ts +24 -0
- package/dist/mode-handlers/composite-mode-handler.js +55 -0
- package/dist/mode-handlers/draw-90degree-polygon-handler.d.ts +13 -0
- package/dist/mode-handlers/draw-90degree-polygon-handler.js +169 -0
- package/dist/mode-handlers/draw-circle-by-bounding-box-handler.d.ts +9 -0
- package/dist/mode-handlers/draw-circle-by-bounding-box-handler.js +29 -0
- package/dist/mode-handlers/draw-circle-from-center-handler.d.ts +9 -0
- package/dist/mode-handlers/draw-circle-from-center-handler.js +27 -0
- package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.d.ts +9 -0
- package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.js +30 -0
- package/dist/mode-handlers/draw-ellipse-using-three-points-handler.d.ts +9 -0
- package/dist/mode-handlers/draw-ellipse-using-three-points-handler.js +37 -0
- package/dist/mode-handlers/draw-line-string-handler.d.ts +9 -0
- package/dist/mode-handlers/draw-line-string-handler.js +83 -0
- package/dist/mode-handlers/draw-point-handler.d.ts +5 -0
- package/dist/mode-handlers/draw-point-handler.js +11 -0
- package/dist/mode-handlers/draw-polygon-handler.d.ts +11 -0
- package/dist/mode-handlers/draw-polygon-handler.js +92 -0
- package/dist/mode-handlers/draw-rectangle-handler.d.ts +9 -0
- package/dist/mode-handlers/draw-rectangle-handler.js +18 -0
- package/dist/mode-handlers/draw-rectangle-using-three-points-handler.d.ts +9 -0
- package/dist/mode-handlers/draw-rectangle-using-three-points-handler.js +49 -0
- package/dist/mode-handlers/duplicate-handler.d.ts +9 -0
- package/dist/mode-handlers/duplicate-handler.js +19 -0
- package/dist/mode-handlers/elevation-handler.d.ts +19 -0
- package/dist/mode-handlers/elevation-handler.js +48 -0
- package/dist/mode-handlers/extrude-handler.d.ts +18 -0
- package/dist/mode-handlers/extrude-handler.js +176 -0
- package/dist/mode-handlers/mode-handler.d.ts +61 -0
- package/dist/mode-handlers/mode-handler.js +286 -0
- package/dist/mode-handlers/modify-handler.d.ts +19 -0
- package/dist/mode-handlers/modify-handler.js +193 -0
- package/dist/mode-handlers/rotate-handler.d.ts +17 -0
- package/dist/mode-handlers/rotate-handler.js +74 -0
- package/dist/mode-handlers/scale-handler.d.ts +17 -0
- package/dist/mode-handlers/scale-handler.js +76 -0
- package/dist/mode-handlers/snappable-handler.d.ts +33 -0
- package/dist/mode-handlers/snappable-handler.js +133 -0
- package/dist/mode-handlers/split-polygon-handler.d.ts +11 -0
- package/dist/mode-handlers/split-polygon-handler.js +154 -0
- package/dist/mode-handlers/three-click-polygon-handler.d.ts +5 -0
- package/dist/mode-handlers/three-click-polygon-handler.js +18 -0
- package/dist/mode-handlers/translate-handler.d.ts +17 -0
- package/dist/mode-handlers/translate-handler.js +72 -0
- package/dist/mode-handlers/two-click-polygon-handler.d.ts +5 -0
- package/dist/mode-handlers/two-click-polygon-handler.js +18 -0
- package/dist/mode-handlers/view-handler.d.ts +8 -0
- package/dist/mode-handlers/view-handler.js +10 -0
- package/dist/shaderlib/color/color.d.ts +8 -0
- package/dist/shaderlib/color/color.js +51 -0
- package/dist/shaderlib/outline/outline.d.ts +8 -0
- package/dist/shaderlib/outline/outline.js +97 -0
- package/dist/shaderlib/utils/utils.d.ts +8 -0
- package/dist/shaderlib/utils/utils.js +28 -0
- package/dist/translateFromCenter.d.ts +4 -0
- package/dist/translateFromCenter.js +19 -0
- package/dist/types.d.ts +35 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +144 -0
- package/package.json +84 -0
- package/src/constants.ts +15 -0
- package/src/curve-utils.ts +77 -0
- package/src/edit-modes/composite-mode.ts +74 -0
- package/src/edit-modes/draw-90degree-polygon-mode.ts +220 -0
- package/src/edit-modes/draw-circle-by-diameter-mode.ts +88 -0
- package/src/edit-modes/draw-circle-from-center-mode.ts +79 -0
- package/src/edit-modes/draw-ellipse-by-bounding-box-mode.ts +25 -0
- package/src/edit-modes/draw-ellipse-using-three-points-mode.ts +23 -0
- package/src/edit-modes/draw-line-string-mode.ts +200 -0
- package/src/edit-modes/draw-point-mode.ts +35 -0
- package/src/edit-modes/draw-polygon-by-dragging-mode.ts +106 -0
- package/src/edit-modes/draw-polygon-mode.ts +171 -0
- package/src/edit-modes/draw-rectangle-from-center-mode.ts +23 -0
- package/src/edit-modes/draw-rectangle-mode.ts +14 -0
- package/src/edit-modes/draw-rectangle-using-three-points-mode.ts +36 -0
- package/src/edit-modes/draw-square-from-center-mode.ts +46 -0
- package/src/edit-modes/draw-square-mode.ts +36 -0
- package/src/edit-modes/duplicate-mode.ts +21 -0
- package/src/edit-modes/edit-mode.ts +30 -0
- package/src/edit-modes/elevation-mode.ts +86 -0
- package/src/edit-modes/extend-line-string-mode.ts +87 -0
- package/src/edit-modes/extrude-mode.ts +254 -0
- package/src/edit-modes/geojson-edit-mode.ts +283 -0
- package/src/edit-modes/immutable-feature-collection.ts +417 -0
- package/src/edit-modes/measure-angle-mode.ts +127 -0
- package/src/edit-modes/measure-area-mode.ts +62 -0
- package/src/edit-modes/measure-distance-mode.ts +215 -0
- package/src/edit-modes/modify-mode.ts +293 -0
- package/src/edit-modes/resize-circle-mode.ts +202 -0
- package/src/edit-modes/rotate-mode.ts +208 -0
- package/src/edit-modes/scale-mode.ts +231 -0
- package/src/edit-modes/snappable-mode.ts +174 -0
- package/src/edit-modes/split-polygon-mode.ts +201 -0
- package/src/edit-modes/three-click-polygon-mode.ts +111 -0
- package/src/edit-modes/transform-mode.ts +75 -0
- package/src/edit-modes/translate-mode.ts +161 -0
- package/src/edit-modes/two-click-polygon-mode.ts +132 -0
- package/src/edit-modes/types.ts +135 -0
- package/src/edit-modes/utils.ts +513 -0
- package/src/edit-modes/view-mode.ts +3 -0
- package/src/editable-layers/editable-geojson-layer.ts +603 -0
- package/src/editable-layers/editable-h3-cluster-layer.ts +226 -0
- package/src/editable-layers/editable-layer.ts +252 -0
- package/src/editable-layers/editable-path-layer.ts +51 -0
- package/src/editable-layers/elevated-edit-handle-layer.ts +33 -0
- package/src/editable-layers/junction-scatterplot-layer.ts +53 -0
- package/src/editable-layers/path-marker-layer/arrow-2d-geometry.ts +61 -0
- package/src/editable-layers/path-marker-layer/create-path-markers.ts +107 -0
- package/src/editable-layers/path-marker-layer/path-marker-layer.ts +179 -0
- package/src/editable-layers/path-marker-layer/polyline.ts +40 -0
- package/src/editable-layers/path-outline-layer/path-outline-layer.ts +147 -0
- package/src/editable-layers/selection-layer.ts +209 -0
- package/src/geojson-types.ts +89 -0
- package/src/index.ts +125 -0
- package/src/lib/constants.ts +6 -0
- package/src/lib/deck-renderer/deck-cache.ts +61 -0
- package/src/lib/deck-renderer/deck-drawer.ts +263 -0
- package/src/lib/feature.ts +27 -0
- package/src/lib/layer-mouse-event.ts +32 -0
- package/src/lib/layers/junctions-layer.ts +40 -0
- package/src/lib/layers/segments-layer.ts +108 -0
- package/src/lib/layers/texts-layer.ts +43 -0
- package/src/lib/math.ts +26 -0
- package/src/lib/nebula-layer.ts +33 -0
- package/src/lib/nebula.ts +323 -0
- package/src/lib/style.ts +22 -0
- package/src/memoize.ts +43 -0
- package/src/mode-handlers/composite-mode-handler.ts +89 -0
- package/src/mode-handlers/draw-90degree-polygon-handler.ts +201 -0
- package/src/mode-handlers/draw-circle-by-bounding-box-handler.ts +39 -0
- package/src/mode-handlers/draw-circle-from-center-handler.ts +38 -0
- package/src/mode-handlers/draw-ellipse-by-bounding-box-handler.ts +41 -0
- package/src/mode-handlers/draw-ellipse-using-three-points-handler.ts +46 -0
- package/src/mode-handlers/draw-line-string-handler.ts +108 -0
- package/src/mode-handlers/draw-point-handler.ts +15 -0
- package/src/mode-handlers/draw-polygon-handler.ts +121 -0
- package/src/mode-handlers/draw-rectangle-handler.ts +28 -0
- package/src/mode-handlers/draw-rectangle-using-three-points-handler.ts +60 -0
- package/src/mode-handlers/duplicate-handler.ts +25 -0
- package/src/mode-handlers/elevation-handler.ts +88 -0
- package/src/mode-handlers/extrude-handler.ts +245 -0
- package/src/mode-handlers/mode-handler.ts +394 -0
- package/src/mode-handlers/modify-handler.ts +263 -0
- package/src/mode-handlers/rotate-handler.ts +107 -0
- package/src/mode-handlers/scale-handler.ts +105 -0
- package/src/mode-handlers/snappable-handler.ts +184 -0
- package/src/mode-handlers/split-polygon-handler.ts +177 -0
- package/src/mode-handlers/three-click-polygon-handler.ts +25 -0
- package/src/mode-handlers/translate-handler.ts +110 -0
- package/src/mode-handlers/two-click-polygon-handler.ts +25 -0
- package/src/mode-handlers/view-handler.ts +13 -0
- package/src/shaderlib/color/color.ts +56 -0
- package/src/shaderlib/outline/outline.ts +101 -0
- package/src/shaderlib/utils/utils.ts +33 -0
- package/src/translateFromCenter.ts +48 -0
- package/src/types.ts +39 -0
- package/src/utils.ts +185 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import destination from '@turf/destination';
|
|
2
|
+
import bearing from '@turf/bearing';
|
|
3
|
+
import pointToLineDistance from '@turf/point-to-line-distance';
|
|
4
|
+
import { flattenEach } from '@turf/meta';
|
|
5
|
+
import { point } from '@turf/helpers';
|
|
6
|
+
import { getCoords } from '@turf/invariant';
|
|
7
|
+
import WebMercatorViewport from 'viewport-mercator-project';
|
|
8
|
+
export function toDeckColor(color, defaultColor = [255, 0, 0, 255]) {
|
|
9
|
+
if (!Array.isArray(color)) {
|
|
10
|
+
return defaultColor;
|
|
11
|
+
}
|
|
12
|
+
return [color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255];
|
|
13
|
+
}
|
|
14
|
+
//
|
|
15
|
+
// a GeoJSON helper function that calls the provided function with
|
|
16
|
+
// an argument that is the most deeply-nested array having elements
|
|
17
|
+
// that are arrays of primitives as an argument, e.g.
|
|
18
|
+
//
|
|
19
|
+
// {
|
|
20
|
+
// "type": "MultiPolygon",
|
|
21
|
+
// "coordinates": [
|
|
22
|
+
// [
|
|
23
|
+
// [[30, 20], [45, 40], [10, 40], [30, 20]]
|
|
24
|
+
// ],
|
|
25
|
+
// [
|
|
26
|
+
// [[15, 5], [40, 10], [10, 20], [5, 10], [15, 5]]
|
|
27
|
+
// ]
|
|
28
|
+
// ]
|
|
29
|
+
// }
|
|
30
|
+
//
|
|
31
|
+
// the function would be called on:
|
|
32
|
+
//
|
|
33
|
+
// [[30, 20], [45, 40], [10, 40], [30, 20]]
|
|
34
|
+
//
|
|
35
|
+
// and
|
|
36
|
+
//
|
|
37
|
+
// [[15, 5], [40, 10], [10, 20], [5, 10], [15, 5]]
|
|
38
|
+
//
|
|
39
|
+
export function recursivelyTraverseNestedArrays(array, prefix, fn) {
|
|
40
|
+
if (!Array.isArray(array[0])) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
for (let i = 0; i < array.length; i++) {
|
|
44
|
+
if (recursivelyTraverseNestedArrays(array[i], [...prefix, i], fn)) {
|
|
45
|
+
fn(array, prefix);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
export function generatePointsParallelToLinePoints(p1, p2, mapCoords) {
|
|
52
|
+
const lineString = {
|
|
53
|
+
type: 'LineString',
|
|
54
|
+
coordinates: [p1, p2],
|
|
55
|
+
};
|
|
56
|
+
const pt = point(mapCoords);
|
|
57
|
+
const ddistance = pointToLineDistance(pt, lineString);
|
|
58
|
+
const lineBearing = bearing(p1, p2);
|
|
59
|
+
// Check if current point is to the left or right of line
|
|
60
|
+
// Line from A=(x1,y1) to B=(x2,y2) a point P=(x,y)
|
|
61
|
+
// then (x−x1)(y2−y1)−(y−y1)(x2−x1)
|
|
62
|
+
const isPointToLeftOfLine = (mapCoords[0] - p1[0]) * (p2[1] - p1[1]) - (mapCoords[1] - p1[1]) * (p2[0] - p1[0]);
|
|
63
|
+
// Bearing to draw perpendicular to the line string
|
|
64
|
+
const orthogonalBearing = isPointToLeftOfLine < 0 ? lineBearing - 90 : lineBearing - 270;
|
|
65
|
+
// Get coordinates for the point p3 and p4 which are perpendicular to the lineString
|
|
66
|
+
// Add the distance as the current position moves away from the lineString
|
|
67
|
+
const p3 = destination(p2, ddistance, orthogonalBearing);
|
|
68
|
+
const p4 = destination(p1, ddistance, orthogonalBearing);
|
|
69
|
+
return [p3.geometry.coordinates, p4.geometry.coordinates];
|
|
70
|
+
}
|
|
71
|
+
export function distance2d(x1, y1, x2, y2) {
|
|
72
|
+
const dx = x1 - x2;
|
|
73
|
+
const dy = y1 - y2;
|
|
74
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
75
|
+
}
|
|
76
|
+
export function mix(a, b, ratio) {
|
|
77
|
+
return b * ratio + a * (1 - ratio);
|
|
78
|
+
}
|
|
79
|
+
export function nearestPointOnProjectedLine(line, inPoint, viewport) {
|
|
80
|
+
const wmViewport = new WebMercatorViewport(viewport);
|
|
81
|
+
// Project the line to viewport, then find the nearest point
|
|
82
|
+
const coordinates = line.geometry.coordinates;
|
|
83
|
+
const projectedCoords = coordinates.map(([x, y, z = 0]) => wmViewport.project([x, y, z]));
|
|
84
|
+
const [x, y] = wmViewport.project(inPoint.geometry.coordinates);
|
|
85
|
+
// console.log('projectedCoords', JSON.stringify(projectedCoords));
|
|
86
|
+
let minDistance = Infinity;
|
|
87
|
+
let minPointInfo = {};
|
|
88
|
+
projectedCoords.forEach(([x2, y2], index) => {
|
|
89
|
+
if (index === 0) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const [x1, y1] = projectedCoords[index - 1];
|
|
93
|
+
// line from projectedCoords[index - 1] to projectedCoords[index]
|
|
94
|
+
// convert to Ax + By + C = 0
|
|
95
|
+
const A = y1 - y2;
|
|
96
|
+
const B = x2 - x1;
|
|
97
|
+
const C = x1 * y2 - x2 * y1;
|
|
98
|
+
// https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
|
|
99
|
+
const div = A * A + B * B;
|
|
100
|
+
const distance = Math.abs(A * x + B * y + C) / Math.sqrt(div);
|
|
101
|
+
// TODO: Check if inside bounds
|
|
102
|
+
if (distance < minDistance) {
|
|
103
|
+
minDistance = distance;
|
|
104
|
+
minPointInfo = {
|
|
105
|
+
index,
|
|
106
|
+
x0: (B * (B * x - A * y) - A * C) / div,
|
|
107
|
+
y0: (A * (-B * x + A * y) - B * C) / div,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
const { index, x0, y0 } = minPointInfo;
|
|
113
|
+
const [x1, y1, z1 = 0] = projectedCoords[index - 1];
|
|
114
|
+
const [x2, y2, z2 = 0] = projectedCoords[index];
|
|
115
|
+
// calculate what ratio of the line we are on to find the proper z
|
|
116
|
+
const lineLength = distance2d(x1, y1, x2, y2);
|
|
117
|
+
const startToPointLength = distance2d(x1, y1, x0, y0);
|
|
118
|
+
const ratio = startToPointLength / lineLength;
|
|
119
|
+
const z0 = mix(z1, z2, ratio);
|
|
120
|
+
return {
|
|
121
|
+
type: 'Feature',
|
|
122
|
+
geometry: {
|
|
123
|
+
type: 'Point',
|
|
124
|
+
// @ts-expect-error
|
|
125
|
+
coordinates: wmViewport.unproject([x0, y0, z0]),
|
|
126
|
+
},
|
|
127
|
+
properties: {
|
|
128
|
+
// TODO: calculate the distance in proper units
|
|
129
|
+
dist: minDistance,
|
|
130
|
+
index: index - 1,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export function nearestPointOnLine(lines, inPoint, viewport) {
|
|
135
|
+
let mercator;
|
|
136
|
+
if (viewport) {
|
|
137
|
+
mercator = new WebMercatorViewport(viewport);
|
|
138
|
+
}
|
|
139
|
+
let closestPoint = point([Infinity, Infinity], {
|
|
140
|
+
dist: Infinity,
|
|
141
|
+
});
|
|
142
|
+
if (!lines.geometry?.coordinates.length || lines.geometry?.coordinates.length < 2) {
|
|
143
|
+
return closestPoint;
|
|
144
|
+
}
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
// eslint-disable-next-line max-statements, complexity
|
|
147
|
+
flattenEach(lines, (line) => {
|
|
148
|
+
const coords = getCoords(line);
|
|
149
|
+
// @ts-ignore
|
|
150
|
+
const pointCoords = getCoords(inPoint);
|
|
151
|
+
let minDist;
|
|
152
|
+
let to;
|
|
153
|
+
let from;
|
|
154
|
+
let x;
|
|
155
|
+
let y;
|
|
156
|
+
let segmentIdx;
|
|
157
|
+
let dist;
|
|
158
|
+
if (coords.length > 1 && pointCoords.length) {
|
|
159
|
+
let lineCoordinates;
|
|
160
|
+
let pointCoordinate;
|
|
161
|
+
// If viewport is given, then translate these coordinates to pixels to increase precision
|
|
162
|
+
if (mercator) {
|
|
163
|
+
lineCoordinates = coords.map((lineCoordinate) => mercator.project(lineCoordinate));
|
|
164
|
+
pointCoordinate = mercator.project(pointCoords);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
lineCoordinates = coords;
|
|
168
|
+
pointCoordinate = pointCoords;
|
|
169
|
+
}
|
|
170
|
+
for (let n = 1; n < lineCoordinates.length; n++) {
|
|
171
|
+
if (lineCoordinates[n][0] !== lineCoordinates[n - 1][0]) {
|
|
172
|
+
const slope = (lineCoordinates[n][1] - lineCoordinates[n - 1][1]) /
|
|
173
|
+
(lineCoordinates[n][0] - lineCoordinates[n - 1][0]);
|
|
174
|
+
const inverseSlope = lineCoordinates[n][1] - slope * lineCoordinates[n][0];
|
|
175
|
+
dist =
|
|
176
|
+
Math.abs(slope * pointCoordinate[0] + inverseSlope - pointCoordinate[1]) /
|
|
177
|
+
Math.sqrt(slope * slope + 1);
|
|
178
|
+
}
|
|
179
|
+
else
|
|
180
|
+
dist = Math.abs(pointCoordinate[0] - lineCoordinates[n][0]);
|
|
181
|
+
// length^2 of line segment
|
|
182
|
+
const rl2 = Math.pow(lineCoordinates[n][1] - lineCoordinates[n - 1][1], 2) +
|
|
183
|
+
Math.pow(lineCoordinates[n][0] - lineCoordinates[n - 1][0], 2);
|
|
184
|
+
// distance^2 of pt to end line segment
|
|
185
|
+
const ln2 = Math.pow(lineCoordinates[n][1] - pointCoordinate[1], 2) +
|
|
186
|
+
Math.pow(lineCoordinates[n][0] - pointCoordinate[0], 2);
|
|
187
|
+
// distance^2 of pt to begin line segment
|
|
188
|
+
const lnm12 = Math.pow(lineCoordinates[n - 1][1] - pointCoordinate[1], 2) +
|
|
189
|
+
Math.pow(lineCoordinates[n - 1][0] - pointCoordinate[0], 2);
|
|
190
|
+
// minimum distance^2 of pt to infinite line
|
|
191
|
+
const dist2 = Math.pow(dist, 2);
|
|
192
|
+
// calculated length^2 of line segment
|
|
193
|
+
const calcrl2 = ln2 - dist2 + lnm12 - dist2;
|
|
194
|
+
// redefine minimum distance to line segment (not infinite line) if necessary
|
|
195
|
+
if (calcrl2 > rl2) {
|
|
196
|
+
dist = Math.sqrt(Math.min(ln2, lnm12));
|
|
197
|
+
}
|
|
198
|
+
if (minDist === null || minDist === undefined || minDist > dist) {
|
|
199
|
+
// eslint-disable-next-line max-depth
|
|
200
|
+
if (calcrl2 > rl2) {
|
|
201
|
+
// eslint-disable-next-line max-depth
|
|
202
|
+
if (lnm12 < ln2) {
|
|
203
|
+
to = 0; // nearer to previous point
|
|
204
|
+
from = 1;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
from = 0; // nearer to current point
|
|
208
|
+
to = 1;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
// perpendicular from point intersects line segment
|
|
213
|
+
to = Math.sqrt(lnm12 - dist2) / Math.sqrt(rl2);
|
|
214
|
+
from = Math.sqrt(ln2 - dist2) / Math.sqrt(rl2);
|
|
215
|
+
}
|
|
216
|
+
minDist = dist;
|
|
217
|
+
segmentIdx = n;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const dx = lineCoordinates[segmentIdx - 1][0] - lineCoordinates[segmentIdx][0];
|
|
221
|
+
const dy = lineCoordinates[segmentIdx - 1][1] - lineCoordinates[segmentIdx][1];
|
|
222
|
+
x = lineCoordinates[segmentIdx - 1][0] - dx * to;
|
|
223
|
+
y = lineCoordinates[segmentIdx - 1][1] - dy * to;
|
|
224
|
+
}
|
|
225
|
+
// index needs to be -1 because we have to account for the shift from initial backscan
|
|
226
|
+
let snapPoint = { x, y, idx: segmentIdx - 1, to, from };
|
|
227
|
+
if (mercator) {
|
|
228
|
+
const pixelToLatLong = mercator.unproject([snapPoint.x, snapPoint.y]);
|
|
229
|
+
snapPoint = {
|
|
230
|
+
x: pixelToLatLong[0],
|
|
231
|
+
y: pixelToLatLong[1],
|
|
232
|
+
idx: segmentIdx - 1,
|
|
233
|
+
to,
|
|
234
|
+
from,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
closestPoint = point([snapPoint.x, snapPoint.y], {
|
|
238
|
+
dist: Math.abs(snapPoint.from - snapPoint.to),
|
|
239
|
+
index: snapPoint.idx,
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
return closestPoint;
|
|
243
|
+
}
|
|
244
|
+
export function getPickedEditHandle(picks) {
|
|
245
|
+
const handles = getPickedEditHandles(picks);
|
|
246
|
+
return handles.length ? handles[0] : null;
|
|
247
|
+
}
|
|
248
|
+
export function getPickedSnapSourceEditHandle(picks) {
|
|
249
|
+
const handles = getPickedEditHandles(picks);
|
|
250
|
+
return handles.find((handle) => handle.properties.editHandleType === 'snap-source');
|
|
251
|
+
}
|
|
252
|
+
export function getNonGuidePicks(picks) {
|
|
253
|
+
return picks && picks.filter((pick) => !pick.isGuide);
|
|
254
|
+
}
|
|
255
|
+
export function getPickedExistingEditHandle(picks) {
|
|
256
|
+
const handles = getPickedEditHandles(picks);
|
|
257
|
+
return handles.find(({ properties }) => properties.featureIndex >= 0 && properties.editHandleType === 'existing');
|
|
258
|
+
}
|
|
259
|
+
export function getPickedIntermediateEditHandle(picks) {
|
|
260
|
+
const handles = getPickedEditHandles(picks);
|
|
261
|
+
return handles.find(({ properties }) => properties.featureIndex >= 0 && properties.editHandleType === 'intermediate');
|
|
262
|
+
}
|
|
263
|
+
export function getPickedEditHandles(picks) {
|
|
264
|
+
const handles = (picks &&
|
|
265
|
+
picks
|
|
266
|
+
.filter((pick) => pick.isGuide && pick.object.properties.guideType === 'editHandle')
|
|
267
|
+
.map((pick) => pick.object)) ||
|
|
268
|
+
[];
|
|
269
|
+
return handles;
|
|
270
|
+
}
|
|
271
|
+
export function getEditHandlesForGeometry(geometry, featureIndex, editHandleType = 'existing') {
|
|
272
|
+
let handles = [];
|
|
273
|
+
switch (geometry.type) {
|
|
274
|
+
case 'Point':
|
|
275
|
+
// positions are not nested
|
|
276
|
+
handles = [
|
|
277
|
+
{
|
|
278
|
+
type: 'Feature',
|
|
279
|
+
properties: {
|
|
280
|
+
guideType: 'editHandle',
|
|
281
|
+
editHandleType,
|
|
282
|
+
positionIndexes: [],
|
|
283
|
+
featureIndex,
|
|
284
|
+
},
|
|
285
|
+
geometry: {
|
|
286
|
+
type: 'Point',
|
|
287
|
+
coordinates: geometry.coordinates,
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
];
|
|
291
|
+
break;
|
|
292
|
+
case 'MultiPoint':
|
|
293
|
+
case 'LineString':
|
|
294
|
+
// positions are nested 1 level
|
|
295
|
+
handles = handles.concat(getEditHandlesForCoordinates(geometry.coordinates, [], featureIndex, editHandleType));
|
|
296
|
+
break;
|
|
297
|
+
case 'Polygon':
|
|
298
|
+
case 'MultiLineString':
|
|
299
|
+
// positions are nested 2 levels
|
|
300
|
+
for (let a = 0; a < geometry.coordinates.length; a++) {
|
|
301
|
+
handles = handles.concat(getEditHandlesForCoordinates(geometry.coordinates[a], [a], featureIndex, editHandleType));
|
|
302
|
+
if (geometry.type === 'Polygon') {
|
|
303
|
+
// Don't repeat the first/last handle for Polygons
|
|
304
|
+
handles = handles.slice(0, -1);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
break;
|
|
308
|
+
case 'MultiPolygon':
|
|
309
|
+
// positions are nested 3 levels
|
|
310
|
+
for (let a = 0; a < geometry.coordinates.length; a++) {
|
|
311
|
+
for (let b = 0; b < geometry.coordinates[a].length; b++) {
|
|
312
|
+
handles = handles.concat(getEditHandlesForCoordinates(geometry.coordinates[a][b], [a, b], featureIndex, editHandleType));
|
|
313
|
+
// Don't repeat the first/last handle for Polygons
|
|
314
|
+
handles = handles.slice(0, -1);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
break;
|
|
318
|
+
default:
|
|
319
|
+
throw Error(`Unhandled geometry type: ${geometry.type}`);
|
|
320
|
+
}
|
|
321
|
+
return handles;
|
|
322
|
+
}
|
|
323
|
+
function getEditHandlesForCoordinates(coordinates, positionIndexPrefix, featureIndex, editHandleType = 'existing') {
|
|
324
|
+
const editHandles = [];
|
|
325
|
+
for (let i = 0; i < coordinates.length; i++) {
|
|
326
|
+
const position = coordinates[i];
|
|
327
|
+
editHandles.push({
|
|
328
|
+
type: 'Feature',
|
|
329
|
+
properties: {
|
|
330
|
+
guideType: 'editHandle',
|
|
331
|
+
positionIndexes: [...positionIndexPrefix, i],
|
|
332
|
+
featureIndex,
|
|
333
|
+
editHandleType,
|
|
334
|
+
},
|
|
335
|
+
geometry: {
|
|
336
|
+
type: 'Point',
|
|
337
|
+
coordinates: position,
|
|
338
|
+
},
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
return editHandles;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Calculates coordinates for a feature preserving rectangular shape.
|
|
345
|
+
* @param feature Feature before modification.
|
|
346
|
+
* @param editHandleIndex Index of the point to modify.
|
|
347
|
+
* @param mapCoords New position for the point.
|
|
348
|
+
* @returns Updated coordinates.
|
|
349
|
+
*/
|
|
350
|
+
export function updateRectanglePosition(feature, editHandleIndex, mapCoords) {
|
|
351
|
+
const coordinates = feature.geometry.coordinates;
|
|
352
|
+
if (!coordinates) {
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
const points = coordinates[0].slice(0, 4);
|
|
356
|
+
points[editHandleIndex % 4] = mapCoords;
|
|
357
|
+
const p0 = points[(editHandleIndex + 2) % 4];
|
|
358
|
+
const p2 = points[editHandleIndex % 4];
|
|
359
|
+
points[(editHandleIndex + 1) % 4] = [p2[0], p0[1]];
|
|
360
|
+
points[(editHandleIndex + 3) % 4] = [p0[0], p2[1]];
|
|
361
|
+
return [[...points, points[0]]];
|
|
362
|
+
}
|
|
363
|
+
/** Creates a copy of feature's coordinates.
|
|
364
|
+
* Each position in coordinates is transformed by calling the provided function.
|
|
365
|
+
* @param coords Coordinates of a feature.
|
|
366
|
+
* @param callback A function to transform each coordinate.
|
|
367
|
+
* @retuns Transformed coordinates.
|
|
368
|
+
*/
|
|
369
|
+
export function mapCoords(coords, callback) {
|
|
370
|
+
if (typeof coords[0] === 'number') {
|
|
371
|
+
if (!isNaN(coords[0]) && isFinite(coords[0])) {
|
|
372
|
+
return callback(coords);
|
|
373
|
+
}
|
|
374
|
+
return coords;
|
|
375
|
+
}
|
|
376
|
+
return coords
|
|
377
|
+
.map((coord) => {
|
|
378
|
+
return mapCoords(coord, callback);
|
|
379
|
+
})
|
|
380
|
+
.filter(Boolean);
|
|
381
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { UpdateParameters, DefaultProps } from '@deck.gl/core';
|
|
2
|
+
import { GeoJsonLayer, TextLayer } from '@deck.gl/layers';
|
|
3
|
+
import { EditAction, ClickEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, PointerMoveEvent } from '../edit-modes/types';
|
|
4
|
+
import { GeoJsonEditModeType } from '../edit-modes/geojson-edit-mode';
|
|
5
|
+
import { Color } from '../types';
|
|
6
|
+
import EditableLayer, { EditableLayerProps } from './editable-layer';
|
|
7
|
+
import { Feature, FeatureCollection } from '../geojson-types';
|
|
8
|
+
export type EditableGeojsonLayerProps<DataT = any> = EditableLayerProps & {
|
|
9
|
+
data: DataT;
|
|
10
|
+
mode?: any;
|
|
11
|
+
modeConfig?: any;
|
|
12
|
+
selectedFeatureIndexes?: number[];
|
|
13
|
+
onEdit?: (updatedData?: any, editType?: string, featureIndexes?: number[], editContext?: any) => void;
|
|
14
|
+
pickable?: boolean;
|
|
15
|
+
pickingRadius?: number;
|
|
16
|
+
pickingDepth?: number;
|
|
17
|
+
fp64?: boolean;
|
|
18
|
+
filled?: boolean;
|
|
19
|
+
stroked?: boolean;
|
|
20
|
+
lineWidthScale?: number;
|
|
21
|
+
lineWidthMinPixels?: number;
|
|
22
|
+
lineWidthMaxPixels?: number;
|
|
23
|
+
pickingLineWidthExtraPixels?: number;
|
|
24
|
+
lineWidthUnits?: string;
|
|
25
|
+
lineJointRounded?: boolean;
|
|
26
|
+
lineCapRounded?: boolean;
|
|
27
|
+
lineMiterLimit?: number;
|
|
28
|
+
pointRadiusScale?: number;
|
|
29
|
+
pointRadiusMinPixels?: number;
|
|
30
|
+
pointRadiusMaxPixels?: number;
|
|
31
|
+
getLineColor?: Color | ((feature: any, isSelected: any, mode: any) => Color);
|
|
32
|
+
getFillColor?: Color | ((feature: any, isSelected: any, mode: any) => Color);
|
|
33
|
+
getRadius?: number | ((f: any) => number);
|
|
34
|
+
getLineWidth?: number | ((f: any) => number);
|
|
35
|
+
getTentativeLineColor?: Color | ((feature: any, isSelected: any, mode: any) => Color);
|
|
36
|
+
getTentativeFillColor?: Color | ((feature: any, isSelected: any, mode: any) => Color);
|
|
37
|
+
getTentativeLineWidth?: number | ((f: any) => number);
|
|
38
|
+
editHandleType?: string;
|
|
39
|
+
editHandlePointRadiusScale?: number;
|
|
40
|
+
editHandlePointOutline?: boolean;
|
|
41
|
+
editHandlePointStrokeWidth?: number;
|
|
42
|
+
editHandlePointRadiusUnits?: string;
|
|
43
|
+
editHandlePointRadiusMinPixels?: number;
|
|
44
|
+
editHandlePointRadiusMaxPixels?: number;
|
|
45
|
+
getEditHandlePointColor?: Color | ((handle: any) => Color);
|
|
46
|
+
getEditHandlePointOutlineColor?: Color | ((handle: any) => Color);
|
|
47
|
+
getEditHandlePointRadius?: number | ((handle: any) => number);
|
|
48
|
+
editHandleIconAtlas?: any;
|
|
49
|
+
editHandleIconMapping?: any;
|
|
50
|
+
editHandleIconSizeScale?: number;
|
|
51
|
+
editHandleIconSizeUnits?: string;
|
|
52
|
+
getEditHandleIcon?: (handle: any) => string;
|
|
53
|
+
getEditHandleIconSize?: number;
|
|
54
|
+
getEditHandleIconColor?: Color | ((handle: any) => Color);
|
|
55
|
+
getEditHandleIconAngle?: number | ((handle: any) => number);
|
|
56
|
+
billboard?: boolean;
|
|
57
|
+
};
|
|
58
|
+
export default class EditableGeoJsonLayer extends EditableLayer<FeatureCollection, EditableGeojsonLayerProps<FeatureCollection>> {
|
|
59
|
+
static layerName: string;
|
|
60
|
+
static defaultProps: DefaultProps<EditableGeojsonLayerProps<any>>;
|
|
61
|
+
state: EditableLayer['state'] & {
|
|
62
|
+
cursor?: 'grabbing' | 'grab' | null;
|
|
63
|
+
mode: GeoJsonEditModeType;
|
|
64
|
+
lastPointerMoveEvent: PointerMoveEvent;
|
|
65
|
+
tentativeFeature?: Feature;
|
|
66
|
+
editHandles: any[];
|
|
67
|
+
selectedFeatures: Feature[];
|
|
68
|
+
};
|
|
69
|
+
renderLayers(): any;
|
|
70
|
+
initializeState(): void;
|
|
71
|
+
shouldUpdateState(opts: any): any;
|
|
72
|
+
updateState({ props, oldProps, changeFlags, context }: UpdateParameters<this>): void;
|
|
73
|
+
getModeProps(props: EditableGeojsonLayerProps<any>): {
|
|
74
|
+
modeConfig: any;
|
|
75
|
+
data: any;
|
|
76
|
+
selectedIndexes: number[];
|
|
77
|
+
lastPointerMoveEvent: PointerMoveEvent;
|
|
78
|
+
cursor: "grabbing" | "grab";
|
|
79
|
+
onEdit: (editAction: EditAction<FeatureCollection>) => void;
|
|
80
|
+
onUpdateCursor: (cursor: string | null | undefined) => void;
|
|
81
|
+
};
|
|
82
|
+
selectionAwareAccessor(accessor: any): any;
|
|
83
|
+
isFeatureSelected(feature: Feature): boolean;
|
|
84
|
+
getPickingInfo({ info, sourceLayer }: Record<string, any>): any;
|
|
85
|
+
_updateAutoHighlight(info: any): void;
|
|
86
|
+
createGuidesLayers(): GeoJsonLayer<any, {}>[];
|
|
87
|
+
createTooltipsLayers(): TextLayer<any, {}>[];
|
|
88
|
+
onLayerClick(event: ClickEvent): void;
|
|
89
|
+
onLayerKeyUp(event: KeyboardEvent): void;
|
|
90
|
+
onStartDragging(event: StartDraggingEvent): void;
|
|
91
|
+
onDragging(event: DraggingEvent): void;
|
|
92
|
+
onStopDragging(event: StopDraggingEvent): void;
|
|
93
|
+
onPointerMove(event: PointerMoveEvent): void;
|
|
94
|
+
getCursor({ isDragging }: {
|
|
95
|
+
isDragging: boolean;
|
|
96
|
+
}): null | 'grabbing' | 'grab';
|
|
97
|
+
getActiveMode(): GeoJsonEditModeType;
|
|
98
|
+
}
|