@deck.gl-community/editable-layers 9.0.3 → 9.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/edit-modes/delete-mode.d.ts +7 -0
  2. package/dist/edit-modes/delete-mode.d.ts.map +1 -0
  3. package/dist/edit-modes/delete-mode.js +22 -0
  4. package/dist/edit-modes/draw-circle-by-diameter-mode.d.ts.map +1 -1
  5. package/dist/edit-modes/draw-circle-by-diameter-mode.js +4 -0
  6. package/dist/edit-modes/draw-circle-from-center-mode.d.ts.map +1 -1
  7. package/dist/edit-modes/draw-circle-from-center-mode.js +4 -0
  8. package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.d.ts.map +1 -1
  9. package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.js +9 -1
  10. package/dist/edit-modes/draw-ellipse-using-three-points-mode.d.ts.map +1 -1
  11. package/dist/edit-modes/draw-ellipse-using-three-points-mode.js +10 -1
  12. package/dist/edit-modes/extend-line-string-mode.d.ts.map +1 -1
  13. package/dist/edit-modes/extend-line-string-mode.js +3 -0
  14. package/dist/edit-modes/extrude-mode.d.ts.map +1 -1
  15. package/dist/edit-modes/extrude-mode.js +4 -1
  16. package/dist/edit-modes/geojson-edit-mode.d.ts +2 -2
  17. package/dist/edit-modes/geojson-edit-mode.d.ts.map +1 -1
  18. package/dist/edit-modes/geojson-edit-mode.js +7 -4
  19. package/dist/edit-modes/measure-distance-mode.d.ts.map +1 -1
  20. package/dist/edit-modes/modify-mode.d.ts.map +1 -1
  21. package/dist/edit-modes/modify-mode.js +4 -1
  22. package/dist/edit-modes/resize-circle-mode.d.ts.map +1 -1
  23. package/dist/edit-modes/resize-circle-mode.js +1 -0
  24. package/dist/edit-modes/rotate-mode.d.ts.map +1 -1
  25. package/dist/edit-modes/rotate-mode.js +2 -1
  26. package/dist/edit-modes/scale-mode.d.ts.map +1 -1
  27. package/dist/edit-modes/scale-mode.js +2 -1
  28. package/dist/edit-modes/split-polygon-mode.d.ts.map +1 -1
  29. package/dist/edit-modes/three-click-polygon-mode.d.ts.map +1 -1
  30. package/dist/edit-modes/three-click-polygon-mode.js +3 -1
  31. package/dist/edit-modes/transform-mode.d.ts.map +1 -1
  32. package/dist/edit-modes/transform-mode.js +3 -0
  33. package/dist/edit-modes/translate-mode.d.ts.map +1 -1
  34. package/dist/edit-modes/translate-mode.js +2 -1
  35. package/dist/edit-modes/two-click-polygon-mode.d.ts.map +1 -1
  36. package/dist/edit-modes/two-click-polygon-mode.js +3 -4
  37. package/dist/edit-modes/types.d.ts +1 -0
  38. package/dist/edit-modes/types.d.ts.map +1 -1
  39. package/dist/edit-modes/utils.d.ts +3 -2
  40. package/dist/edit-modes/utils.d.ts.map +1 -1
  41. package/dist/edit-modes/utils.js +4 -1
  42. package/dist/editable-layers/editable-geojson-layer.d.ts +4 -4
  43. package/dist/editable-layers/editable-geojson-layer.d.ts.map +1 -1
  44. package/dist/editable-layers/editable-geojson-layer.js +2 -0
  45. package/dist/editable-layers/editable-h3-cluster-layer.d.ts +1 -1
  46. package/dist/editable-layers/editable-h3-cluster-layer.d.ts.map +1 -1
  47. package/dist/editable-layers/editable-h3-cluster-layer.js +0 -1
  48. package/dist/editable-layers/editable-layer.d.ts +4 -2
  49. package/dist/editable-layers/editable-layer.d.ts.map +1 -1
  50. package/dist/editable-layers/editable-layer.js +8 -4
  51. package/dist/editable-layers/editable-path-layer.d.ts +13 -1
  52. package/dist/editable-layers/editable-path-layer.d.ts.map +1 -1
  53. package/dist/editable-layers/editable-path-layer.js +20 -12
  54. package/dist/editable-layers/junction-scatterplot-layer.d.ts +4 -2
  55. package/dist/editable-layers/junction-scatterplot-layer.d.ts.map +1 -1
  56. package/dist/editable-layers/selection-layer.d.ts +2 -1
  57. package/dist/editable-layers/selection-layer.d.ts.map +1 -1
  58. package/dist/editable-layers/selection-layer.js +0 -1
  59. package/dist/index.cjs +122 -40
  60. package/dist/index.cjs.map +4 -4
  61. package/dist/index.d.ts +1 -0
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/mode-handlers/split-polygon-handler.d.ts.map +1 -1
  64. package/dist/shaderlib/color/color.d.ts +12 -2
  65. package/dist/shaderlib/color/color.d.ts.map +1 -1
  66. package/dist/shaderlib/color/color.js +25 -18
  67. package/dist/utils/utils.js +1 -1
  68. package/package.json +11 -11
  69. package/src/edit-modes/delete-mode.ts +28 -0
  70. package/src/edit-modes/draw-circle-by-diameter-mode.ts +4 -0
  71. package/src/edit-modes/draw-circle-from-center-mode.ts +4 -0
  72. package/src/edit-modes/draw-ellipse-by-bounding-box-mode.ts +10 -1
  73. package/src/edit-modes/draw-ellipse-using-three-points-mode.ts +11 -1
  74. package/src/edit-modes/extend-line-string-mode.ts +4 -0
  75. package/src/edit-modes/extrude-mode.ts +6 -1
  76. package/src/edit-modes/geojson-edit-mode.ts +9 -4
  77. package/src/edit-modes/measure-distance-mode.ts +1 -1
  78. package/src/edit-modes/modify-mode.ts +6 -1
  79. package/src/edit-modes/resize-circle-mode.ts +1 -0
  80. package/src/edit-modes/rotate-mode.ts +2 -1
  81. package/src/edit-modes/scale-mode.ts +2 -1
  82. package/src/edit-modes/split-polygon-mode.ts +4 -2
  83. package/src/edit-modes/three-click-polygon-mode.ts +7 -1
  84. package/src/edit-modes/transform-mode.ts +4 -0
  85. package/src/edit-modes/translate-mode.ts +4 -2
  86. package/src/edit-modes/two-click-polygon-mode.ts +3 -4
  87. package/src/edit-modes/types.ts +1 -0
  88. package/src/edit-modes/utils.ts +8 -3
  89. package/src/editable-layers/editable-geojson-layer.ts +6 -4
  90. package/src/editable-layers/editable-h3-cluster-layer.ts +1 -1
  91. package/src/editable-layers/editable-layer.ts +12 -4
  92. package/src/editable-layers/editable-path-layer.ts +29 -15
  93. package/src/editable-layers/junction-scatterplot-layer.ts +4 -2
  94. package/src/editable-layers/selection-layer.ts +2 -1
  95. package/src/index.ts +2 -0
  96. package/src/mode-handlers/split-polygon-handler.ts +2 -1
  97. package/src/shaderlib/color/color.ts +34 -20
  98. package/src/utils/translate-from-center.ts +1 -1
  99. package/src/utils/utils.ts +1 -1
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ export { getPickedEditHandle, getEditHandlesForGeometry } from "./edit-modes/uti
21
21
  export type { EditMode } from "./edit-modes/edit-mode.js";
22
22
  export type { GeoJsonEditModeType } from "./edit-modes/geojson-edit-mode.js";
23
23
  export type { GeoJsonEditModeConstructor } from "./edit-modes/geojson-edit-mode.js";
24
+ export type { EditableGeoJsonLayerProps } from "./editable-layers/editable-geojson-layer.js";
24
25
  export { GeoJsonEditMode } from "./edit-modes/geojson-edit-mode.js";
25
26
  export { ModifyMode } from "./edit-modes/modify-mode.js";
26
27
  export { ResizeCircleMode } from "./edit-modes/resize-circle-mode.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,WAAW,EAAE,cAAc,EAAE,UAAU,EAAC,uBAAoB;AACpE,OAAO,EAAC,cAAc,EAAC,2CAAwC;AAE/D,OAAO,EAAC,OAAO,EAAC,yBAAsB;AACtC,OAAO,EAAC,eAAe,EAAC,mCAAgC;AAExD,OAAO,EAAC,WAAW,EAAC,8BAA2B;AAC/C,OAAO,EAAC,cAAc,EAAC,wCAAqC;AAC5D,OAAO,EAAC,UAAU,EAAC,oCAAiC;AACpD,OAAO,EAAC,aAAa,EAAC,uCAAoC;AAE1D,OAAO,EAAC,UAAU,EAAC,6BAA0B;AAE7C,OAAO,EAAC,+BAA+B,EAAC,2BAAwB;AAGhE,OAAO,EAAC,WAAW,EAAC,yBAAsB;AAG1C,YAAY,EAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAC,yBAAsB;AAG1D,OAAO,EAAC,oBAAoB,EAAC,oDAAiD;AAC9E,OAAO,EAAC,sBAAsB,EAAC,uDAAoD;AACnF,OAAO,EAAC,cAAc,EAAC,6CAA0C;AACjE,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AY,EACZ,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAEhB,iBAAiB,EACjB,UAAU,EACX,iCAA8B;AAG/B,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,2BAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"split-polygon-handler.d.ts","sourceRoot":"","sources":["../../src/mode-handlers/split-polygon-handler.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,0BAAuB;AACvD,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,+BAA4B;AAGjE,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,kBAAkB,CAAC,aAAa,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IAgDrD,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS;IAoC7D,iBAAiB,CAAC,EAAC,SAAS,EAAC,EAAE,gBAAgB,GAAG;QAChD,UAAU,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;QAC1C,YAAY,EAAE,OAAO,CAAC;KACvB;IAoBD,YAAY;CAqDb"}
1
+ {"version":3,"file":"split-polygon-handler.d.ts","sourceRoot":"","sources":["../../src/mode-handlers/split-polygon-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,0BAAuB;AACvD,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,+BAA4B;AAGjE,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,kBAAkB,CAAC,aAAa,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IAgDrD,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS;IAoC7D,iBAAiB,CAAC,EAAC,SAAS,EAAC,EAAE,gBAAgB,GAAG;QAChD,UAAU,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;QAC1C,YAAY,EAAE,OAAO,CAAC;KACvB;IAoBD,YAAY;CAqDb"}
@@ -1,10 +1,20 @@
1
- declare function getUniforms(opts?: Record<string, number>): Record<string, number>;
1
+ export type ColorProps = {
2
+ opacity: number;
3
+ desaturate: number;
4
+ brightness: number;
5
+ };
6
+ declare function getUniforms(opts?: ColorProps): ColorProps;
2
7
  /** Shader module that implements desaturation. @note still WIP */
3
8
  export declare const color: {
4
9
  readonly name: "color";
5
10
  readonly vs: "in vec4 color_vColor;\n\ncolor_setColor(vec4 color) {\n color_vColor = color;\n}\n";
6
- readonly fs: "uniform float color_uOpacity;\nuniform float color_uDesaturate;\nuniform float color_uBrightness;\n\nin vec4 color_vColor;\n\nout vec4 fragColor;\n\nvec4 color_getColor() {\n return color_vColor;\n}\n\nvec4 color_filterColor(vec4 color) {\n // apply desaturation and brightness\n if (color_uDesaturate > 0.01) {\n float luminance = (color.r + color.g + color.b) * 0.333333333 + color_uBrightness;\n color = vec4(mix(color.rgb, vec3(luminance), color_uDesaturate), color.a);\n\n // Apply opacity\n color = vec4(color.rgb, color.a * color_uOpacity);\n return color;\n}\n";
11
+ readonly fs: "uniform colorUniforms {\n float opacity;\n float desaturate;\n float brightness;\n} color;\n\n\nin vec4 color_vColor;\n\nout vec4 fragColor;\n\nvec4 color_getColor() {\n return color_vColor;\n}\n\nvec4 color_filterColor(vec4 inputColor) {\n vec4 color = inputColor;\n // apply desaturation and brightness\n if (color.desaturate > 0.01) {\n float luminance = (color.r + color.g + color.b) * 0.333333333 + color.brightness;\n color = vec4(mix(color.rgb, vec3(luminance), color.desaturate), color.a);\n }\n\n // Apply opacity\n color = vec4(color.rgb, color.a * color.opacity);\n return color;\n}\n";
7
12
  readonly getUniforms: typeof getUniforms;
13
+ readonly uniformTypes: {
14
+ readonly opacity: "f32";
15
+ readonly desaturate: "f32";
16
+ readonly brightness: "f32";
17
+ };
8
18
  };
9
19
  export {};
10
20
  //# sourceMappingURL=color.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/color/color.ts"],"names":[],"mappings":"AAaA,iBAAS,WAAW,CAAC,IAAI,yBAAgB,0BAMxC;AAmCD,kEAAkE;AAClE,eAAO,MAAM,KAAK;;;;;CAKe,CAAC"}
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/color/color.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAQF,iBAAS,WAAW,CAAC,IAAI,aAAgB,cAExC;AAmCD,kEAAkE;AAClE,eAAO,MAAM,KAAK;;;;;;;;;;CAU2B,CAAC"}
@@ -1,18 +1,20 @@
1
1
  // deck.gl-community
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- /* eslint-disable camelcase */
4
+ const uniformBlock = `\
5
+ uniform colorUniforms {
6
+ float opacity;
7
+ float desaturate;
8
+ float brightness;
9
+ } color;
10
+ `;
5
11
  const INITIAL_STATE = {
6
- color_uOpacity: 1.0,
7
- color_uDesaturate: 0.0,
8
- color_uBrightness: 1.0
12
+ opacity: 1.0,
13
+ desaturate: 0.0,
14
+ brightness: 1.0
9
15
  };
10
16
  function getUniforms(opts = INITIAL_STATE) {
11
- const uniforms = {};
12
- if (opts.opacity) {
13
- uniforms.color_uOpacity = opts.opacity;
14
- }
15
- return uniforms;
17
+ return opts;
16
18
  }
17
19
  const vs = `\
18
20
  in vec4 color_vColor;
@@ -22,9 +24,7 @@ color_setColor(vec4 color) {
22
24
  }
23
25
  `;
24
26
  const fs = `\
25
- uniform float color_uOpacity;
26
- uniform float color_uDesaturate;
27
- uniform float color_uBrightness;
27
+ ${uniformBlock}
28
28
 
29
29
  in vec4 color_vColor;
30
30
 
@@ -34,14 +34,16 @@ vec4 color_getColor() {
34
34
  return color_vColor;
35
35
  }
36
36
 
37
- vec4 color_filterColor(vec4 color) {
37
+ vec4 color_filterColor(vec4 inputColor) {
38
+ vec4 color = inputColor;
38
39
  // apply desaturation and brightness
39
- if (color_uDesaturate > 0.01) {
40
- float luminance = (color.r + color.g + color.b) * 0.333333333 + color_uBrightness;
41
- color = vec4(mix(color.rgb, vec3(luminance), color_uDesaturate), color.a);
40
+ if (color.desaturate > 0.01) {
41
+ float luminance = (color.r + color.g + color.b) * 0.333333333 + color.brightness;
42
+ color = vec4(mix(color.rgb, vec3(luminance), color.desaturate), color.a);
43
+ }
42
44
 
43
45
  // Apply opacity
44
- color = vec4(color.rgb, color.a * color_uOpacity);
46
+ color = vec4(color.rgb, color.a * color.opacity);
45
47
  return color;
46
48
  }
47
49
  `;
@@ -50,5 +52,10 @@ export const color = {
50
52
  name: 'color',
51
53
  vs,
52
54
  fs,
53
- getUniforms
55
+ getUniforms,
56
+ uniformTypes: {
57
+ opacity: 'f32',
58
+ desaturate: 'f32',
59
+ brightness: 'f32'
60
+ }
54
61
  };
@@ -5,7 +5,7 @@ import destination from '@turf/destination';
5
5
  import bearing from '@turf/bearing';
6
6
  import pointToLineDistance from '@turf/point-to-line-distance';
7
7
  import { point } from '@turf/helpers';
8
- import WebMercatorViewport from 'viewport-mercator-project';
8
+ import { WebMercatorViewport } from 'viewport-mercator-project';
9
9
  export function toDeckColor(color, defaultColor = [255, 0, 0, 255]) {
10
10
  if (!Array.isArray(color)) {
11
11
  return defaultColor;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@deck.gl-community/editable-layers",
3
3
  "description": "A suite of 3D-enabled data editing overlays, suitable for deck.gl",
4
4
  "license": "MIT",
5
- "version": "9.0.3",
5
+ "version": "9.1.0-beta.3",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/visgl/deck.gl-community"
@@ -70,16 +70,16 @@
70
70
  "viewport-mercator-project": ">=6.2.3"
71
71
  },
72
72
  "peerDependencies": {
73
- "@deck.gl-community/layers": "^9.0.0",
74
- "@deck.gl/core": "^9.0.12",
75
- "@deck.gl/extensions": "^9.0.12",
76
- "@deck.gl/geo-layers": "^9.0.12",
77
- "@deck.gl/layers": "^9.0.12",
78
- "@deck.gl/mesh-layers": ">=9.0.6",
79
- "@luma.gl/constants": ">=9.0.12",
80
- "@luma.gl/core": ">=9.0.12",
81
- "@luma.gl/engine": ">=9.0.12",
73
+ "@deck.gl-community/layers": "^9.1.0-beta.2",
74
+ "@deck.gl/core": "^9.1.0",
75
+ "@deck.gl/extensions": "^9.1.0",
76
+ "@deck.gl/geo-layers": "^9.1.0",
77
+ "@deck.gl/layers": "^9.1.0",
78
+ "@deck.gl/mesh-layers": "^9.1.0",
79
+ "@luma.gl/constants": ">=9.1.0",
80
+ "@luma.gl/core": ">=9.1.0",
81
+ "@luma.gl/engine": ">=9.1.0",
82
82
  "@math.gl/core": ">=4.0.1"
83
83
  },
84
- "gitHead": "8955b0da47771f3524b65360243ee246abeb3660"
84
+ "gitHead": "5d67929a62a74fdbf78cedce21253c9d41096887"
85
85
  }
@@ -0,0 +1,28 @@
1
+ import {FeatureCollection} from '../utils/geojson-types';
2
+
3
+ import {GeoJsonEditMode} from './geojson-edit-mode';
4
+ import {ClickEvent, ModeProps} from './types';
5
+ export class DeleteMode extends GeoJsonEditMode {
6
+ handleClick(_event: ClickEvent, props: ModeProps<FeatureCollection>): void {
7
+ const selectedFeatureIndexes = props.lastPointerMoveEvent.picks.map((pick) => pick.index);
8
+ if (selectedFeatureIndexes.length > 0) {
9
+ const indexToDelete = selectedFeatureIndexes[0];
10
+
11
+ const features = props.data.features.filter((_, index) => index !== indexToDelete);
12
+ const updatedData = {
13
+ ...props.data,
14
+ features
15
+ };
16
+
17
+ const editAction = {
18
+ updatedData,
19
+ editType: 'deleteFeature',
20
+ editContext: {
21
+ featureIndexes: selectedFeatureIndexes
22
+ }
23
+ };
24
+
25
+ props.onEdit(editAction);
26
+ }
27
+ }
28
+ }
@@ -38,6 +38,10 @@ export class DrawCircleByDiameterMode extends TwoClickPolygonMode {
38
38
 
39
39
  geometry.properties = geometry.properties || {};
40
40
  geometry.properties.shape = 'Circle';
41
+ geometry.properties.editProperties = geometry.properties.editProperties || {};
42
+ geometry.properties.editProperties.shape = 'Circle';
43
+ geometry.properties.editProperties.radius = {value: this.radius, unit: 'kilometers'};
44
+ geometry.properties.editProperties.center = centerCoordinates;
41
45
  // calculate area of circle with turf function
42
46
  this.areaCircle = area(geometry);
43
47
  // @ts-expect-error turf types diff
@@ -32,6 +32,10 @@ export class DrawCircleFromCenterMode extends TwoClickPolygonMode {
32
32
 
33
33
  geometry.properties = geometry.properties || {};
34
34
  geometry.properties.shape = 'Circle';
35
+ geometry.properties.editProperties = geometry.properties.editProperties || {};
36
+ geometry.properties.editProperties.shape = 'Circle';
37
+ geometry.properties.editProperties.radius = {value: this.radius, unit: 'kilometers'};
38
+ geometry.properties.editProperties.center = coord1;
35
39
  // calculate area of circle with turf function
36
40
  this.areaCircle = area(geometry);
37
41
  // @ts-expect-error turf types diff
@@ -23,7 +23,16 @@ export class DrawEllipseByBoundingBoxMode extends TwoClickPolygonMode {
23
23
  const xSemiAxis = Math.max(distance(point(polygonPoints[0]), point(polygonPoints[1])), 0.001);
24
24
  const ySemiAxis = Math.max(distance(point(polygonPoints[0]), point(polygonPoints[3])), 0.001);
25
25
 
26
+ const geometry = ellipse(centerCoordinates, xSemiAxis, ySemiAxis);
27
+
28
+ geometry.properties = geometry.properties || {};
29
+ geometry.properties.editProperties = geometry.properties.editProperties || {};
30
+ geometry.properties.editProperties.shape = 'Ellipse';
31
+ geometry.properties.editProperties.xSemiAxis = {value: xSemiAxis, unit: 'kilometers'};
32
+ geometry.properties.editProperties.ySemiAxis = {value: ySemiAxis, unit: 'kilometers'};
33
+ geometry.properties.editProperties.angle = 0;
34
+ geometry.properties.editProperties.center = centerCoordinates;
26
35
  // @ts-expect-error fix return types
27
- return ellipse(centerCoordinates, xSemiAxis, ySemiAxis);
36
+ return geometry;
28
37
  }
29
38
  }
@@ -22,6 +22,16 @@ export class DrawEllipseUsingThreePointsMode extends ThreeClickPolygonMode {
22
22
  const ySemiAxis = Math.max(distance(coord1, coord2), 0.001) / 2;
23
23
  const options = {angle: bearing(coord1, coord2)};
24
24
  // @ts-expect-error fix return types
25
- return ellipse(centerCoordinates, xSemiAxis, ySemiAxis, options);
25
+ const geometry = ellipse(centerCoordinates, xSemiAxis, ySemiAxis, options);
26
+
27
+ geometry.properties = geometry.properties || {};
28
+ geometry.properties.editProperties = geometry.properties.editProperties || {};
29
+ geometry.properties.editProperties.shape = 'Ellipse';
30
+ geometry.properties.editProperties.xSemiAxis = {value: xSemiAxis, unit: 'kilometers'};
31
+ geometry.properties.editProperties.ySemiAxis = {value: ySemiAxis, unit: 'kilometers'};
32
+ geometry.properties.editProperties.angle = options.angle;
33
+ geometry.properties.editProperties.center = centerCoordinates;
34
+ // @ts-expect-error fix return types
35
+ return geometry;
26
36
  }
27
37
  }
@@ -62,6 +62,10 @@ export class ExtendLineStringMode extends GeoJsonEditMode {
62
62
 
63
63
  const mapCoords = props.lastPointerMoveEvent && props.lastPointerMoveEvent.mapCoords;
64
64
 
65
+ if (!mapCoords) {
66
+ return guides;
67
+ }
68
+
65
69
  // Draw an extension line starting from one end of the selected LineString to the cursor
66
70
  let startPosition: Position | null | undefined = null;
67
71
  const {modeConfig} = props;
@@ -6,7 +6,8 @@ import bearing from '@turf/bearing';
6
6
  import {
7
7
  generatePointsParallelToLinePoints,
8
8
  getPickedEditHandle,
9
- getPickedIntermediateEditHandle
9
+ getPickedIntermediateEditHandle,
10
+ shouldCancelPan
10
11
  } from './utils';
11
12
  import {FeatureCollection} from '../utils/geojson-types';
12
13
  import {ModeProps, StartDraggingEvent, StopDraggingEvent, DraggingEvent} from './types';
@@ -61,6 +62,10 @@ export class ExtrudeMode extends ModifyMode {
61
62
  }
62
63
 
63
64
  handleStartDragging(event: StartDraggingEvent, props: ModeProps<FeatureCollection>) {
65
+ if (shouldCancelPan(event)) {
66
+ event.cancelPan();
67
+ }
68
+
64
69
  const selectedFeatureIndexes = props.selectedIndexes;
65
70
 
66
71
  const editHandle = getPickedIntermediateEditHandle(event.picks);
@@ -118,17 +118,19 @@ export class GeoJsonEditMode implements EditMode<FeatureCollection, GuideFeature
118
118
 
119
119
  getAddFeatureAction(
120
120
  featureOrGeometry: Geometry | Feature,
121
- features: FeatureCollection
121
+ features: FeatureCollection,
122
+ featureProperties?: {}
122
123
  ): GeoJsonEditAction {
123
124
  // Unsure why flow can't deal with Geometry type, but there I fixed it
124
125
  const featureOrGeometryAsAny: any = featureOrGeometry;
126
+ featureProperties = featureProperties || {};
125
127
 
126
128
  const feature: any =
127
129
  featureOrGeometryAsAny.type === 'Feature'
128
130
  ? featureOrGeometryAsAny
129
131
  : {
130
132
  type: 'Feature',
131
- properties: {},
133
+ properties: featureProperties,
132
134
  geometry: featureOrGeometryAsAny
133
135
  };
134
136
 
@@ -173,11 +175,14 @@ export class GeoJsonEditMode implements EditMode<FeatureCollection, GuideFeature
173
175
  };
174
176
  }
175
177
 
178
+ // eslint-disable-next-line complexity
176
179
  getAddFeatureOrBooleanPolygonAction(
177
180
  featureOrGeometry: Polygon | Feature,
178
- props: ModeProps<FeatureCollection>
181
+ props: ModeProps<FeatureCollection>,
182
+ featureProperties?: {}
179
183
  ): GeoJsonEditAction | null | undefined {
180
184
  const featureOrGeometryAsAny: any = featureOrGeometry;
185
+ featureProperties = featureProperties || {};
181
186
 
182
187
  const selectedFeature = this.getSelectedFeature(props);
183
188
  const {modeConfig} = props;
@@ -240,7 +245,7 @@ export class GeoJsonEditMode implements EditMode<FeatureCollection, GuideFeature
240
245
 
241
246
  return editAction;
242
247
  }
243
- return this.getAddFeatureAction(featureOrGeometry, props.data);
248
+ return this.getAddFeatureAction(featureOrGeometry, props.data, featureProperties);
244
249
  }
245
250
 
246
251
  createTentativeFeature(props: ModeProps<FeatureCollection>): TentativeFeature | null {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import turfDistance from '@turf/distance';
6
6
  import turfMidpoint from '@turf/midpoint';
7
- import {FeatureCollection, Position} from '../utils/geojson-types';
7
+ import {FeatureCollection} from '../utils/geojson-types';
8
8
  import {
9
9
  ClickEvent,
10
10
  PointerMoveEvent,
@@ -13,7 +13,8 @@ import {
13
13
  getPickedExistingEditHandle,
14
14
  getPickedIntermediateEditHandle,
15
15
  updateRectanglePosition,
16
- NearestPointType
16
+ NearestPointType,
17
+ shouldCancelPan
17
18
  } from './utils';
18
19
  import {LineString, Point, Polygon, FeatureCollection, FeatureOf} from '../utils/geojson-types';
19
20
  import {
@@ -251,6 +252,10 @@ export class ModifyMode extends GeoJsonEditMode {
251
252
  }
252
253
 
253
254
  handleStartDragging(event: StartDraggingEvent, props: ModeProps<FeatureCollection>) {
255
+ if (shouldCancelPan(event)) {
256
+ event.cancelPan();
257
+ }
258
+
254
259
  const selectedFeatureIndexes = props.selectedIndexes;
255
260
 
256
261
  const editHandle = getPickedIntermediateEditHandle(event.picks);
@@ -182,6 +182,7 @@ export class ResizeCircleMode extends GeoJsonEditMode {
182
182
 
183
183
  handleStartDragging(event: StartDraggingEvent, props: ModeProps<FeatureCollection>) {
184
184
  if (this._selectedEditHandle) {
185
+ event.cancelPan();
185
186
  this._isResizing = true;
186
187
  }
187
188
  }
@@ -11,7 +11,7 @@ import {coordEach} from '@turf/meta';
11
11
  import {getGeom} from '@turf/invariant';
12
12
  import {point, featureCollection, lineString} from '@turf/helpers';
13
13
  import turfTransformRotate from '@turf/transform-rotate';
14
- import polygonToLine from '@turf/polygon-to-line';
14
+ import {polygonToLine} from '@turf/polygon-to-line';
15
15
  import {
16
16
  PointerMoveEvent,
17
17
  StartDraggingEvent,
@@ -128,6 +128,7 @@ export class RotateMode extends GeoJsonEditMode {
128
128
 
129
129
  handleStartDragging(event: StartDraggingEvent, props: ModeProps<FeatureCollection>) {
130
130
  if (this._selectedEditHandle) {
131
+ event.cancelPan();
131
132
  this._isRotating = true;
132
133
  this._geometryBeingRotated = this.getSelectedFeaturesAsFeatureCollection(props);
133
134
  }
@@ -7,7 +7,7 @@ import turfCentroid from '@turf/centroid';
7
7
  import turfBearing from '@turf/bearing';
8
8
  import bboxPolygon from '@turf/bbox-polygon';
9
9
  import {point, featureCollection} from '@turf/helpers';
10
- import polygonToLine from '@turf/polygon-to-line';
10
+ import {polygonToLine} from '@turf/polygon-to-line';
11
11
  import {coordEach} from '@turf/meta';
12
12
  import turfDistance from '@turf/distance';
13
13
  import turfTransformScale from '@turf/transform-scale';
@@ -152,6 +152,7 @@ export class ScaleMode extends GeoJsonEditMode {
152
152
 
153
153
  handleStartDragging(event: StartDraggingEvent, props: ModeProps<FeatureCollection>) {
154
154
  if (this._selectedEditHandle) {
155
+ event.cancelPan();
155
156
  this._isScaling = true;
156
157
  this._geometryBeingScaled = this.getSelectedFeaturesAsFeatureCollection(props);
157
158
  }
@@ -6,12 +6,14 @@ import booleanPointInPolygon from '@turf/boolean-point-in-polygon';
6
6
  import turfDifference from '@turf/difference';
7
7
  import turfBuffer from '@turf/buffer';
8
8
  import lineIntersect from '@turf/line-intersect';
9
- import {lineString, Point} from '@turf/helpers';
9
+ import type {Point} from '@turf/helpers';
10
+ import {lineString} from '@turf/helpers';
10
11
  import turfBearing from '@turf/bearing';
11
12
  import turfDistance from '@turf/distance';
12
13
  import turfDestination from '@turf/destination';
13
14
  import turfPolygonToLine from '@turf/polygon-to-line';
14
- import nearestPointOnLine, {NearestPointOnLine} from '@turf/nearest-point-on-line';
15
+ import type {NearestPointOnLine} from '@turf/nearest-point-on-line';
16
+ import nearestPointOnLine from '@turf/nearest-point-on-line';
15
17
  import {generatePointsParallelToLinePoints} from './utils';
16
18
  import {FeatureCollection} from '../utils/geojson-types';
17
19
  import {
@@ -11,6 +11,7 @@ import {
11
11
  } from './types';
12
12
  import {Position, Polygon, FeatureOf, FeatureCollection} from '../utils/geojson-types';
13
13
  import {GeoJsonEditMode} from './geojson-edit-mode';
14
+ import {omit} from 'lodash';
14
15
 
15
16
  export class ThreeClickPolygonMode extends GeoJsonEditMode {
16
17
  handleClick(event: ClickEvent, props: ModeProps<FeatureCollection>) {
@@ -23,7 +24,11 @@ export class ThreeClickPolygonMode extends GeoJsonEditMode {
23
24
  tentativeFeature &&
24
25
  tentativeFeature.geometry.type === 'Polygon'
25
26
  ) {
26
- const editAction = this.getAddFeatureOrBooleanPolygonAction(tentativeFeature.geometry, props);
27
+ const editAction = this.getAddFeatureOrBooleanPolygonAction(
28
+ tentativeFeature.geometry,
29
+ props,
30
+ omit(tentativeFeature.properties, 'guideType')
31
+ );
27
32
  this.resetClickSequence();
28
33
 
29
34
  if (editAction) {
@@ -70,6 +75,7 @@ export class ThreeClickPolygonMode extends GeoJsonEditMode {
70
75
  guides.features.push({
71
76
  type: 'Feature',
72
77
  properties: {
78
+ ...polygon.properties,
73
79
  guideType: 'tentative'
74
80
  },
75
81
  geometry: polygon.geometry
@@ -33,6 +33,10 @@ export class TransformMode extends CompositeMode {
33
33
  let translateMode: TranslateMode | null = null;
34
34
  const filteredModes: GeoJsonEditMode[] = [];
35
35
 
36
+ if (event.picks.length) {
37
+ event.cancelPan();
38
+ }
39
+
36
40
  // If the user selects a scaling edit handle that overlaps with part of the selected feature,
37
41
  // it is possible for both scale and translate actions to be triggered. This logic prevents
38
42
  // this simultaneous action trigger from happening by putting a higher priority on scaling
@@ -5,8 +5,9 @@
5
5
  import turfBearing from '@turf/bearing';
6
6
  import turfDistance from '@turf/distance';
7
7
  import clone from '@turf/clone';
8
- import {point, Feature as TurfFeature, Geometry as TurfGeometry} from '@turf/helpers';
9
- import WebMercatorViewport from 'viewport-mercator-project';
8
+ import type {Feature as TurfFeature, Geometry as TurfGeometry} from '@turf/helpers';
9
+ import {point} from '@turf/helpers';
10
+ import {WebMercatorViewport} from 'viewport-mercator-project';
10
11
  import {FeatureCollection, Position, Geometry} from '../utils/geojson-types';
11
12
  import {
12
13
  PointerMoveEvent,
@@ -59,6 +60,7 @@ export class TranslateMode extends GeoJsonEditMode {
59
60
  return;
60
61
  }
61
62
 
63
+ event.cancelPan();
62
64
  this._geometryBeforeTranslate = this.getSelectedFeaturesAsFeatureCollection(props);
63
65
  }
64
66
 
@@ -13,6 +13,7 @@ import {
13
13
  } from './types';
14
14
  import {Polygon, FeatureCollection, FeatureOf, Position} from '../utils/geojson-types';
15
15
  import {GeoJsonEditMode} from './geojson-edit-mode';
16
+ import {omit} from 'lodash';
16
17
 
17
18
  export class TwoClickPolygonMode extends GeoJsonEditMode {
18
19
  handleClick(event: ClickEvent, props: ModeProps<FeatureCollection>) {
@@ -57,9 +58,7 @@ export class TwoClickPolygonMode extends GeoJsonEditMode {
57
58
  ) {
58
59
  const feature: FeatureOf<Polygon> = {
59
60
  type: 'Feature',
60
- properties: {
61
- shape: tentativeFeature.properties.shape
62
- },
61
+ properties: omit(tentativeFeature.properties, 'guideType'),
63
62
  geometry: {
64
63
  type: 'Polygon',
65
64
  coordinates: tentativeFeature.geometry.coordinates
@@ -97,7 +96,7 @@ export class TwoClickPolygonMode extends GeoJsonEditMode {
97
96
  guides.features.push({
98
97
  type: 'Feature',
99
98
  properties: {
100
- shape: polygon.properties && polygon.properties.shape,
99
+ ...polygon.properties,
101
100
  guideType: 'tentative'
102
101
  },
103
102
  geometry: polygon.geometry
@@ -18,6 +18,7 @@ export type Pick = {
18
18
  index: number;
19
19
  object?: any;
20
20
  isGuide?: boolean;
21
+ featureType?: string;
21
22
  featureIndex?: number;
22
23
  type?: string;
23
24
  isEditingHandle?: boolean | null;
@@ -8,10 +8,11 @@ import destination from '@turf/destination';
8
8
  import bearing from '@turf/bearing';
9
9
  import pointToLineDistance from '@turf/point-to-line-distance';
10
10
  import {flattenEach} from '@turf/meta';
11
- import {point, MultiLineString} from '@turf/helpers';
11
+ import type {MultiLineString} from '@turf/helpers';
12
+ import {point} from '@turf/helpers';
12
13
  import {getCoords} from '@turf/invariant';
13
- import WebMercatorViewport from 'viewport-mercator-project';
14
- import {Viewport, Pick, EditHandleFeature, EditHandleType} from './types';
14
+ import {WebMercatorViewport} from 'viewport-mercator-project';
15
+ import {Viewport, Pick, EditHandleFeature, EditHandleType, StartDraggingEvent} from './types';
15
16
  import {
16
17
  Geometry,
17
18
  Position,
@@ -516,3 +517,7 @@ export function mapCoords(
516
517
  })
517
518
  .filter(Boolean);
518
519
  }
520
+
521
+ export function shouldCancelPan(event: StartDraggingEvent) {
522
+ return event.picks.length && event.picks.find((p) => p.featureType === 'points');
523
+ }
@@ -40,6 +40,7 @@ import {Draw90DegreePolygonMode} from '../edit-modes/draw-90degree-polygon-mode'
40
40
  import {DrawPolygonByDraggingMode} from '../edit-modes/draw-polygon-by-dragging-mode';
41
41
  import {SnappableMode} from '../edit-modes/snappable-mode';
42
42
  import {TransformMode} from '../edit-modes/transform-mode';
43
+ import {DeleteMode} from '../edit-modes/delete-mode';
43
44
  import {GeoJsonEditModeType} from '../edit-modes/geojson-edit-mode';
44
45
 
45
46
  import {Color} from '../utils/types';
@@ -112,7 +113,7 @@ function getEditHandleRadius(handle) {
112
113
  }
113
114
  }
114
115
 
115
- export type EditableGeojsonLayerProps<DataT = any> = EditableLayerProps & {
116
+ export type EditableGeoJsonLayerProps<DataT = any> = EditableLayerProps & {
116
117
  data: DataT;
117
118
  mode?: any;
118
119
  modeConfig?: any;
@@ -172,7 +173,7 @@ export type EditableGeojsonLayerProps<DataT = any> = EditableLayerProps & {
172
173
  billboard?: boolean;
173
174
  };
174
175
 
175
- const defaultProps: DefaultProps<EditableGeojsonLayerProps<any>> = {
176
+ const defaultProps: DefaultProps<EditableGeoJsonLayerProps<any>> = {
176
177
  mode: DEFAULT_EDIT_MODE,
177
178
 
178
179
  // Edit and interaction events
@@ -250,6 +251,7 @@ const modeNameMapping = {
250
251
  split: SplitPolygonMode,
251
252
  extrude: ExtrudeMode,
252
253
  elevation: ElevationMode,
254
+ delete: DeleteMode,
253
255
 
254
256
  // Draw modes
255
257
  drawPoint: DrawPointMode,
@@ -270,7 +272,7 @@ const modeNameMapping = {
270
272
 
271
273
  export class EditableGeoJsonLayer extends EditableLayer<
272
274
  FeatureCollection,
273
- EditableGeojsonLayerProps<FeatureCollection>
275
+ EditableGeoJsonLayerProps<FeatureCollection>
274
276
  > {
275
277
  static layerName = 'EditableGeoJsonLayer';
276
278
  static defaultProps = defaultProps;
@@ -411,7 +413,7 @@ export class EditableGeoJsonLayer extends EditableLayer<
411
413
  this.setState({selectedFeatures});
412
414
  }
413
415
 
414
- getModeProps(props: EditableGeojsonLayerProps<any>) {
416
+ getModeProps(props: EditableGeoJsonLayerProps<any>) {
415
417
  return {
416
418
  modeConfig: props.modeConfig,
417
419
  data: props.data,
@@ -4,8 +4,8 @@
4
4
 
5
5
  /* eslint-env browser */
6
6
 
7
+ import type {DefaultProps} from '@deck.gl/core';
7
8
  import {H3ClusterLayer} from '@deck.gl/geo-layers';
8
- import {DefaultProps} from '@deck.gl/core';
9
9
  // TODO: Fix H3 support.
10
10
  // import { polyfill, geoToH3 } from 'h3-js';
11
11
  import {PROJECTED_PIXEL_SIZE_MULTIPLIER} from '../constants';