@deck.gl-community/editable-layers 9.0.2 → 9.1.0-beta.2
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/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/edit-modes/composite-mode.d.ts +4 -3
- package/dist/edit-modes/composite-mode.d.ts.map +1 -0
- package/dist/edit-modes/composite-mode.js +1 -1
- package/dist/edit-modes/delete-mode.d.ts +7 -0
- package/dist/edit-modes/delete-mode.d.ts.map +1 -0
- package/dist/edit-modes/delete-mode.js +22 -0
- package/dist/edit-modes/draw-90degree-polygon-mode.d.ts +4 -3
- package/dist/edit-modes/draw-90degree-polygon-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-90degree-polygon-mode.js +2 -2
- package/dist/edit-modes/draw-circle-by-diameter-mode.d.ts +4 -3
- package/dist/edit-modes/draw-circle-by-diameter-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-circle-by-diameter-mode.js +7 -3
- package/dist/edit-modes/draw-circle-from-center-mode.d.ts +4 -3
- package/dist/edit-modes/draw-circle-from-center-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-circle-from-center-mode.js +6 -2
- package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.d.ts +3 -2
- package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.js +11 -3
- package/dist/edit-modes/draw-ellipse-using-three-points-mode.d.ts +3 -2
- package/dist/edit-modes/draw-ellipse-using-three-points-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-ellipse-using-three-points-mode.js +12 -3
- package/dist/edit-modes/draw-line-string-mode.d.ts +4 -3
- package/dist/edit-modes/draw-line-string-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-line-string-mode.js +3 -3
- package/dist/edit-modes/draw-point-mode.d.ts +4 -3
- package/dist/edit-modes/draw-point-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-point-mode.js +1 -1
- package/dist/edit-modes/draw-polygon-by-dragging-mode.d.ts +4 -3
- package/dist/edit-modes/draw-polygon-by-dragging-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-polygon-by-dragging-mode.js +2 -2
- package/dist/edit-modes/draw-polygon-mode.d.ts +4 -3
- package/dist/edit-modes/draw-polygon-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-polygon-mode.js +2 -2
- package/dist/edit-modes/draw-rectangle-from-center-mode.d.ts +3 -2
- package/dist/edit-modes/draw-rectangle-from-center-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-rectangle-from-center-mode.js +1 -1
- package/dist/edit-modes/draw-rectangle-mode.d.ts +3 -2
- package/dist/edit-modes/draw-rectangle-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-rectangle-mode.js +1 -1
- package/dist/edit-modes/draw-rectangle-using-three-points-mode.d.ts +3 -2
- package/dist/edit-modes/draw-rectangle-using-three-points-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-rectangle-using-three-points-mode.js +2 -2
- package/dist/edit-modes/draw-square-from-center-mode.d.ts +3 -2
- package/dist/edit-modes/draw-square-from-center-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-square-from-center-mode.js +1 -1
- package/dist/edit-modes/draw-square-mode.d.ts +3 -2
- package/dist/edit-modes/draw-square-mode.d.ts.map +1 -0
- package/dist/edit-modes/draw-square-mode.js +1 -1
- package/dist/edit-modes/duplicate-mode.d.ts +4 -3
- package/dist/edit-modes/duplicate-mode.d.ts.map +1 -0
- package/dist/edit-modes/duplicate-mode.js +1 -1
- package/dist/edit-modes/edit-mode.d.ts +2 -1
- package/dist/edit-modes/edit-mode.d.ts.map +1 -0
- package/dist/edit-modes/elevation-mode.d.ts +4 -3
- package/dist/edit-modes/elevation-mode.d.ts.map +1 -0
- package/dist/edit-modes/elevation-mode.js +2 -2
- package/dist/edit-modes/extend-line-string-mode.d.ts +4 -3
- package/dist/edit-modes/extend-line-string-mode.d.ts.map +1 -0
- package/dist/edit-modes/extend-line-string-mode.js +5 -2
- package/dist/edit-modes/extrude-mode.d.ts +4 -3
- package/dist/edit-modes/extrude-mode.d.ts.map +1 -0
- package/dist/edit-modes/extrude-mode.js +6 -3
- package/dist/edit-modes/geojson-edit-mode.d.ts +6 -5
- package/dist/edit-modes/geojson-edit-mode.d.ts.map +1 -0
- package/dist/edit-modes/geojson-edit-mode.js +9 -6
- package/dist/edit-modes/immutable-feature-collection.d.ts +2 -1
- package/dist/edit-modes/immutable-feature-collection.d.ts.map +1 -0
- package/dist/edit-modes/measure-angle-mode.d.ts +4 -3
- package/dist/edit-modes/measure-angle-mode.d.ts.map +1 -0
- package/dist/edit-modes/measure-angle-mode.js +2 -2
- package/dist/edit-modes/measure-area-mode.d.ts +4 -3
- package/dist/edit-modes/measure-area-mode.d.ts.map +1 -0
- package/dist/edit-modes/measure-area-mode.js +1 -1
- package/dist/edit-modes/measure-distance-mode.d.ts +4 -3
- package/dist/edit-modes/measure-distance-mode.d.ts.map +1 -0
- package/dist/edit-modes/measure-distance-mode.js +2 -2
- package/dist/edit-modes/modify-mode.d.ts +5 -4
- package/dist/edit-modes/modify-mode.d.ts.map +1 -0
- package/dist/edit-modes/modify-mode.js +6 -3
- package/dist/edit-modes/resize-circle-mode.d.ts +6 -5
- package/dist/edit-modes/resize-circle-mode.d.ts.map +1 -0
- package/dist/edit-modes/resize-circle-mode.js +4 -3
- package/dist/edit-modes/rotate-mode.d.ts +4 -3
- package/dist/edit-modes/rotate-mode.d.ts.map +1 -0
- package/dist/edit-modes/rotate-mode.js +5 -4
- package/dist/edit-modes/scale-mode.d.ts +4 -3
- package/dist/edit-modes/scale-mode.d.ts.map +1 -0
- package/dist/edit-modes/scale-mode.js +5 -4
- package/dist/edit-modes/snappable-mode.d.ts +4 -3
- package/dist/edit-modes/snappable-mode.d.ts.map +1 -0
- package/dist/edit-modes/snappable-mode.js +2 -2
- package/dist/edit-modes/split-polygon-mode.d.ts +4 -3
- package/dist/edit-modes/split-polygon-mode.d.ts.map +1 -0
- package/dist/edit-modes/split-polygon-mode.js +3 -3
- package/dist/edit-modes/three-click-polygon-mode.d.ts +4 -3
- package/dist/edit-modes/three-click-polygon-mode.d.ts.map +1 -0
- package/dist/edit-modes/three-click-polygon-mode.js +4 -2
- package/dist/edit-modes/transform-mode.d.ts +4 -3
- package/dist/edit-modes/transform-mode.d.ts.map +1 -0
- package/dist/edit-modes/transform-mode.js +7 -4
- package/dist/edit-modes/translate-mode.d.ts +4 -3
- package/dist/edit-modes/translate-mode.d.ts.map +1 -0
- package/dist/edit-modes/translate-mode.js +6 -5
- package/dist/edit-modes/two-click-polygon-mode.d.ts +4 -3
- package/dist/edit-modes/two-click-polygon-mode.d.ts.map +1 -0
- package/dist/edit-modes/two-click-polygon-mode.js +4 -5
- package/dist/edit-modes/types.d.ts +3 -1
- package/dist/edit-modes/types.d.ts.map +1 -0
- package/dist/edit-modes/utils.d.ts +5 -3
- package/dist/edit-modes/utils.d.ts.map +1 -0
- package/dist/edit-modes/utils.js +5 -1
- package/dist/edit-modes/view-mode.d.ts +2 -1
- package/dist/edit-modes/view-mode.d.ts.map +1 -0
- package/dist/edit-modes/view-mode.js +1 -1
- package/dist/editable-layers/editable-geojson-layer.d.ts +10 -9
- package/dist/editable-layers/editable-geojson-layer.d.ts.map +1 -0
- package/dist/editable-layers/editable-geojson-layer.js +30 -28
- package/dist/editable-layers/editable-h3-cluster-layer.d.ts +3 -2
- package/dist/editable-layers/editable-h3-cluster-layer.d.ts.map +1 -0
- package/dist/editable-layers/editable-h3-cluster-layer.js +4 -5
- package/dist/editable-layers/editable-layer.d.ts +7 -4
- package/dist/editable-layers/editable-layer.d.ts.map +1 -0
- package/dist/editable-layers/editable-layer.js +8 -4
- package/dist/editable-layers/editable-path-layer.d.ts +14 -1
- package/dist/editable-layers/editable-path-layer.d.ts.map +1 -0
- package/dist/editable-layers/editable-path-layer.js +21 -13
- package/dist/editable-layers/elevated-edit-handle-layer.d.ts +1 -0
- package/dist/editable-layers/elevated-edit-handle-layer.d.ts.map +1 -0
- package/dist/editable-layers/junction-scatterplot-layer.d.ts +6 -3
- package/dist/editable-layers/junction-scatterplot-layer.d.ts.map +1 -0
- package/dist/editable-layers/selection-layer.d.ts +3 -1
- package/dist/editable-layers/selection-layer.d.ts.map +1 -0
- package/dist/editable-layers/selection-layer.js +4 -5
- package/dist/index.cjs +127 -45
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +60 -58
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -52
- package/dist/lib/constants.d.ts +1 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/deck-renderer/deck-cache.d.ts +1 -0
- package/dist/lib/deck-renderer/deck-cache.d.ts.map +1 -0
- package/dist/lib/deck-renderer/deck-drawer.d.ts +2 -1
- package/dist/lib/deck-renderer/deck-drawer.d.ts.map +1 -0
- package/dist/lib/feature.d.ts +3 -2
- package/dist/lib/feature.d.ts.map +1 -0
- package/dist/lib/layer-mouse-event.d.ts +2 -1
- package/dist/lib/layer-mouse-event.d.ts.map +1 -0
- package/dist/lib/layers/junctions-layer.d.ts +4 -3
- package/dist/lib/layers/junctions-layer.d.ts.map +1 -0
- package/dist/lib/layers/junctions-layer.js +4 -4
- package/dist/lib/layers/segments-layer.d.ts +3 -2
- package/dist/lib/layers/segments-layer.d.ts.map +1 -0
- package/dist/lib/layers/segments-layer.js +4 -4
- package/dist/lib/layers/texts-layer.d.ts +3 -2
- package/dist/lib/layers/texts-layer.d.ts.map +1 -0
- package/dist/lib/layers/texts-layer.js +4 -4
- package/dist/lib/math.d.ts +2 -1
- package/dist/lib/math.d.ts.map +1 -0
- package/dist/lib/nebula-core.d.ts +2 -1
- package/dist/lib/nebula-core.d.ts.map +1 -0
- package/dist/lib/nebula-core.js +3 -3
- package/dist/lib/nebula-layer.d.ts +2 -1
- package/dist/lib/nebula-layer.d.ts.map +1 -0
- package/dist/lib/style.d.ts +1 -0
- package/dist/lib/style.d.ts.map +1 -0
- package/dist/mode-handlers/composite-mode-handler.d.ts +4 -3
- package/dist/mode-handlers/composite-mode-handler.d.ts.map +1 -0
- package/dist/mode-handlers/composite-mode-handler.js +1 -1
- package/dist/mode-handlers/draw-90degree-polygon-handler.d.ts +4 -3
- package/dist/mode-handlers/draw-90degree-polygon-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-90degree-polygon-handler.js +2 -2
- package/dist/mode-handlers/draw-circle-by-bounding-box-handler.d.ts +4 -3
- package/dist/mode-handlers/draw-circle-by-bounding-box-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-circle-by-bounding-box-handler.js +2 -2
- package/dist/mode-handlers/draw-circle-from-center-handler.d.ts +4 -3
- package/dist/mode-handlers/draw-circle-from-center-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-circle-from-center-handler.js +1 -1
- package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.d.ts +4 -3
- package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.js +2 -2
- package/dist/mode-handlers/draw-ellipse-using-three-points-handler.d.ts +4 -3
- package/dist/mode-handlers/draw-ellipse-using-three-points-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-ellipse-using-three-points-handler.js +2 -2
- package/dist/mode-handlers/draw-line-string-handler.d.ts +3 -2
- package/dist/mode-handlers/draw-line-string-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-line-string-handler.js +1 -1
- package/dist/mode-handlers/draw-point-handler.d.ts +3 -2
- package/dist/mode-handlers/draw-point-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-point-handler.js +1 -1
- package/dist/mode-handlers/draw-polygon-handler.d.ts +4 -3
- package/dist/mode-handlers/draw-polygon-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-polygon-handler.js +1 -1
- package/dist/mode-handlers/draw-rectangle-handler.d.ts +4 -3
- package/dist/mode-handlers/draw-rectangle-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-rectangle-handler.js +1 -1
- package/dist/mode-handlers/draw-rectangle-using-three-points-handler.d.ts +4 -3
- package/dist/mode-handlers/draw-rectangle-using-three-points-handler.d.ts.map +1 -0
- package/dist/mode-handlers/draw-rectangle-using-three-points-handler.js +2 -2
- package/dist/mode-handlers/duplicate-handler.d.ts +4 -3
- package/dist/mode-handlers/duplicate-handler.d.ts.map +1 -0
- package/dist/mode-handlers/duplicate-handler.js +1 -1
- package/dist/mode-handlers/elevation-handler.d.ts +5 -4
- package/dist/mode-handlers/elevation-handler.d.ts.map +1 -0
- package/dist/mode-handlers/elevation-handler.js +2 -2
- package/dist/mode-handlers/extrude-handler.d.ts +4 -3
- package/dist/mode-handlers/extrude-handler.d.ts.map +1 -0
- package/dist/mode-handlers/extrude-handler.js +3 -3
- package/dist/mode-handlers/mode-handler.d.ts +4 -3
- package/dist/mode-handlers/mode-handler.d.ts.map +1 -0
- package/dist/mode-handlers/mode-handler.js +1 -1
- package/dist/mode-handlers/modify-handler.d.ts +5 -4
- package/dist/mode-handlers/modify-handler.d.ts.map +1 -0
- package/dist/mode-handlers/modify-handler.js +2 -2
- package/dist/mode-handlers/rotate-handler.d.ts +4 -3
- package/dist/mode-handlers/rotate-handler.d.ts.map +1 -0
- package/dist/mode-handlers/rotate-handler.js +1 -1
- package/dist/mode-handlers/scale-handler.d.ts +4 -3
- package/dist/mode-handlers/scale-handler.d.ts.map +1 -0
- package/dist/mode-handlers/scale-handler.js +1 -1
- package/dist/mode-handlers/snappable-handler.d.ts +4 -3
- package/dist/mode-handlers/snappable-handler.d.ts.map +1 -0
- package/dist/mode-handlers/snappable-handler.js +1 -1
- package/dist/mode-handlers/split-polygon-handler.d.ts +3 -2
- package/dist/mode-handlers/split-polygon-handler.d.ts.map +1 -0
- package/dist/mode-handlers/split-polygon-handler.js +2 -2
- package/dist/mode-handlers/three-click-polygon-handler.d.ts +3 -2
- package/dist/mode-handlers/three-click-polygon-handler.d.ts.map +1 -0
- package/dist/mode-handlers/three-click-polygon-handler.js +1 -1
- package/dist/mode-handlers/translate-handler.d.ts +4 -3
- package/dist/mode-handlers/translate-handler.d.ts.map +1 -0
- package/dist/mode-handlers/translate-handler.js +1 -1
- package/dist/mode-handlers/two-click-polygon-handler.d.ts +3 -2
- package/dist/mode-handlers/two-click-polygon-handler.d.ts.map +1 -0
- package/dist/mode-handlers/two-click-polygon-handler.js +1 -1
- package/dist/mode-handlers/view-handler.d.ts +3 -2
- package/dist/mode-handlers/view-handler.d.ts.map +1 -0
- package/dist/mode-handlers/view-handler.js +1 -1
- package/dist/shaderlib/color/color.d.ts +13 -2
- package/dist/shaderlib/color/color.d.ts.map +1 -0
- package/dist/shaderlib/color/color.js +25 -18
- package/dist/shaderlib/utils/utils.d.ts +1 -0
- package/dist/shaderlib/utils/utils.d.ts.map +1 -0
- package/dist/utils/curve-utils.d.ts +1 -0
- package/dist/utils/curve-utils.d.ts.map +1 -0
- package/dist/utils/geojson-types.d.ts +1 -0
- package/dist/utils/geojson-types.d.ts.map +1 -0
- package/dist/utils/memoize.d.ts +1 -0
- package/dist/utils/memoize.d.ts.map +1 -0
- package/dist/utils/translate-from-center.d.ts +1 -0
- package/dist/utils/translate-from-center.d.ts.map +1 -0
- package/dist/utils/translate-from-center.js +4 -4
- package/dist/utils/types.d.ts +1 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/utils.d.ts +5 -4
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +4 -4
- package/package.json +11 -10
- package/src/edit-modes/delete-mode.ts +28 -0
- package/src/edit-modes/draw-circle-by-diameter-mode.ts +4 -0
- package/src/edit-modes/draw-circle-from-center-mode.ts +4 -0
- package/src/edit-modes/draw-ellipse-by-bounding-box-mode.ts +10 -1
- package/src/edit-modes/draw-ellipse-using-three-points-mode.ts +11 -1
- package/src/edit-modes/extend-line-string-mode.ts +4 -0
- package/src/edit-modes/extrude-mode.ts +6 -1
- package/src/edit-modes/geojson-edit-mode.ts +9 -4
- package/src/edit-modes/measure-distance-mode.ts +1 -1
- package/src/edit-modes/modify-mode.ts +6 -1
- package/src/edit-modes/resize-circle-mode.ts +1 -0
- package/src/edit-modes/rotate-mode.ts +2 -1
- package/src/edit-modes/scale-mode.ts +2 -1
- package/src/edit-modes/split-polygon-mode.ts +4 -2
- package/src/edit-modes/three-click-polygon-mode.ts +7 -1
- package/src/edit-modes/transform-mode.ts +4 -0
- package/src/edit-modes/translate-mode.ts +4 -2
- package/src/edit-modes/two-click-polygon-mode.ts +3 -4
- package/src/edit-modes/types.ts +1 -0
- package/src/edit-modes/utils.ts +10 -3
- package/src/editable-layers/editable-geojson-layer.ts +6 -4
- package/src/editable-layers/editable-h3-cluster-layer.ts +1 -1
- package/src/editable-layers/editable-layer.ts +12 -4
- package/src/editable-layers/editable-path-layer.ts +29 -15
- package/src/editable-layers/junction-scatterplot-layer.ts +4 -2
- package/src/editable-layers/selection-layer.ts +2 -1
- package/src/index.ts +2 -0
- package/src/mode-handlers/split-polygon-handler.ts +2 -1
- package/src/shaderlib/color/color.ts +34 -20
- package/src/utils/translate-from-center.ts +5 -5
- package/src/utils/utils.ts +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModeProps, PointerMoveEvent, StopDraggingEvent } from
|
|
2
|
-
import { Position, FeatureCollection } from
|
|
3
|
-
import { ModifyMode } from
|
|
1
|
+
import { ModeProps, PointerMoveEvent, StopDraggingEvent } from "./types.js";
|
|
2
|
+
import { Position, FeatureCollection } from "../utils/geojson-types.js";
|
|
3
|
+
import { ModifyMode } from "./modify-mode.js";
|
|
4
4
|
export declare class ElevationMode extends ModifyMode {
|
|
5
5
|
makeElevatedEvent(event: PointerMoveEvent | StopDraggingEvent, position: Position, props: ModeProps<FeatureCollection>): Record<string, any>;
|
|
6
6
|
handlePointerMove(event: PointerMoveEvent, props: ModeProps<FeatureCollection>): void;
|
|
@@ -11,3 +11,4 @@ export declare class ElevationMode extends ModifyMode {
|
|
|
11
11
|
screenCoords: Position;
|
|
12
12
|
}): number;
|
|
13
13
|
}
|
|
14
|
+
//# sourceMappingURL=elevation-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevation-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/elevation-mode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAC,mBAAgB;AACvE,OAAO,EAAC,QAAQ,EAAE,iBAAiB,EAAC,kCAA+B;AAEnE,OAAO,EAAC,UAAU,EAAC,yBAAsB;AAYzC,qBAAa,aAAc,SAAQ,UAAU;IAC3C,iBAAiB,CACf,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,EAC3C,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IA2BtB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAO9E,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAOhF,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;IAQ7D,MAAM,CAAC,oCAAoC,CACzC,QAAQ,EAAE,GAAG,EACb,EACE,uBAAuB,EACvB,YAAY,EACb,EAAE;QACD,uBAAuB,EAAE,QAAQ,CAAC;QAClC,YAAY,EAAE,QAAQ,CAAC;KACxB,GACA,MAAM;CAOV"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { getPickedEditHandle } from
|
|
5
|
-
import { ModifyMode } from
|
|
4
|
+
import { getPickedEditHandle } from "./utils.js";
|
|
5
|
+
import { ModifyMode } from "./modify-mode.js";
|
|
6
6
|
function defaultCalculateElevationChange({ pointerDownScreenCoords, screenCoords }) {
|
|
7
7
|
return 10 * (pointerDownScreenCoords[1] - screenCoords[1]);
|
|
8
8
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { LineString, FeatureCollection } from
|
|
2
|
-
import { ClickEvent, PointerMoveEvent, ModeProps, GuideFeatureCollection } from
|
|
3
|
-
import { GeoJsonEditMode } from
|
|
1
|
+
import { LineString, FeatureCollection } from "../utils/geojson-types.js";
|
|
2
|
+
import { ClickEvent, PointerMoveEvent, ModeProps, GuideFeatureCollection } from "./types.js";
|
|
3
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
4
4
|
export declare class ExtendLineStringMode extends GeoJsonEditMode {
|
|
5
5
|
getSingleSelectedLineString(props: ModeProps<FeatureCollection>): LineString | null | undefined;
|
|
6
6
|
handleClick(event: ClickEvent, props: ModeProps<FeatureCollection>): void;
|
|
7
7
|
getGuides(props: ModeProps<FeatureCollection>): GuideFeatureCollection;
|
|
8
8
|
handlePointerMove(event: PointerMoveEvent, props: ModeProps<FeatureCollection>): void;
|
|
9
9
|
}
|
|
10
|
+
//# sourceMappingURL=extend-line-string-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend-line-string-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/extend-line-string-mode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAW,UAAU,EAAE,iBAAiB,EAAC,kCAA+B;AAC/E,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,sBAAsB,EAAC,mBAAgB;AACxF,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAGpD,qBAAa,oBAAqB,SAAQ,eAAe;IACvD,2BAA2B,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS;IAS/F,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAgClE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IAwCtE,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;CAG/E"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { GeoJsonEditMode } from
|
|
5
|
-
import { ImmutableFeatureCollection } from
|
|
4
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
5
|
+
import { ImmutableFeatureCollection } from "./immutable-feature-collection.js";
|
|
6
6
|
export class ExtendLineStringMode extends GeoJsonEditMode {
|
|
7
7
|
getSingleSelectedLineString(props) {
|
|
8
8
|
const selectedGeometry = this.getSelectedGeometry(props);
|
|
@@ -48,6 +48,9 @@ export class ExtendLineStringMode extends GeoJsonEditMode {
|
|
|
48
48
|
return guides;
|
|
49
49
|
}
|
|
50
50
|
const mapCoords = props.lastPointerMoveEvent && props.lastPointerMoveEvent.mapCoords;
|
|
51
|
+
if (!mapCoords) {
|
|
52
|
+
return guides;
|
|
53
|
+
}
|
|
51
54
|
// Draw an extension line starting from one end of the selected LineString to the cursor
|
|
52
55
|
let startPosition = null;
|
|
53
56
|
const { modeConfig } = props;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FeatureCollection } from
|
|
2
|
-
import { ModeProps, StartDraggingEvent, StopDraggingEvent, DraggingEvent } from
|
|
3
|
-
import { ModifyMode } from
|
|
1
|
+
import { FeatureCollection } from "../utils/geojson-types.js";
|
|
2
|
+
import { ModeProps, StartDraggingEvent, StopDraggingEvent, DraggingEvent } from "./types.js";
|
|
3
|
+
import { ModifyMode } from "./modify-mode.js";
|
|
4
4
|
export declare class ExtrudeMode extends ModifyMode {
|
|
5
5
|
isPointAdded: boolean;
|
|
6
6
|
handleDragging(event: DraggingEvent, props: ModeProps<FeatureCollection>): void;
|
|
@@ -13,3 +13,4 @@ export declare class ExtrudeMode extends ModifyMode {
|
|
|
13
13
|
prevPositionIndexes(positionIndexes: number[] | null | undefined, size: number): number[];
|
|
14
14
|
getPointForPositionIndexes(positionIndexes: number[] | null | undefined, featureIndex: number, { features }: FeatureCollection): any;
|
|
15
15
|
}
|
|
16
|
+
//# sourceMappingURL=extrude-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extrude-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/extrude-mode.ts"],"names":[],"mappings":"AAWA,OAAO,EAAC,iBAAiB,EAAC,kCAA+B;AACzD,OAAO,EAAC,SAAS,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,EAAC,mBAAgB;AACxF,OAAO,EAAC,UAAU,EAAC,yBAAsB;AAGzC,qBAAa,WAAY,SAAQ,UAAU;IAGzC,YAAY,UAAS;IAErB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IA0C/E,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAkDlF,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IA0ChF,eAAe,CACb,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAC5C,YAAY,EAAE,MAAM,EACpB,EAAC,QAAQ,EAAC,EAAE,iBAAiB;IAsB/B,UAAU,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG;IAQ3B,YAAY,CACV,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAC5C,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,iBAAiB;IAwB7B,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAWzF,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAWzF,0BAA0B,CACxB,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAC5C,YAAY,EAAE,MAAM,EACpB,EAAC,QAAQ,EAAC,EAAE,iBAAiB;CAqBhC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import bearing from '@turf/bearing';
|
|
5
|
-
import { generatePointsParallelToLinePoints, getPickedEditHandle, getPickedIntermediateEditHandle } from
|
|
6
|
-
import { ModifyMode } from
|
|
7
|
-
import { ImmutableFeatureCollection } from
|
|
5
|
+
import { generatePointsParallelToLinePoints, getPickedEditHandle, getPickedIntermediateEditHandle, shouldCancelPan } from "./utils.js";
|
|
6
|
+
import { ModifyMode } from "./modify-mode.js";
|
|
7
|
+
import { ImmutableFeatureCollection } from "./immutable-feature-collection.js";
|
|
8
8
|
export class ExtrudeMode extends ModifyMode {
|
|
9
9
|
// this mode is busted =(
|
|
10
10
|
isPointAdded = false;
|
|
@@ -41,6 +41,9 @@ export class ExtrudeMode extends ModifyMode {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
handleStartDragging(event, props) {
|
|
44
|
+
if (shouldCancelPan(event)) {
|
|
45
|
+
event.cancelPan();
|
|
46
|
+
}
|
|
44
47
|
const selectedFeatureIndexes = props.selectedIndexes;
|
|
45
48
|
const editHandle = getPickedIntermediateEditHandle(event.picks);
|
|
46
49
|
if (selectedFeatureIndexes.length && editHandle) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EditAction, ClickEvent, PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, Pick, Tooltip, ModeProps, GuideFeatureCollection, TentativeFeature } from
|
|
2
|
-
import { FeatureCollection, Feature, Polygon, Geometry, Position } from
|
|
3
|
-
import { EditMode } from
|
|
1
|
+
import { EditAction, ClickEvent, PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, Pick, Tooltip, ModeProps, GuideFeatureCollection, TentativeFeature } from "./types.js";
|
|
2
|
+
import { FeatureCollection, Feature, Polygon, Geometry, Position } from "../utils/geojson-types.js";
|
|
3
|
+
import { EditMode } from "./edit-mode.js";
|
|
4
4
|
export type GeoJsonEditAction = EditAction<FeatureCollection>;
|
|
5
5
|
export type GeoJsonEditModeType = EditMode<FeatureCollection, FeatureCollection>;
|
|
6
6
|
export interface GeoJsonEditModeConstructor {
|
|
@@ -19,9 +19,9 @@ export declare class GeoJsonEditMode implements EditMode<FeatureCollection, Guid
|
|
|
19
19
|
getTentativeGuide(props: ModeProps<FeatureCollection>): TentativeFeature | null | undefined;
|
|
20
20
|
isSelectionPicked(picks: Pick[], props: ModeProps<FeatureCollection>): boolean;
|
|
21
21
|
rewindPolygon(feature: Feature): Feature;
|
|
22
|
-
getAddFeatureAction(featureOrGeometry: Geometry | Feature, features: FeatureCollection): GeoJsonEditAction;
|
|
22
|
+
getAddFeatureAction(featureOrGeometry: Geometry | Feature, features: FeatureCollection, featureProperties?: {}): GeoJsonEditAction;
|
|
23
23
|
getAddManyFeaturesAction({ features: featuresToAdd }: FeatureCollection, features: FeatureCollection): GeoJsonEditAction;
|
|
24
|
-
getAddFeatureOrBooleanPolygonAction(featureOrGeometry: Polygon | Feature, props: ModeProps<FeatureCollection
|
|
24
|
+
getAddFeatureOrBooleanPolygonAction(featureOrGeometry: Polygon | Feature, props: ModeProps<FeatureCollection>, featureProperties?: {}): GeoJsonEditAction | null | undefined;
|
|
25
25
|
createTentativeFeature(props: ModeProps<FeatureCollection>): TentativeFeature | null;
|
|
26
26
|
handleClick(event: ClickEvent, props: ModeProps<FeatureCollection>): void;
|
|
27
27
|
handlePointerMove(event: PointerMoveEvent, props: ModeProps<FeatureCollection>): void;
|
|
@@ -31,3 +31,4 @@ export declare class GeoJsonEditMode implements EditMode<FeatureCollection, Guid
|
|
|
31
31
|
handleKeyUp(event: KeyboardEvent, props: ModeProps<FeatureCollection>): void;
|
|
32
32
|
}
|
|
33
33
|
export declare function getIntermediatePosition(position1: Position, position2: Position): Position;
|
|
34
|
+
//# sourceMappingURL=geojson-edit-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geojson-edit-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/geojson-edit-mode.ts"],"names":[],"mappings":"AASA,OAAO,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,IAAI,EACJ,OAAO,EACP,SAAS,EACT,sBAAsB,EACtB,gBAAgB,EACjB,mBAAgB;AACjB,OAAO,EAAC,iBAAiB,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,kCAA+B;AAE/F,OAAO,EAAC,QAAQ,EAAC,uBAAoB;AAGrC,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAS9D,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;AAEjF,MAAM,WAAW,0BAA0B;IACzC,QAAQ,mBAAmB,CAAC;CAC7B;AAED,qBAAa,eAAgB,YAAW,QAAQ,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IACzF,cAAc,EAAE,QAAQ,EAAE,CAAM;IAEhC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IAItE,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,OAAO,EAAE;IAI3D,kBAAkB,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS;IAOnF,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS;IAQrF,sCAAsC,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,iBAAiB;IAS9F,gBAAgB,IAAI,QAAQ,EAAE;IAI9B,gBAAgB,CAAC,EAAC,SAAS,EAAC,EAAE,UAAU,GAAG,IAAI;IAI/C,kBAAkB,IAAI,IAAI;IAI1B,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,gBAAgB,GAAG,IAAI,GAAG,SAAS;IAO3F,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,OAAO;IAU9E,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;IAYxC,mBAAmB,CACjB,iBAAiB,EAAE,QAAQ,GAAG,OAAO,EACrC,QAAQ,EAAE,iBAAiB,EAC3B,iBAAiB,CAAC,EAAE,EAAE,GACrB,iBAAiB;IA4BpB,wBAAwB,CACtB,EAAC,QAAQ,EAAE,aAAa,EAAC,EAAE,iBAAiB,EAC5C,QAAQ,EAAE,iBAAiB,GAC1B,iBAAiB;IAyBpB,mCAAmC,CACjC,iBAAiB,EAAE,OAAO,GAAG,OAAO,EACpC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,EACnC,iBAAiB,CAAC,EAAE,EAAE,GACrB,iBAAiB,GAAG,IAAI,GAAG,SAAS;IAoEvC,sBAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,gBAAgB,GAAG,IAAI;IAIpF,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IACzE,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAYrF,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IACzF,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IACvF,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAE/E,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;CAW7E;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAO1F"}
|
|
@@ -5,8 +5,8 @@ import turfUnion from '@turf/union';
|
|
|
5
5
|
import turfDifference from '@turf/difference';
|
|
6
6
|
import turfIntersect from '@turf/intersect';
|
|
7
7
|
import rewind from '@turf/rewind';
|
|
8
|
-
import { getPickedEditHandles, getNonGuidePicks } from
|
|
9
|
-
import { ImmutableFeatureCollection } from
|
|
8
|
+
import { getPickedEditHandles, getNonGuidePicks } from "./utils.js";
|
|
9
|
+
import { ImmutableFeatureCollection } from "./immutable-feature-collection.js";
|
|
10
10
|
const DEFAULT_GUIDES = {
|
|
11
11
|
type: 'FeatureCollection',
|
|
12
12
|
features: []
|
|
@@ -71,14 +71,15 @@ export class GeoJsonEditMode {
|
|
|
71
71
|
}
|
|
72
72
|
return feature;
|
|
73
73
|
}
|
|
74
|
-
getAddFeatureAction(featureOrGeometry, features) {
|
|
74
|
+
getAddFeatureAction(featureOrGeometry, features, featureProperties) {
|
|
75
75
|
// Unsure why flow can't deal with Geometry type, but there I fixed it
|
|
76
76
|
const featureOrGeometryAsAny = featureOrGeometry;
|
|
77
|
+
featureProperties = featureProperties || {};
|
|
77
78
|
const feature = featureOrGeometryAsAny.type === 'Feature'
|
|
78
79
|
? featureOrGeometryAsAny
|
|
79
80
|
: {
|
|
80
81
|
type: 'Feature',
|
|
81
|
-
properties:
|
|
82
|
+
properties: featureProperties,
|
|
82
83
|
geometry: featureOrGeometryAsAny
|
|
83
84
|
};
|
|
84
85
|
const rewindFeature = this.rewindPolygon(feature);
|
|
@@ -115,8 +116,10 @@ export class GeoJsonEditMode {
|
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
|
-
|
|
119
|
+
// eslint-disable-next-line complexity
|
|
120
|
+
getAddFeatureOrBooleanPolygonAction(featureOrGeometry, props, featureProperties) {
|
|
119
121
|
const featureOrGeometryAsAny = featureOrGeometry;
|
|
122
|
+
featureProperties = featureProperties || {};
|
|
120
123
|
const selectedFeature = this.getSelectedFeature(props);
|
|
121
124
|
const { modeConfig } = props;
|
|
122
125
|
if (modeConfig && modeConfig.booleanOperation) {
|
|
@@ -169,7 +172,7 @@ export class GeoJsonEditMode {
|
|
|
169
172
|
};
|
|
170
173
|
return editAction;
|
|
171
174
|
}
|
|
172
|
-
return this.getAddFeatureAction(featureOrGeometry, props.data);
|
|
175
|
+
return this.getAddFeatureAction(featureOrGeometry, props.data, featureProperties);
|
|
173
176
|
}
|
|
174
177
|
createTentativeFeature(props) {
|
|
175
178
|
return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Feature, FeatureCollection, Geometry, Position } from
|
|
1
|
+
import { Feature, FeatureCollection, Geometry, Position } from "../utils/geojson-types.js";
|
|
2
2
|
export declare class ImmutableFeatureCollection {
|
|
3
3
|
featureCollection: FeatureCollection;
|
|
4
4
|
constructor(featureCollection: FeatureCollection);
|
|
@@ -42,3 +42,4 @@ export declare class ImmutableFeatureCollection {
|
|
|
42
42
|
deleteFeature(featureIndex: number): ImmutableFeatureCollection;
|
|
43
43
|
deleteFeatures(featureIndexes: number[]): ImmutableFeatureCollection;
|
|
44
44
|
}
|
|
45
|
+
//# sourceMappingURL=immutable-feature-collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"immutable-feature-collection.d.ts","sourceRoot":"","sources":["../../src/edit-modes/immutable-feature-collection.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,QAAQ,EAIR,QAAQ,EAET,kCAA+B;AAEhC,qBAAa,0BAA0B;IACrC,iBAAiB,EAAE,iBAAiB,CAAC;gBAEzB,iBAAiB,EAAE,iBAAiB;IAIhD,SAAS;IAIT;;;;;;;;;OASG;IACH,eAAe,CACb,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAC5C,eAAe,EAAE,QAAQ,GACxB,0BAA0B;IAiB7B;;;;;;;;;OASG;IAEH,cAAc,CACZ,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,GAC3C,0BAA0B;IA0D7B;;;;;;;;;OASG;IACH,WAAW,CACT,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAC5C,aAAa,EAAE,QAAQ,GACtB,0BAA0B;IAqB7B,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,0BAA0B;IAkBrF,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,0BAA0B;IAIxD,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,0BAA0B;IAS5D,aAAa,CAAC,YAAY,EAAE,MAAM;IAIlC,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE;CAiBxC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ClickEvent, PointerMoveEvent, Tooltip, ModeProps, GuideFeatureCollection } from
|
|
2
|
-
import { FeatureCollection, Position } from
|
|
3
|
-
import { GeoJsonEditMode } from
|
|
1
|
+
import { ClickEvent, PointerMoveEvent, Tooltip, ModeProps, GuideFeatureCollection } from "./types.js";
|
|
2
|
+
import { FeatureCollection, Position } from "../utils/geojson-types.js";
|
|
3
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
4
4
|
export declare class MeasureAngleMode extends GeoJsonEditMode {
|
|
5
5
|
_getTooltips: (args: any) => any;
|
|
6
6
|
handleClick(event: ClickEvent, props: ModeProps<FeatureCollection>): void;
|
|
@@ -9,3 +9,4 @@ export declare class MeasureAngleMode extends GeoJsonEditMode {
|
|
|
9
9
|
getGuides(props: ModeProps<FeatureCollection>): GuideFeatureCollection;
|
|
10
10
|
getTooltips(props: ModeProps<FeatureCollection>): Tooltip[];
|
|
11
11
|
}
|
|
12
|
+
//# sourceMappingURL=measure-angle-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measure-angle-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/measure-angle-mode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAC,mBAAgB;AACjG,OAAO,EAAC,iBAAiB,EAAE,QAAQ,EAAC,kCAA+B;AACnE,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAIpD,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,YAAY,qBAuDV;IAEF,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IASzE,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAIrF,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,QAAQ,EAAE;IAa1D,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IA6BtE,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,OAAO,EAAE;CAU5D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import turfBearing from '@turf/bearing';
|
|
2
2
|
import turfCenter from '@turf/center';
|
|
3
|
-
import { memoize } from
|
|
4
|
-
import { GeoJsonEditMode } from
|
|
3
|
+
import { memoize } from "../utils/memoize.js";
|
|
4
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
5
5
|
const DEFAULT_TOOLTIPS = [];
|
|
6
6
|
export class MeasureAngleMode extends GeoJsonEditMode {
|
|
7
7
|
_getTooltips = memoize(({ modeConfig, vertex, point1, point2 }) => {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ClickEvent, Tooltip, ModeProps } from
|
|
2
|
-
import { FeatureCollection } from
|
|
3
|
-
import { DrawPolygonMode } from
|
|
1
|
+
import { ClickEvent, Tooltip, ModeProps } from "./types.js";
|
|
2
|
+
import { FeatureCollection } from "../utils/geojson-types.js";
|
|
3
|
+
import { DrawPolygonMode } from "./draw-polygon-mode.js";
|
|
4
4
|
export declare class MeasureAreaMode extends DrawPolygonMode {
|
|
5
5
|
handleClick(event: ClickEvent, props: ModeProps<FeatureCollection>): void;
|
|
6
6
|
handleKeyUp(event: KeyboardEvent, props: ModeProps<FeatureCollection>): void;
|
|
7
7
|
getTooltips(props: ModeProps<FeatureCollection>): Tooltip[];
|
|
8
8
|
}
|
|
9
|
+
//# sourceMappingURL=measure-area-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measure-area-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/measure-area-mode.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAC,mBAAgB;AACvD,OAAO,EAAC,iBAAiB,EAAC,kCAA+B;AACzD,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAIpD,qBAAa,eAAgB,SAAQ,eAAe;IAClD,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IASlE,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAS5E,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,OAAO,EAAE;CAiC5D"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import turfArea from '@turf/area';
|
|
5
5
|
import turfCentroid from '@turf/centroid';
|
|
6
|
-
import { DrawPolygonMode } from
|
|
6
|
+
import { DrawPolygonMode } from "./draw-polygon-mode.js";
|
|
7
7
|
const DEFAULT_TOOLTIPS = [];
|
|
8
8
|
export class MeasureAreaMode extends DrawPolygonMode {
|
|
9
9
|
handleClick(event, props) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FeatureCollection } from
|
|
2
|
-
import { ClickEvent, PointerMoveEvent, ModeProps, GuideFeatureCollection, Tooltip } from
|
|
3
|
-
import { GeoJsonEditMode } from
|
|
1
|
+
import { FeatureCollection } from "../utils/geojson-types.js";
|
|
2
|
+
import { ClickEvent, PointerMoveEvent, ModeProps, GuideFeatureCollection, Tooltip } from "./types.js";
|
|
3
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
4
4
|
export declare class MeasureDistanceMode extends GeoJsonEditMode {
|
|
5
5
|
_isMeasuringSessionFinished: boolean;
|
|
6
6
|
_currentTooltips: Tooltip[];
|
|
@@ -17,3 +17,4 @@ export declare class MeasureDistanceMode extends GeoJsonEditMode {
|
|
|
17
17
|
handlePointerMove(event: PointerMoveEvent, props: ModeProps<FeatureCollection>): void;
|
|
18
18
|
getTooltips(props: ModeProps<FeatureCollection>): Tooltip[];
|
|
19
19
|
}
|
|
20
|
+
//# sourceMappingURL=measure-distance-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measure-distance-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/measure-distance-mode.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,iBAAiB,EAAC,kCAA+B;AACzD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,OAAO,EAER,mBAAgB;AAEjB,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAEpD,qBAAa,mBAAoB,SAAQ,eAAe;IACtD,2BAA2B,UAAS;IACpC,gBAAgB,EAAE,OAAO,EAAE,CAAM;IACjC,gBAAgB,SAAK;IAErB,4BAA4B;;;;iBAS1B;IAEF,cAAc,CAAC,QAAQ,KAAA,EAAE,UAAU,CAAC,KAAA;IAepC,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAgElE,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IA2BrE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IA8CtE,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAI9E,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,OAAO,EAAE;CA4B5D"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import turfDistance from '@turf/distance';
|
|
5
5
|
import turfMidpoint from '@turf/midpoint';
|
|
6
|
-
import { getPickedEditHandle } from
|
|
7
|
-
import { GeoJsonEditMode } from
|
|
6
|
+
import { getPickedEditHandle } from "./utils.js";
|
|
7
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
8
8
|
export class MeasureDistanceMode extends GeoJsonEditMode {
|
|
9
9
|
_isMeasuringSessionFinished = false;
|
|
10
10
|
_currentTooltips = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NearestPointType } from
|
|
2
|
-
import { LineString, Point, FeatureCollection, FeatureOf } from
|
|
3
|
-
import { ModeProps, ClickEvent, PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, Viewport, GuideFeatureCollection, EditHandleFeature } from
|
|
4
|
-
import { GeoJsonEditMode } from
|
|
1
|
+
import { NearestPointType } from "./utils.js";
|
|
2
|
+
import { LineString, Point, FeatureCollection, FeatureOf } from "../utils/geojson-types.js";
|
|
3
|
+
import { ModeProps, ClickEvent, PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, Viewport, GuideFeatureCollection, EditHandleFeature } from "./types.js";
|
|
4
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
5
5
|
export declare class ModifyMode extends GeoJsonEditMode {
|
|
6
6
|
getGuides(props: ModeProps<FeatureCollection>): GuideFeatureCollection;
|
|
7
7
|
getNearestPoint(line: FeatureOf<LineString>, inPoint: FeatureOf<Point>, viewport: Viewport | null | undefined): NearestPointType;
|
|
@@ -13,3 +13,4 @@ export declare class ModifyMode extends GeoJsonEditMode {
|
|
|
13
13
|
handleStopDragging(event: StopDraggingEvent, props: ModeProps<FeatureCollection>): void;
|
|
14
14
|
getCursor(event: PointerMoveEvent): string | null | undefined;
|
|
15
15
|
}
|
|
16
|
+
//# sourceMappingURL=modify-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modify-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/modify-mode.ts"],"names":[],"mappings":"AAKA,OAAO,EAUL,gBAAgB,EAEjB,mBAAgB;AACjB,OAAO,EAAC,UAAU,EAAE,KAAK,EAAW,iBAAiB,EAAE,SAAS,EAAC,kCAA+B;AAChG,OAAO,EACL,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,QAAQ,EACR,sBAAsB,EACtB,iBAAiB,EAElB,mBAAgB;AACjB,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAGpD,qBAAa,UAAW,SAAQ,eAAe;IAE7C,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IAsFtE,eAAe,CACb,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,EAC3B,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,EACzB,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GACpC,gBAAgB;IAenB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAuDlE,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAW/E,eAAe,CACb,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,EACnC,UAAU,EAAE,iBAAiB,EAC7B,KAAK,EAAE,iBAAiB,GAAG,aAAa;IAqC1C,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAKrF,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IA+BlF,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAQhF,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;CAS9D"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { point, lineString as toLineString } from '@turf/helpers';
|
|
5
|
-
import { recursivelyTraverseNestedArrays, nearestPointOnProjectedLine, nearestPointOnLine, getEditHandlesForGeometry, getPickedEditHandles, getPickedEditHandle, getPickedExistingEditHandle, getPickedIntermediateEditHandle, updateRectanglePosition } from
|
|
6
|
-
import { GeoJsonEditMode } from
|
|
7
|
-
import { ImmutableFeatureCollection } from
|
|
5
|
+
import { recursivelyTraverseNestedArrays, nearestPointOnProjectedLine, nearestPointOnLine, getEditHandlesForGeometry, getPickedEditHandles, getPickedEditHandle, getPickedExistingEditHandle, getPickedIntermediateEditHandle, updateRectanglePosition, shouldCancelPan } from "./utils.js";
|
|
6
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
7
|
+
import { ImmutableFeatureCollection } from "./immutable-feature-collection.js";
|
|
8
8
|
export class ModifyMode extends GeoJsonEditMode {
|
|
9
9
|
// eslint-disable-next-line complexity
|
|
10
10
|
getGuides(props) {
|
|
@@ -170,6 +170,9 @@ export class ModifyMode extends GeoJsonEditMode {
|
|
|
170
170
|
props.onUpdateCursor(cursor);
|
|
171
171
|
}
|
|
172
172
|
handleStartDragging(event, props) {
|
|
173
|
+
if (shouldCancelPan(event)) {
|
|
174
|
+
event.cancelPan();
|
|
175
|
+
}
|
|
173
176
|
const selectedFeatureIndexes = props.selectedIndexes;
|
|
174
177
|
const editHandle = getPickedIntermediateEditHandle(event.picks);
|
|
175
178
|
if (selectedFeatureIndexes.length && editHandle) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { NearestPointType } from
|
|
2
|
-
import { LineString, Point, FeatureCollection, FeatureOf } from
|
|
3
|
-
import { Viewport } from
|
|
4
|
-
import { ModeProps, PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, EditHandleFeature, GuideFeatureCollection } from
|
|
5
|
-
import { GeoJsonEditMode } from
|
|
1
|
+
import { NearestPointType } from "./utils.js";
|
|
2
|
+
import { LineString, Point, FeatureCollection, FeatureOf } from "../utils/geojson-types.js";
|
|
3
|
+
import { Viewport } from "../utils/types.js";
|
|
4
|
+
import { ModeProps, PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, EditHandleFeature, GuideFeatureCollection } from "./types.js";
|
|
5
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
6
6
|
export declare class ResizeCircleMode extends GeoJsonEditMode {
|
|
7
7
|
_selectedEditHandle: EditHandleFeature | null | undefined;
|
|
8
8
|
_isResizing: boolean;
|
|
@@ -14,3 +14,4 @@ export declare class ResizeCircleMode extends GeoJsonEditMode {
|
|
|
14
14
|
handleStopDragging(event: StopDraggingEvent, props: ModeProps<FeatureCollection>): void;
|
|
15
15
|
getCursor(event: PointerMoveEvent): string | null | undefined;
|
|
16
16
|
}
|
|
17
|
+
//# sourceMappingURL=resize-circle-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-circle-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/resize-circle-mode.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,gBAAgB,EACjB,mBAAgB;AACjB,OAAO,EAAC,UAAU,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAC,kCAA+B;AACvF,OAAO,EAAC,QAAQ,EAAC,0BAAuB;AACxC,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EAEvB,mBAAgB;AACjB,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAGpD,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,mBAAmB,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1D,WAAW,UAAS;IAGpB,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IA+EtE,eAAe,CACb,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,EAC3B,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,EACzB,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GACpC,gBAAgB;IAgBnB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAkC/E,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAarF,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAOlF,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAOhF,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;CAS9D"}
|
|
@@ -6,9 +6,9 @@ import { point, lineString as toLineString } from '@turf/helpers';
|
|
|
6
6
|
import circle from '@turf/circle';
|
|
7
7
|
import distance from '@turf/distance';
|
|
8
8
|
import turfCenter from '@turf/center';
|
|
9
|
-
import { recursivelyTraverseNestedArrays, nearestPointOnProjectedLine, getPickedEditHandles, getPickedEditHandle } from
|
|
10
|
-
import { GeoJsonEditMode } from
|
|
11
|
-
import { ImmutableFeatureCollection } from
|
|
9
|
+
import { recursivelyTraverseNestedArrays, nearestPointOnProjectedLine, getPickedEditHandles, getPickedEditHandle } from "./utils.js";
|
|
10
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
11
|
+
import { ImmutableFeatureCollection } from "./immutable-feature-collection.js";
|
|
12
12
|
export class ResizeCircleMode extends GeoJsonEditMode {
|
|
13
13
|
_selectedEditHandle;
|
|
14
14
|
_isResizing = false;
|
|
@@ -124,6 +124,7 @@ export class ResizeCircleMode extends GeoJsonEditMode {
|
|
|
124
124
|
}
|
|
125
125
|
handleStartDragging(event, props) {
|
|
126
126
|
if (this._selectedEditHandle) {
|
|
127
|
+
event.cancelPan();
|
|
127
128
|
this._isResizing = true;
|
|
128
129
|
}
|
|
129
130
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, ModeProps, EditHandleFeature, GuideFeatureCollection } from
|
|
2
|
-
import { FeatureCollection, Position } from
|
|
3
|
-
import { GeoJsonEditMode, GeoJsonEditAction } from
|
|
1
|
+
import { PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, ModeProps, EditHandleFeature, GuideFeatureCollection } from "./types.js";
|
|
2
|
+
import { FeatureCollection, Position } from "../utils/geojson-types.js";
|
|
3
|
+
import { GeoJsonEditMode, GeoJsonEditAction } from "./geojson-edit-mode.js";
|
|
4
4
|
export declare class RotateMode extends GeoJsonEditMode {
|
|
5
5
|
_selectedEditHandle: EditHandleFeature | null | undefined;
|
|
6
6
|
_geometryBeingRotated: FeatureCollection | null | undefined;
|
|
@@ -15,3 +15,4 @@ export declare class RotateMode extends GeoJsonEditMode {
|
|
|
15
15
|
updateCursor(props: ModeProps<FeatureCollection>): void;
|
|
16
16
|
getRotateAction(startDragPoint: Position, currentPoint: Position, editType: string, props: ModeProps<FeatureCollection>): GeoJsonEditAction | null | undefined;
|
|
17
17
|
}
|
|
18
|
+
//# sourceMappingURL=rotate-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rotate-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/rotate-mode.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,sBAAsB,EACvB,mBAAgB;AAEjB,OAAO,EAAC,iBAAiB,EAAE,QAAQ,EAAC,kCAA+B;AACnE,OAAO,EAAC,eAAe,EAAE,iBAAiB,EAA0B,+BAA4B;AAGhG,qBAAa,UAAW,SAAQ,eAAe;IAC7C,mBAAmB,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1D,qBAAqB,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC5D,WAAW,UAAS;IAEpB,8BAA8B,aAAc,iBAAiB,GAAG,IAAI,GAAG,SAAS,KAAG,OAAO,CAQxF;IAEF,aAAa,gBAA0B;IAEvC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IAqDtE,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAkBxE,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAY9E,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAQlF,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAoBhF,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAShD,eAAe,CACb,cAAc,EAAE,QAAQ,EACxB,YAAY,EAAE,QAAQ,EACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAClC,iBAAiB,GAAG,IAAI,GAAG,SAAS;CAoCxC"}
|
|
@@ -10,10 +10,10 @@ import { coordEach } from '@turf/meta';
|
|
|
10
10
|
import { getGeom } from '@turf/invariant';
|
|
11
11
|
import { point, featureCollection, lineString } from '@turf/helpers';
|
|
12
12
|
import turfTransformRotate from '@turf/transform-rotate';
|
|
13
|
-
import polygonToLine from '@turf/polygon-to-line';
|
|
14
|
-
import { getPickedEditHandle } from
|
|
15
|
-
import { GeoJsonEditMode, getIntermediatePosition } from
|
|
16
|
-
import { ImmutableFeatureCollection } from
|
|
13
|
+
import { polygonToLine } from '@turf/polygon-to-line';
|
|
14
|
+
import { getPickedEditHandle } from "./utils.js";
|
|
15
|
+
import { GeoJsonEditMode, getIntermediatePosition } from "./geojson-edit-mode.js";
|
|
16
|
+
import { ImmutableFeatureCollection } from "./immutable-feature-collection.js";
|
|
17
17
|
export class RotateMode extends GeoJsonEditMode {
|
|
18
18
|
_selectedEditHandle;
|
|
19
19
|
_geometryBeingRotated;
|
|
@@ -92,6 +92,7 @@ export class RotateMode extends GeoJsonEditMode {
|
|
|
92
92
|
}
|
|
93
93
|
handleStartDragging(event, props) {
|
|
94
94
|
if (this._selectedEditHandle) {
|
|
95
|
+
event.cancelPan();
|
|
95
96
|
this._isRotating = true;
|
|
96
97
|
this._geometryBeingRotated = this.getSelectedFeaturesAsFeatureCollection(props);
|
|
97
98
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FeatureCollection, Position } from
|
|
2
|
-
import { ModeProps, PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, EditHandleFeature, GuideFeatureCollection } from
|
|
3
|
-
import { GeoJsonEditMode } from
|
|
1
|
+
import { FeatureCollection, Position } from "../utils/geojson-types.js";
|
|
2
|
+
import { ModeProps, PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, EditHandleFeature, GuideFeatureCollection } from "./types.js";
|
|
3
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
4
4
|
export declare class ScaleMode extends GeoJsonEditMode {
|
|
5
5
|
_geometryBeingScaled: FeatureCollection | null | undefined;
|
|
6
6
|
_selectedEditHandle: EditHandleFeature | null | undefined;
|
|
@@ -25,3 +25,4 @@ export declare class ScaleMode extends GeoJsonEditMode {
|
|
|
25
25
|
handleStopDragging(event: StopDraggingEvent, props: ModeProps<FeatureCollection>): void;
|
|
26
26
|
getGuides(props: ModeProps<FeatureCollection>): GuideFeatureCollection;
|
|
27
27
|
}
|
|
28
|
+
//# sourceMappingURL=scale-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/scale-mode.ts"],"names":[],"mappings":"AAcA,OAAO,EAAC,iBAAiB,EAAE,QAAQ,EAAC,kCAA+B;AACnE,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACvB,mBAAgB;AAEjB,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAGpD,qBAAa,SAAU,SAAQ,eAAe;IAC5C,oBAAoB,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3D,mBAAmB,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1D,kBAAkB,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAM;IAClD,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,UAAU,UAAS;IAEnB,8BAA8B,aAAc,iBAAiB,GAAG,IAAI,GAAG,SAAS,KAAG,OAAO,CAQxF;IAEF,uBAAuB,mBAAoB,iBAAiB,KAAG,iBAAiB,GAAG,IAAI,CAoBrF;IAEF,eAAe,UAAW,SAAS,CAAC,iBAAiB,CAAC,cAAc,iBAAiB,uBASnF;IAEF,oBAAoB,QAAO,OAAO,CAAsC;IAExE,cAAc,mBACI,QAAQ,gBACV,QAAQ,YACZ,MAAM,SACT,SAAS,CAAC,iBAAiB,CAAC;;;;;;MA0BnC;IAEF,YAAY,UAAW,SAAS,CAAC,iBAAiB,CAAC,UA0BjD;IAEF,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAY9E,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAQlF,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAoBxE,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAsBhF,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;CA6BvE"}
|
|
@@ -6,14 +6,14 @@ import turfCentroid from '@turf/centroid';
|
|
|
6
6
|
import turfBearing from '@turf/bearing';
|
|
7
7
|
import bboxPolygon from '@turf/bbox-polygon';
|
|
8
8
|
import { point, featureCollection } from '@turf/helpers';
|
|
9
|
-
import polygonToLine from '@turf/polygon-to-line';
|
|
9
|
+
import { polygonToLine } from '@turf/polygon-to-line';
|
|
10
10
|
import { coordEach } from '@turf/meta';
|
|
11
11
|
import turfDistance from '@turf/distance';
|
|
12
12
|
import turfTransformScale from '@turf/transform-scale';
|
|
13
13
|
import { getCoord, getGeom } from '@turf/invariant';
|
|
14
|
-
import { getPickedEditHandle } from
|
|
15
|
-
import { GeoJsonEditMode } from
|
|
16
|
-
import { ImmutableFeatureCollection } from
|
|
14
|
+
import { getPickedEditHandle } from "./utils.js";
|
|
15
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
16
|
+
import { ImmutableFeatureCollection } from "./immutable-feature-collection.js";
|
|
17
17
|
export class ScaleMode extends GeoJsonEditMode {
|
|
18
18
|
_geometryBeingScaled;
|
|
19
19
|
_selectedEditHandle;
|
|
@@ -114,6 +114,7 @@ export class ScaleMode extends GeoJsonEditMode {
|
|
|
114
114
|
}
|
|
115
115
|
handleStartDragging(event, props) {
|
|
116
116
|
if (this._selectedEditHandle) {
|
|
117
|
+
event.cancelPan();
|
|
117
118
|
this._isScaling = true;
|
|
118
119
|
this._geometryBeingScaled = this.getSelectedFeaturesAsFeatureCollection(props);
|
|
119
120
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Feature, FeatureCollection } from
|
|
2
|
-
import { PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, ModeProps, Pick, GuideFeatureCollection, EditHandleFeature } from
|
|
3
|
-
import { GeoJsonEditMode } from
|
|
1
|
+
import { Feature, FeatureCollection } from "../utils/geojson-types.js";
|
|
2
|
+
import { PointerMoveEvent, StartDraggingEvent, StopDraggingEvent, DraggingEvent, ModeProps, Pick, GuideFeatureCollection, EditHandleFeature } from "./types.js";
|
|
3
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
4
4
|
type MovementTypeEvent = PointerMoveEvent | StartDraggingEvent | StopDraggingEvent | DraggingEvent;
|
|
5
5
|
export declare class SnappableMode extends GeoJsonEditMode {
|
|
6
6
|
_handler: GeoJsonEditMode;
|
|
@@ -19,3 +19,4 @@ export declare class SnappableMode extends GeoJsonEditMode {
|
|
|
19
19
|
handlePointerMove(event: PointerMoveEvent, props: ModeProps<FeatureCollection>): void;
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
22
|
+
//# sourceMappingURL=snappable-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snappable-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/snappable-mode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAW,OAAO,EAAE,iBAAiB,EAAC,kCAA+B;AAC5E,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,IAAI,EACJ,sBAAsB,EACtB,iBAAiB,EAClB,mBAAgB;AAMjB,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAEpD,KAAK,iBAAiB,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,aAAa,CAAC;AAEnG,qBAAa,aAAc,SAAQ,eAAe;IAChD,QAAQ,EAAE,eAAe,CAAC;gBAEd,OAAO,EAAE,eAAe;IAKpC,qBAAqB,CAAC,CAAC,SAAS,iBAAiB,EAC/C,KAAK,EAAE,CAAC,EACR,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,iBAAiB,GAC5B,CAAC;IAOJ,oBAAoB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,iBAAiB,GAAG,IAAI,GAAG,SAAS;IAMzE,oBAAoB,CAClB,gBAAgB,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,SAAS,GAC1C,iBAAiB,GAAG,IAAI,GAAG,SAAS;IAIvC,2BAA2B,CACzB,gBAAgB,EAAE,iBAAiB,EACnC,IAAI,EAAE,iBAAiB,GACtB,iBAAiB;IA0BpB,eAAe,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,OAAO,EAAE;IAQ/D,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,EAAE;IAmB/E,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IAuCtE,kBAAkB,CAAC,CAAC,SAAS,iBAAiB,EAC5C,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAClC,CAAC;IASJ,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAIlF,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAIhF,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAIxE,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;CAG/E"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// deck.gl-community
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { getPickedSnapSourceEditHandle, getPickedEditHandles, getEditHandlesForGeometry } from
|
|
5
|
-
import { GeoJsonEditMode } from
|
|
4
|
+
import { getPickedSnapSourceEditHandle, getPickedEditHandles, getEditHandlesForGeometry } from "./utils.js";
|
|
5
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
6
6
|
export class SnappableMode extends GeoJsonEditMode {
|
|
7
7
|
_handler;
|
|
8
8
|
constructor(handler) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FeatureCollection } from
|
|
2
|
-
import { ClickEvent, PointerMoveEvent, ModeProps, GuideFeatureCollection, TentativeFeature } from
|
|
3
|
-
import { GeoJsonEditMode, GeoJsonEditAction } from
|
|
1
|
+
import { FeatureCollection } from "../utils/geojson-types.js";
|
|
2
|
+
import { ClickEvent, PointerMoveEvent, ModeProps, GuideFeatureCollection, TentativeFeature } from "./types.js";
|
|
3
|
+
import { GeoJsonEditMode, GeoJsonEditAction } from "./geojson-edit-mode.js";
|
|
4
4
|
export declare class SplitPolygonMode extends GeoJsonEditMode {
|
|
5
5
|
calculateMapCoords(clickSequence: any, mapCoords: any, props: ModeProps<FeatureCollection>): any;
|
|
6
6
|
getGuides(props: ModeProps<FeatureCollection>): GuideFeatureCollection;
|
|
@@ -8,3 +8,4 @@ export declare class SplitPolygonMode extends GeoJsonEditMode {
|
|
|
8
8
|
handlePointerMove(event: PointerMoveEvent, props: ModeProps<FeatureCollection>): void;
|
|
9
9
|
splitPolygon(tentativeFeature: TentativeFeature, props: ModeProps<FeatureCollection>): GeoJsonEditAction;
|
|
10
10
|
}
|
|
11
|
+
//# sourceMappingURL=split-polygon-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-polygon-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/split-polygon-mode.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,iBAAiB,EAAC,kCAA+B;AACzD,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,gBAAgB,EACjB,mBAAgB;AACjB,OAAO,EAAC,eAAe,EAAE,iBAAiB,EAAC,+BAA4B;AAGvE,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,kBAAkB,CAAC,aAAa,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAgD1F,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IA6BtE,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IA2ClE,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAI9E,YAAY,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;CAqDrF"}
|
|
@@ -11,9 +11,9 @@ import turfDistance from '@turf/distance';
|
|
|
11
11
|
import turfDestination from '@turf/destination';
|
|
12
12
|
import turfPolygonToLine from '@turf/polygon-to-line';
|
|
13
13
|
import nearestPointOnLine from '@turf/nearest-point-on-line';
|
|
14
|
-
import { generatePointsParallelToLinePoints } from
|
|
15
|
-
import { GeoJsonEditMode } from
|
|
16
|
-
import { ImmutableFeatureCollection } from
|
|
14
|
+
import { generatePointsParallelToLinePoints } from "./utils.js";
|
|
15
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
16
|
+
import { ImmutableFeatureCollection } from "./immutable-feature-collection.js";
|
|
17
17
|
export class SplitPolygonMode extends GeoJsonEditMode {
|
|
18
18
|
calculateMapCoords(clickSequence, mapCoords, props) {
|
|
19
19
|
const modeConfig = props.modeConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ClickEvent, PointerMoveEvent, ModeProps, GuideFeatureCollection, TentativeFeature } from
|
|
2
|
-
import { Position, Polygon, FeatureOf, FeatureCollection } from
|
|
3
|
-
import { GeoJsonEditMode } from
|
|
1
|
+
import { ClickEvent, PointerMoveEvent, ModeProps, GuideFeatureCollection, TentativeFeature } from "./types.js";
|
|
2
|
+
import { Position, Polygon, FeatureOf, FeatureCollection } from "../utils/geojson-types.js";
|
|
3
|
+
import { GeoJsonEditMode } from "./geojson-edit-mode.js";
|
|
4
4
|
export declare class ThreeClickPolygonMode extends GeoJsonEditMode {
|
|
5
5
|
handleClick(event: ClickEvent, props: ModeProps<FeatureCollection>): void;
|
|
6
6
|
getGuides(props: ModeProps<FeatureCollection>): GuideFeatureCollection;
|
|
@@ -8,3 +8,4 @@ export declare class ThreeClickPolygonMode extends GeoJsonEditMode {
|
|
|
8
8
|
handlePointerMove(event: PointerMoveEvent, props: ModeProps<FeatureCollection>): void;
|
|
9
9
|
createTentativeFeature(props: ModeProps<FeatureCollection>): TentativeFeature;
|
|
10
10
|
}
|
|
11
|
+
//# sourceMappingURL=three-click-polygon-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"three-click-polygon-mode.d.ts","sourceRoot":"","sources":["../../src/edit-modes/three-click-polygon-mode.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,gBAAgB,EACjB,mBAAgB;AACjB,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAC,kCAA+B;AACvF,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAGpD,qBAAa,qBAAsB,SAAQ,eAAe;IACxD,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAuBlE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,sBAAsB;IAiDtE,oBAAoB,CAClB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,EAChB,UAAU,EAAE,GAAG,GACd,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS;IAIxC,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;IAK9E,sBAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,gBAAgB;CAkB9E"}
|