@deck.gl-community/editable-layers 9.2.0-beta.6 → 9.2.5

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 (316) hide show
  1. package/dist/edit-modes/draw-90degree-polygon-mode.d.ts +2 -2
  2. package/dist/edit-modes/draw-90degree-polygon-mode.d.ts.map +1 -1
  3. package/dist/edit-modes/draw-90degree-polygon-mode.js.map +1 -1
  4. package/dist/edit-modes/draw-circle-by-diameter-mode.d.ts +2 -2
  5. package/dist/edit-modes/draw-circle-by-diameter-mode.d.ts.map +1 -1
  6. package/dist/edit-modes/draw-circle-by-diameter-mode.js +0 -1
  7. package/dist/edit-modes/draw-circle-by-diameter-mode.js.map +1 -1
  8. package/dist/edit-modes/draw-circle-from-center-mode.d.ts +2 -2
  9. package/dist/edit-modes/draw-circle-from-center-mode.d.ts.map +1 -1
  10. package/dist/edit-modes/draw-circle-from-center-mode.js +0 -1
  11. package/dist/edit-modes/draw-circle-from-center-mode.js.map +1 -1
  12. package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.d.ts +2 -2
  13. package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.d.ts.map +1 -1
  14. package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.js +1 -2
  15. package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.js.map +1 -1
  16. package/dist/edit-modes/draw-ellipse-using-three-points-mode.d.ts +2 -2
  17. package/dist/edit-modes/draw-ellipse-using-three-points-mode.d.ts.map +1 -1
  18. package/dist/edit-modes/draw-ellipse-using-three-points-mode.js +0 -2
  19. package/dist/edit-modes/draw-ellipse-using-three-points-mode.js.map +1 -1
  20. package/dist/edit-modes/draw-line-string-mode.d.ts +5 -5
  21. package/dist/edit-modes/draw-line-string-mode.d.ts.map +1 -1
  22. package/dist/edit-modes/draw-line-string-mode.js.map +1 -1
  23. package/dist/edit-modes/draw-point-mode.d.ts +2 -2
  24. package/dist/edit-modes/draw-point-mode.d.ts.map +1 -1
  25. package/dist/edit-modes/draw-point-mode.js.map +1 -1
  26. package/dist/edit-modes/draw-polygon-by-dragging-mode.d.ts +8 -8
  27. package/dist/edit-modes/draw-polygon-by-dragging-mode.d.ts.map +1 -1
  28. package/dist/edit-modes/draw-polygon-by-dragging-mode.js.map +1 -1
  29. package/dist/edit-modes/draw-polygon-mode.d.ts +5 -5
  30. package/dist/edit-modes/draw-polygon-mode.d.ts.map +1 -1
  31. package/dist/edit-modes/draw-polygon-mode.js +48 -52
  32. package/dist/edit-modes/draw-polygon-mode.js.map +1 -1
  33. package/dist/edit-modes/draw-rectangle-from-center-mode.d.ts +2 -2
  34. package/dist/edit-modes/draw-rectangle-from-center-mode.d.ts.map +1 -1
  35. package/dist/edit-modes/draw-rectangle-from-center-mode.js +0 -1
  36. package/dist/edit-modes/draw-rectangle-from-center-mode.js.map +1 -1
  37. package/dist/edit-modes/draw-rectangle-mode.d.ts +2 -2
  38. package/dist/edit-modes/draw-rectangle-mode.d.ts.map +1 -1
  39. package/dist/edit-modes/draw-rectangle-mode.js +0 -1
  40. package/dist/edit-modes/draw-rectangle-mode.js.map +1 -1
  41. package/dist/edit-modes/draw-rectangle-using-three-points-mode.d.ts +2 -2
  42. package/dist/edit-modes/draw-rectangle-using-three-points-mode.d.ts.map +1 -1
  43. package/dist/edit-modes/draw-square-from-center-mode.d.ts +2 -2
  44. package/dist/edit-modes/draw-square-from-center-mode.d.ts.map +1 -1
  45. package/dist/edit-modes/draw-square-from-center-mode.js +0 -1
  46. package/dist/edit-modes/draw-square-from-center-mode.js.map +1 -1
  47. package/dist/edit-modes/draw-square-mode.d.ts +2 -2
  48. package/dist/edit-modes/draw-square-mode.d.ts.map +1 -1
  49. package/dist/edit-modes/draw-square-mode.js +0 -1
  50. package/dist/edit-modes/draw-square-mode.js.map +1 -1
  51. package/dist/edit-modes/duplicate-mode.d.ts +2 -2
  52. package/dist/edit-modes/duplicate-mode.d.ts.map +1 -1
  53. package/dist/edit-modes/duplicate-mode.js.map +1 -1
  54. package/dist/edit-modes/extend-line-string-mode.d.ts +4 -4
  55. package/dist/edit-modes/extend-line-string-mode.d.ts.map +1 -1
  56. package/dist/edit-modes/extend-line-string-mode.js.map +1 -1
  57. package/dist/edit-modes/extrude-mode.d.ts +7 -7
  58. package/dist/edit-modes/extrude-mode.d.ts.map +1 -1
  59. package/dist/edit-modes/extrude-mode.js.map +1 -1
  60. package/dist/edit-modes/geojson-edit-mode.d.ts +9 -9
  61. package/dist/edit-modes/geojson-edit-mode.d.ts.map +1 -1
  62. package/dist/edit-modes/geojson-edit-mode.js +4 -7
  63. package/dist/edit-modes/geojson-edit-mode.js.map +1 -1
  64. package/dist/edit-modes/immutable-feature-collection.d.ts +7 -7
  65. package/dist/edit-modes/immutable-feature-collection.d.ts.map +1 -1
  66. package/dist/edit-modes/immutable-feature-collection.js.map +1 -1
  67. package/dist/edit-modes/measure-area-mode.d.ts +3 -3
  68. package/dist/edit-modes/measure-area-mode.d.ts.map +1 -1
  69. package/dist/edit-modes/measure-area-mode.js.map +1 -1
  70. package/dist/edit-modes/modify-mode.d.ts +8 -8
  71. package/dist/edit-modes/modify-mode.d.ts.map +1 -1
  72. package/dist/edit-modes/modify-mode.js +25 -23
  73. package/dist/edit-modes/modify-mode.js.map +1 -1
  74. package/dist/edit-modes/resize-circle-mode.d.ts +3 -3
  75. package/dist/edit-modes/resize-circle-mode.d.ts.map +1 -1
  76. package/dist/edit-modes/resize-circle-mode.js +1 -5
  77. package/dist/edit-modes/resize-circle-mode.js.map +1 -1
  78. package/dist/edit-modes/rotate-mode.d.ts +7 -7
  79. package/dist/edit-modes/rotate-mode.d.ts.map +1 -1
  80. package/dist/edit-modes/rotate-mode.js +2 -9
  81. package/dist/edit-modes/rotate-mode.js.map +1 -1
  82. package/dist/edit-modes/scale-mode.d.ts +11 -11
  83. package/dist/edit-modes/scale-mode.d.ts.map +1 -1
  84. package/dist/edit-modes/scale-mode.js +1 -6
  85. package/dist/edit-modes/scale-mode.js.map +1 -1
  86. package/dist/edit-modes/snappable-mode.d.ts +5 -5
  87. package/dist/edit-modes/snappable-mode.d.ts.map +1 -1
  88. package/dist/edit-modes/snappable-mode.js.map +1 -1
  89. package/dist/edit-modes/split-polygon-mode.d.ts +5 -5
  90. package/dist/edit-modes/split-polygon-mode.d.ts.map +1 -1
  91. package/dist/edit-modes/split-polygon-mode.js +2 -5
  92. package/dist/edit-modes/split-polygon-mode.js.map +1 -1
  93. package/dist/edit-modes/three-click-polygon-mode.d.ts +3 -3
  94. package/dist/edit-modes/three-click-polygon-mode.d.ts.map +1 -1
  95. package/dist/edit-modes/three-click-polygon-mode.js +14 -18
  96. package/dist/edit-modes/three-click-polygon-mode.js.map +1 -1
  97. package/dist/edit-modes/translate-mode.d.ts +6 -6
  98. package/dist/edit-modes/translate-mode.d.ts.map +1 -1
  99. package/dist/edit-modes/translate-mode.js +1 -2
  100. package/dist/edit-modes/translate-mode.js.map +1 -1
  101. package/dist/edit-modes/two-click-polygon-mode.d.ts +6 -6
  102. package/dist/edit-modes/two-click-polygon-mode.d.ts.map +1 -1
  103. package/dist/edit-modes/two-click-polygon-mode.js.map +1 -1
  104. package/dist/edit-modes/types.d.ts +3 -3
  105. package/dist/edit-modes/types.d.ts.map +1 -1
  106. package/dist/edit-modes/utils.d.ts +7 -7
  107. package/dist/edit-modes/utils.d.ts.map +1 -1
  108. package/dist/edit-modes/utils.js +1 -4
  109. package/dist/edit-modes/utils.js.map +1 -1
  110. package/dist/editable-layers/editable-geojson-layer.d.ts +5 -13
  111. package/dist/editable-layers/editable-geojson-layer.d.ts.map +1 -1
  112. package/dist/editable-layers/editable-geojson-layer.js +20 -4
  113. package/dist/editable-layers/editable-geojson-layer.js.map +1 -1
  114. package/dist/editable-layers/selection-layer.d.ts +1 -2
  115. package/dist/editable-layers/selection-layer.d.ts.map +1 -1
  116. package/dist/editable-layers/selection-layer.js +2 -2
  117. package/dist/editable-layers/selection-layer.js.map +1 -1
  118. package/dist/index.cjs +430 -989
  119. package/dist/index.cjs.map +4 -4
  120. package/dist/index.d.ts +5 -11
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.js +2 -10
  123. package/dist/index.js.map +1 -1
  124. package/dist/mode-handlers/composite-mode-handler.d.ts +3 -3
  125. package/dist/mode-handlers/composite-mode-handler.d.ts.map +1 -1
  126. package/dist/mode-handlers/composite-mode-handler.js.map +1 -1
  127. package/dist/mode-handlers/draw-90degree-polygon-handler.d.ts.map +1 -1
  128. package/dist/mode-handlers/draw-90degree-polygon-handler.js +4 -2
  129. package/dist/mode-handlers/draw-90degree-polygon-handler.js.map +1 -1
  130. package/dist/mode-handlers/draw-circle-by-bounding-box-handler.d.ts.map +1 -1
  131. package/dist/mode-handlers/draw-circle-by-bounding-box-handler.js +0 -1
  132. package/dist/mode-handlers/draw-circle-by-bounding-box-handler.js.map +1 -1
  133. package/dist/mode-handlers/draw-circle-from-center-handler.d.ts.map +1 -1
  134. package/dist/mode-handlers/draw-circle-from-center-handler.js +0 -1
  135. package/dist/mode-handlers/draw-circle-from-center-handler.js.map +1 -1
  136. package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.d.ts.map +1 -1
  137. package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.js +1 -2
  138. package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.js.map +1 -1
  139. package/dist/mode-handlers/draw-ellipse-using-three-points-handler.d.ts.map +1 -1
  140. package/dist/mode-handlers/draw-ellipse-using-three-points-handler.js +2 -2
  141. package/dist/mode-handlers/draw-ellipse-using-three-points-handler.js.map +1 -1
  142. package/dist/mode-handlers/draw-point-handler.js.map +1 -1
  143. package/dist/mode-handlers/draw-polygon-handler.d.ts.map +1 -1
  144. package/dist/mode-handlers/draw-polygon-handler.js +4 -2
  145. package/dist/mode-handlers/draw-polygon-handler.js.map +1 -1
  146. package/dist/mode-handlers/draw-rectangle-handler.d.ts.map +1 -1
  147. package/dist/mode-handlers/draw-rectangle-handler.js +0 -1
  148. package/dist/mode-handlers/draw-rectangle-handler.js.map +1 -1
  149. package/dist/mode-handlers/draw-rectangle-using-three-points-handler.d.ts.map +1 -1
  150. package/dist/mode-handlers/draw-rectangle-using-three-points-handler.js +4 -2
  151. package/dist/mode-handlers/draw-rectangle-using-three-points-handler.js.map +1 -1
  152. package/dist/mode-handlers/mode-handler.d.ts +12 -12
  153. package/dist/mode-handlers/mode-handler.d.ts.map +1 -1
  154. package/dist/mode-handlers/mode-handler.js +6 -7
  155. package/dist/mode-handlers/mode-handler.js.map +1 -1
  156. package/dist/mode-handlers/modify-handler.d.ts +2 -2
  157. package/dist/mode-handlers/modify-handler.d.ts.map +1 -1
  158. package/dist/mode-handlers/modify-handler.js +1 -4
  159. package/dist/mode-handlers/modify-handler.js.map +1 -1
  160. package/dist/mode-handlers/rotate-handler.d.ts +2 -2
  161. package/dist/mode-handlers/rotate-handler.d.ts.map +1 -1
  162. package/dist/mode-handlers/rotate-handler.js +2 -7
  163. package/dist/mode-handlers/rotate-handler.js.map +1 -1
  164. package/dist/mode-handlers/scale-handler.d.ts +2 -2
  165. package/dist/mode-handlers/scale-handler.d.ts.map +1 -1
  166. package/dist/mode-handlers/scale-handler.js +2 -7
  167. package/dist/mode-handlers/scale-handler.js.map +1 -1
  168. package/dist/mode-handlers/snappable-handler.d.ts +3 -3
  169. package/dist/mode-handlers/snappable-handler.d.ts.map +1 -1
  170. package/dist/mode-handlers/snappable-handler.js.map +1 -1
  171. package/dist/mode-handlers/split-polygon-handler.d.ts.map +1 -1
  172. package/dist/mode-handlers/split-polygon-handler.js +4 -5
  173. package/dist/mode-handlers/split-polygon-handler.js.map +1 -1
  174. package/dist/mode-handlers/translate-handler.d.ts +2 -2
  175. package/dist/mode-handlers/translate-handler.d.ts.map +1 -1
  176. package/dist/mode-handlers/translate-handler.js +1 -4
  177. package/dist/mode-handlers/translate-handler.js.map +1 -1
  178. package/dist/utils/geojson-types.d.ts +13 -34
  179. package/dist/utils/geojson-types.d.ts.map +1 -1
  180. package/dist/utils/translate-from-center.d.ts +2 -4
  181. package/dist/utils/translate-from-center.d.ts.map +1 -1
  182. package/dist/utils/translate-from-center.js.map +1 -1
  183. package/dist/utils/utils.d.ts +3 -3
  184. package/dist/utils/utils.d.ts.map +1 -1
  185. package/dist/utils/utils.js +1 -1
  186. package/dist/utils/utils.js.map +1 -1
  187. package/dist/widgets/edit-mode-tray-widget.d.ts +1 -0
  188. package/dist/widgets/edit-mode-tray-widget.d.ts.map +1 -1
  189. package/dist/widgets/edit-mode-tray-widget.js +1 -0
  190. package/dist/widgets/edit-mode-tray-widget.js.map +1 -1
  191. package/dist/widgets/editor-toolbar-widget.d.ts +40 -0
  192. package/dist/widgets/editor-toolbar-widget.d.ts.map +1 -0
  193. package/dist/widgets/editor-toolbar-widget.js +170 -0
  194. package/dist/widgets/editor-toolbar-widget.js.map +1 -0
  195. package/package.json +47 -44
  196. package/src/edit-modes/draw-90degree-polygon-mode.ts +8 -2
  197. package/src/edit-modes/draw-circle-by-diameter-mode.ts +3 -3
  198. package/src/edit-modes/draw-circle-from-center-mode.ts +3 -3
  199. package/src/edit-modes/draw-ellipse-by-bounding-box-mode.ts +4 -4
  200. package/src/edit-modes/draw-ellipse-using-three-points-mode.ts +3 -4
  201. package/src/edit-modes/draw-line-string-mode.ts +10 -5
  202. package/src/edit-modes/draw-point-mode.ts +2 -2
  203. package/src/edit-modes/draw-polygon-by-dragging-mode.ts +8 -8
  204. package/src/edit-modes/draw-polygon-mode.ts +103 -124
  205. package/src/edit-modes/draw-rectangle-from-center-mode.ts +2 -3
  206. package/src/edit-modes/draw-rectangle-mode.ts +2 -3
  207. package/src/edit-modes/draw-rectangle-using-three-points-mode.ts +2 -2
  208. package/src/edit-modes/draw-square-from-center-mode.ts +2 -3
  209. package/src/edit-modes/draw-square-mode.ts +2 -3
  210. package/src/edit-modes/duplicate-mode.ts +2 -2
  211. package/src/edit-modes/extend-line-string-mode.ts +11 -4
  212. package/src/edit-modes/extrude-mode.ts +7 -7
  213. package/src/edit-modes/geojson-edit-mode.ts +28 -19
  214. package/src/edit-modes/immutable-feature-collection.ts +10 -11
  215. package/src/edit-modes/measure-area-mode.ts +3 -3
  216. package/src/edit-modes/modify-mode.ts +42 -30
  217. package/src/edit-modes/resize-circle-mode.ts +10 -7
  218. package/src/edit-modes/rotate-mode.ts +11 -22
  219. package/src/edit-modes/scale-mode.ts +14 -19
  220. package/src/edit-modes/snappable-mode.ts +10 -5
  221. package/src/edit-modes/split-polygon-mode.ts +17 -15
  222. package/src/edit-modes/three-click-polygon-mode.ts +30 -33
  223. package/src/edit-modes/translate-mode.ts +15 -12
  224. package/src/edit-modes/two-click-polygon-mode.ts +13 -7
  225. package/src/edit-modes/types.ts +4 -4
  226. package/src/edit-modes/utils.ts +13 -17
  227. package/src/editable-layers/editable-geojson-layer.ts +35 -18
  228. package/src/editable-layers/selection-layer.ts +3 -3
  229. package/src/index.ts +11 -28
  230. package/src/mode-handlers/composite-mode-handler.ts +3 -3
  231. package/src/mode-handlers/draw-90degree-polygon-handler.ts +4 -2
  232. package/src/mode-handlers/draw-circle-by-bounding-box-handler.ts +0 -1
  233. package/src/mode-handlers/draw-circle-from-center-handler.ts +0 -1
  234. package/src/mode-handlers/draw-ellipse-by-bounding-box-handler.ts +1 -2
  235. package/src/mode-handlers/draw-ellipse-using-three-points-handler.ts +3 -2
  236. package/src/mode-handlers/draw-point-handler.ts +2 -2
  237. package/src/mode-handlers/draw-polygon-handler.ts +4 -2
  238. package/src/mode-handlers/draw-rectangle-handler.ts +0 -1
  239. package/src/mode-handlers/draw-rectangle-using-three-points-handler.ts +4 -2
  240. package/src/mode-handlers/mode-handler.ts +34 -20
  241. package/src/mode-handlers/modify-handler.ts +2 -4
  242. package/src/mode-handlers/rotate-handler.ts +5 -12
  243. package/src/mode-handlers/scale-handler.ts +6 -14
  244. package/src/mode-handlers/snappable-handler.ts +3 -3
  245. package/src/mode-handlers/split-polygon-handler.ts +8 -7
  246. package/src/mode-handlers/translate-handler.ts +3 -5
  247. package/src/utils/geojson-types.ts +31 -54
  248. package/src/utils/translate-from-center.ts +13 -31
  249. package/src/utils/utils.ts +5 -5
  250. package/src/widgets/edit-mode-tray-widget.tsx +2 -6
  251. package/src/widgets/editor-toolbar-widget.tsx +348 -0
  252. package/dist/lib/constants.d.ts +0 -7
  253. package/dist/lib/constants.d.ts.map +0 -1
  254. package/dist/lib/constants.js +0 -10
  255. package/dist/lib/constants.js.map +0 -1
  256. package/dist/lib/deck-renderer/deck-cache.d.ts +0 -15
  257. package/dist/lib/deck-renderer/deck-cache.d.ts.map +0 -1
  258. package/dist/lib/deck-renderer/deck-cache.js +0 -52
  259. package/dist/lib/deck-renderer/deck-cache.js.map +0 -1
  260. package/dist/lib/deck-renderer/deck-drawer.d.ts +0 -63
  261. package/dist/lib/deck-renderer/deck-drawer.d.ts.map +0 -1
  262. package/dist/lib/deck-renderer/deck-drawer.js +0 -233
  263. package/dist/lib/deck-renderer/deck-drawer.js.map +0 -1
  264. package/dist/lib/feature.d.ts +0 -11
  265. package/dist/lib/feature.d.ts.map +0 -1
  266. package/dist/lib/feature.js +0 -20
  267. package/dist/lib/feature.js.map +0 -1
  268. package/dist/lib/layer-mouse-event.d.ts +0 -12
  269. package/dist/lib/layer-mouse-event.d.ts.map +0 -1
  270. package/dist/lib/layer-mouse-event.js +0 -28
  271. package/dist/lib/layer-mouse-event.js.map +0 -1
  272. package/dist/lib/layers/junctions-layer.d.ts +0 -9
  273. package/dist/lib/layers/junctions-layer.d.ts.map +0 -1
  274. package/dist/lib/layers/junctions-layer.js +0 -37
  275. package/dist/lib/layers/junctions-layer.js.map +0 -1
  276. package/dist/lib/layers/segments-layer.d.ts +0 -19
  277. package/dist/lib/layers/segments-layer.d.ts.map +0 -1
  278. package/dist/lib/layers/segments-layer.js +0 -98
  279. package/dist/lib/layers/segments-layer.js.map +0 -1
  280. package/dist/lib/layers/texts-layer.d.ts +0 -9
  281. package/dist/lib/layers/texts-layer.d.ts.map +0 -1
  282. package/dist/lib/layers/texts-layer.js +0 -36
  283. package/dist/lib/layers/texts-layer.js.map +0 -1
  284. package/dist/lib/math.d.ts +0 -12
  285. package/dist/lib/math.d.ts.map +0 -1
  286. package/dist/lib/math.js +0 -26
  287. package/dist/lib/math.js.map +0 -1
  288. package/dist/lib/nebula-core.d.ts +0 -35
  289. package/dist/lib/nebula-core.d.ts.map +0 -1
  290. package/dist/lib/nebula-core.js +0 -258
  291. package/dist/lib/nebula-core.js.map +0 -1
  292. package/dist/lib/nebula-layer.d.ts +0 -14
  293. package/dist/lib/nebula-layer.d.ts.map +0 -1
  294. package/dist/lib/nebula-layer.js +0 -30
  295. package/dist/lib/nebula-layer.js.map +0 -1
  296. package/dist/lib/style.d.ts +0 -20
  297. package/dist/lib/style.d.ts.map +0 -1
  298. package/dist/lib/style.js +0 -24
  299. package/dist/lib/style.js.map +0 -1
  300. package/dist/utils/curve-utils.d.ts +0 -3
  301. package/dist/utils/curve-utils.d.ts.map +0 -1
  302. package/dist/utils/curve-utils.js +0 -65
  303. package/dist/utils/curve-utils.js.map +0 -1
  304. package/src/lib/constants.ts +0 -10
  305. package/src/lib/deck-renderer/deck-cache.ts +0 -61
  306. package/src/lib/deck-renderer/deck-drawer.ts +0 -263
  307. package/src/lib/feature.ts +0 -31
  308. package/src/lib/layer-mouse-event.ts +0 -33
  309. package/src/lib/layers/junctions-layer.ts +0 -44
  310. package/src/lib/layers/segments-layer.ts +0 -112
  311. package/src/lib/layers/texts-layer.ts +0 -47
  312. package/src/lib/math.ts +0 -30
  313. package/src/lib/nebula-core.ts +0 -327
  314. package/src/lib/nebula-layer.ts +0 -37
  315. package/src/lib/style.ts +0 -26
  316. package/src/utils/curve-utils.ts +0 -81
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {Feature, FeatureCollection, Position} from '../utils/geojson-types';
5
+ import {SimpleFeature, SimpleFeatureCollection, Position} from '../utils/geojson-types';
6
6
  import {PointerMoveEvent, StartDraggingEvent, StopDraggingEvent} from '../edit-modes/types';
7
7
  import {
8
8
  EditHandle,
@@ -25,7 +25,7 @@ export class SnappableHandler extends ModeHandler {
25
25
  this._handler = handler;
26
26
  }
27
27
 
28
- setFeatureCollection(featureCollection: FeatureCollection): void {
28
+ setFeatureCollection(featureCollection: SimpleFeatureCollection): void {
29
29
  this._handler.setFeatureCollection(featureCollection);
30
30
  }
31
31
 
@@ -88,7 +88,7 @@ export class SnappableHandler extends ModeHandler {
88
88
  // method will return those features along with the features
89
89
  // that live in the current layer. Otherwise, this method will simply return the
90
90
  // features from the current layer
91
- _getSnapTargets(): Feature[] {
91
+ _getSnapTargets(): SimpleFeature[] {
92
92
  let {additionalSnapTargets} = this.getModeConfig() || {};
93
93
  additionalSnapTargets = additionalSnapTargets || [];
94
94
 
@@ -6,16 +6,16 @@ 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} from '@turf/helpers';
9
+ import {feature as turfFeature, featureCollection, lineString} from '@turf/helpers';
10
10
  import turfBearing from '@turf/bearing';
11
11
  import turfDistance from '@turf/distance';
12
12
  import turfDestination from '@turf/destination';
13
13
  import turfPolygonToLine from '@turf/polygon-to-line';
14
- import type {NearestPointOnLine} from '@turf/nearest-point-on-line';
15
14
  import nearestPointOnLine from '@turf/nearest-point-on-line';
16
15
  import {generatePointsParallelToLinePoints} from '../utils/utils';
17
16
  import {EditAction, ModeHandler} from './mode-handler';
18
17
  import {ClickEvent, PointerMoveEvent} from '../edit-modes/types';
18
+ import {PolygonGeometry} from '../utils/geojson-types';
19
19
 
20
20
  // TODO edit-modes: delete handlers once EditMode fully implemented
21
21
  export class SplitPolygonHandler extends ModeHandler {
@@ -33,7 +33,7 @@ export class SplitPolygonHandler extends ModeHandler {
33
33
 
34
34
  const lines = feature.type === 'FeatureCollection' ? feature.features : [feature];
35
35
  let minDistance = Number.MAX_SAFE_INTEGER;
36
- let closestPoint: NearestPointOnLine | null = null;
36
+ let closestPoint: ReturnType<typeof nearestPointOnLine> | null = null;
37
37
  // If Multipolygon, then we should find nearest polygon line and stick split to it.
38
38
  lines.forEach((line) => {
39
39
  const snapPoint = nearestPointOnLine(line, firstPoint);
@@ -120,7 +120,8 @@ export class SplitPolygonHandler extends ModeHandler {
120
120
  geometry: {
121
121
  type: 'LineString',
122
122
  coordinates: [...clickSequence, this.calculateMapCoords(clickSequence, mapCoords)]
123
- }
123
+ },
124
+ properties: {}
124
125
  });
125
126
 
126
127
  return result;
@@ -138,10 +139,10 @@ export class SplitPolygonHandler extends ModeHandler {
138
139
  gap = 0.1;
139
140
  units = 'centimeters';
140
141
  }
141
- // @ts-expect-error turf type diff
142
142
  const buffer = turfBuffer(tentativeFeature, gap, {units});
143
- // @ts-expect-error turf type diff
144
- const updatedGeometry = turfDifference(selectedGeometry, buffer);
143
+ const updatedGeometry = turfDifference(
144
+ featureCollection([turfFeature(selectedGeometry as PolygonGeometry), buffer])
145
+ );
145
146
  this._setTentativeFeature(null);
146
147
  if (!updatedGeometry) {
147
148
  // eslint-disable-next-line no-console,no-undef
@@ -6,13 +6,13 @@ import turfBearing from '@turf/bearing';
6
6
  import turfDistance from '@turf/distance';
7
7
  import turfTransformTranslate from '@turf/transform-translate';
8
8
  import {point} from '@turf/helpers';
9
- import {FeatureCollection, Position} from '../utils/geojson-types';
9
+ import {SimpleFeatureCollection, Position} from '../utils/geojson-types';
10
10
  import {PointerMoveEvent, StartDraggingEvent, StopDraggingEvent} from '../edit-modes/types';
11
11
  import {EditAction, ModeHandler} from './mode-handler';
12
12
 
13
13
  // TODO edit-modes: delete handlers once EditMode fully implemented
14
14
  export class TranslateHandler extends ModeHandler {
15
- _geometryBeforeTranslate: FeatureCollection | null | undefined;
15
+ _geometryBeforeTranslate: SimpleFeatureCollection | null | undefined;
16
16
  _isTranslatable: boolean = undefined!;
17
17
 
18
18
  handlePointerMove(event: PointerMoveEvent): {
@@ -87,9 +87,7 @@ export class TranslateHandler extends ModeHandler {
87
87
  const distanceMoved = turfDistance(p1, p2);
88
88
  const direction = turfBearing(p1, p2);
89
89
 
90
- // @ts-expect-error turf type diff
91
- const movedFeatures: FeatureCollection = turfTransformTranslate(
92
- // @ts-expect-error turf type diff
90
+ const movedFeatures: SimpleFeatureCollection = turfTransformTranslate(
93
91
  this._geometryBeforeTranslate,
94
92
  distanceMoved,
95
93
  direction
@@ -2,8 +2,6 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- // Geometry types
6
-
7
5
  import type {
8
6
  Point,
9
7
  LineString,
@@ -11,64 +9,43 @@ import type {
11
9
  MultiPoint,
12
10
  MultiLineString,
13
11
  MultiPolygon,
14
- Position
12
+ Position,
13
+ Feature,
14
+ FeatureCollection
15
15
  } from 'geojson';
16
16
 
17
- export {Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, Position};
18
-
19
- export type PointCoordinates = Position;
20
- export type LineStringCoordinates = Position[];
21
- export type PolygonCoordinates = Position[][];
22
- export type MultiPointCoordinates = Position[];
23
- export type MultiLineStringCoordinates = Position[][];
24
- export type MultiPolygonCoordinates = Position[][][];
25
-
26
- export type AnyCoordinates =
27
- | PointCoordinates
28
- | LineStringCoordinates
29
- | PolygonCoordinates
30
- | MultiPointCoordinates
31
- | MultiLineStringCoordinates
32
- | MultiPolygonCoordinates;
33
-
34
- export type Geometry = Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon;
35
-
36
- export type Polygonal = Polygon | MultiPolygon;
37
-
38
- // Feature types
17
+ export {
18
+ Point,
19
+ LineString,
20
+ Polygon,
21
+ MultiPoint,
22
+ MultiLineString,
23
+ MultiPolygon,
24
+ Position,
25
+ Feature,
26
+ FeatureCollection
27
+ };
39
28
 
40
- export type BoundingBoxArray = [number, number, number, number];
29
+ /** Simple geometries (excludes GeometryCollection) */
30
+ export type SimpleGeometry =
31
+ | Point
32
+ | LineString
33
+ | Polygon
34
+ | MultiPoint
35
+ | MultiLineString
36
+ | MultiPolygon;
41
37
 
42
- export type FeatureOf<T extends Geometry> = {
43
- type: 'Feature';
44
- geometry: T;
45
- properties?: {
46
- [key: string]: any;
47
- };
48
- id?: string | number;
49
- bbox?: BoundingBoxArray;
50
- };
38
+ /** Feature with any geometry except GeometryCollection */
39
+ export type SimpleFeature = Feature<SimpleGeometry>;
51
40
 
52
- export type FeatureWithProps<T extends Geometry, P> = {
53
- type: 'Feature';
54
- geometry: T;
55
- properties: P;
56
- };
41
+ /** FeatureCollection with any geometries except GeometryCollection */
42
+ export type SimpleFeatureCollection = FeatureCollection<SimpleGeometry>;
57
43
 
58
- export type Feature =
59
- | FeatureOf<Point>
60
- | FeatureOf<LineString>
61
- | FeatureOf<Polygon>
62
- | FeatureOf<MultiPoint>
63
- | FeatureOf<MultiLineString>
64
- | FeatureOf<MultiPolygon>;
44
+ /** Coordinates of any geometry except GeometryCollection */
45
+ export type SimpleGeometryCoordinates = SimpleGeometry['coordinates'];
65
46
 
66
- export type FeatureCollection = {
67
- type: 'FeatureCollection';
68
- features: Feature[];
69
- properties?: {};
70
- id?: string | number;
71
- bbox?: BoundingBoxArray;
72
- };
47
+ /** Polygon and MultiPolygon geometries */
48
+ export type PolygonGeometry = Polygon | MultiPolygon;
73
49
 
50
+ /** A Feature or FeatureCollection */
74
51
  export type AnyGeoJson = Feature | FeatureCollection;
@@ -6,45 +6,27 @@ import turfCenter from '@turf/center';
6
6
  import turfRhumbBearing from '@turf/rhumb-bearing';
7
7
  import turfRhumbDistance from '@turf/rhumb-distance';
8
8
  import turfRhumbDestination from '@turf/rhumb-destination';
9
- import type {
10
- Position as TurfPosition,
11
- Feature as TurfFeature,
12
- Geometry as TurfGeometry
13
- } from '@turf/helpers';
14
9
  import {mapCoords} from '../edit-modes/utils';
15
- import type {AnyCoordinates /* , Position */} from './geojson-types';
10
+ import type {SimpleFeature} from './geojson-types';
16
11
 
17
12
  // This function takes feature's center, moves it,
18
13
  // and builds new feature around it keeping the proportions
19
- export function translateFromCenter(
20
- feature: TurfFeature<TurfGeometry>,
21
- distance: number,
22
- direction: number
23
- ) {
24
- const initialCenterPoint = turfCenter(feature as TurfFeature);
14
+ export function translateFromCenter(feature: SimpleFeature, distance: number, direction: number) {
15
+ const initialCenterPoint = turfCenter(feature);
25
16
 
26
17
  const movedCenterPoint = turfRhumbDestination(initialCenterPoint, distance, direction);
27
18
 
28
- const movedCoordinates = mapCoords(
29
- feature.geometry.coordinates as AnyCoordinates,
30
- (coordinate) => {
31
- const rhumbDistance = turfRhumbDistance(
32
- initialCenterPoint.geometry.coordinates,
33
- coordinate as TurfPosition
34
- );
35
- const rhumbDirection = turfRhumbBearing(
36
- initialCenterPoint.geometry.coordinates,
37
- coordinate as TurfPosition
38
- );
19
+ const movedCoordinates = mapCoords(feature.geometry.coordinates, (coordinate) => {
20
+ const rhumbDistance = turfRhumbDistance(initialCenterPoint.geometry.coordinates, coordinate);
21
+ const rhumbDirection = turfRhumbBearing(initialCenterPoint.geometry.coordinates, coordinate);
39
22
 
40
- const movedPosition = turfRhumbDestination(
41
- movedCenterPoint.geometry.coordinates,
42
- rhumbDistance,
43
- rhumbDirection
44
- ).geometry.coordinates;
45
- return movedPosition;
46
- }
47
- );
23
+ const movedPosition = turfRhumbDestination(
24
+ movedCenterPoint.geometry.coordinates,
25
+ rhumbDistance,
26
+ rhumbDirection
27
+ ).geometry.coordinates;
28
+ return movedPosition;
29
+ });
48
30
 
49
31
  feature.geometry.coordinates = movedCoordinates;
50
32
 
@@ -6,13 +6,13 @@ import destination from '@turf/destination';
6
6
  import bearing from '@turf/bearing';
7
7
  import pointToLineDistance from '@turf/point-to-line-distance';
8
8
  import {point} from '@turf/helpers';
9
- import {WebMercatorViewport} from 'viewport-mercator-project';
10
- import {FeatureOf, FeatureWithProps, LineString, Point, Position} from './geojson-types';
9
+ import {WebMercatorViewport} from '@math.gl/web-mercator';
10
+ import {Feature, LineString, Point, Position} from './geojson-types';
11
11
  import {Viewport} from './types';
12
12
 
13
13
  // TODO edit-modes: delete and use edit-modes/utils instead
14
14
 
15
- export type NearestPointType = FeatureWithProps<Point, {dist: number; index: number}>;
15
+ export type NearestPointType = Feature<Point, {dist: number; index: number}>;
16
16
 
17
17
  export function toDeckColor(
18
18
  color?: [number, number, number, number] | number,
@@ -106,8 +106,8 @@ export function mix(a: number, b: number, ratio: number): number {
106
106
  }
107
107
 
108
108
  export function nearestPointOnProjectedLine(
109
- line: FeatureOf<LineString>,
110
- inPoint: FeatureOf<Point>,
109
+ line: Feature<LineString>,
110
+ inPoint: Feature<Point>,
111
111
  viewport: Viewport
112
112
  ): NearestPointType {
113
113
  const wmViewport = new WebMercatorViewport(viewport);
@@ -4,12 +4,7 @@
4
4
 
5
5
  import {render} from 'preact';
6
6
  import type {ComponentChild, JSX} from 'preact';
7
- import {
8
- Widget,
9
- type WidgetProps,
10
- type WidgetPlacement,
11
- type Deck
12
- } from '@deck.gl/core';
7
+ import {Widget, type WidgetProps, type WidgetPlacement, type Deck} from '@deck.gl/core';
13
8
  import type {
14
9
  GeoJsonEditModeConstructor,
15
10
  GeoJsonEditModeType
@@ -106,6 +101,7 @@ const BUTTON_LABEL_STYLE: JSX.CSSProperties = {
106
101
  export class EditModeTrayWidget extends Widget<EditModeTrayWidgetProps> {
107
102
  static override defaultProps = {
108
103
  id: 'edit-mode-tray',
104
+ _container: null,
109
105
  placement: 'top-left',
110
106
  layout: 'vertical',
111
107
  modes: [],
@@ -0,0 +1,348 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {render} from 'preact';
6
+ import type {JSX} from 'preact';
7
+ import {Widget, type WidgetProps, type WidgetPlacement, type Deck} from '@deck.gl/core';
8
+
9
+ export type BooleanOperation = 'union' | 'difference' | 'intersection' | null;
10
+
11
+ export type EditorToolbarWidgetProps = WidgetProps & {
12
+ /** Placement for the widget root element. */
13
+ placement?: WidgetPlacement;
14
+ /** Currently active boolean operation. */
15
+ booleanOperation?: BooleanOperation;
16
+ /** Number of features in the current dataset. */
17
+ featureCount?: number;
18
+ /** Callback fired when the user selects a boolean operation. */
19
+ onSetBooleanOperation?: (op: BooleanOperation) => void;
20
+ /** Callback fired when the user clicks the clear button. */
21
+ onClear?: () => void;
22
+ /** Callback fired when the user clicks the export button. */
23
+ onExport?: () => void;
24
+ };
25
+
26
+ // --- Styles (match EditModeTrayWidget visual language) ---
27
+
28
+ const ROOT_STYLE: Partial<CSSStyleDeclaration> = {
29
+ position: 'absolute',
30
+ display: 'flex',
31
+ flexDirection: 'column',
32
+ gap: '6px',
33
+ pointerEvents: 'auto',
34
+ userSelect: 'none',
35
+ zIndex: '99'
36
+ };
37
+
38
+ const TRAY_STYLE: JSX.CSSProperties = {
39
+ display: 'flex',
40
+ gap: '4px',
41
+ background: 'rgba(36, 40, 41, 0.88)',
42
+ borderRadius: '999px',
43
+ padding: '5px 8px',
44
+ alignItems: 'center',
45
+ justifyContent: 'center',
46
+ boxShadow: '0 4px 12px rgba(0, 0, 0, 0.25)'
47
+ };
48
+
49
+ const BUTTON_STYLE: JSX.CSSProperties = {
50
+ appearance: 'none',
51
+ background: 'transparent',
52
+ border: 'none',
53
+ color: '#f0f0f0',
54
+ height: '30px',
55
+ padding: '0 8px',
56
+ display: 'flex',
57
+ alignItems: 'center',
58
+ justifyContent: 'center',
59
+ gap: '4px',
60
+ borderRadius: '15px',
61
+ cursor: 'pointer',
62
+ fontSize: '11px',
63
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
64
+ fontWeight: '500',
65
+ transition: 'background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease',
66
+ whiteSpace: 'nowrap'
67
+ };
68
+
69
+ const BUTTON_ACTIVE_STYLE: JSX.CSSProperties = {
70
+ background: '#0071e3',
71
+ color: '#ffffff',
72
+ boxShadow: '0 0 0 2px rgba(255, 255, 255, 0.35)'
73
+ };
74
+
75
+ const DIVIDER_STYLE: JSX.CSSProperties = {
76
+ width: '1px',
77
+ height: '20px',
78
+ background: 'rgba(255, 255, 255, 0.2)',
79
+ margin: '0 2px',
80
+ flexShrink: '0'
81
+ };
82
+
83
+ const BADGE_STYLE: JSX.CSSProperties = {
84
+ color: 'rgba(255, 255, 255, 0.6)',
85
+ fontSize: '11px',
86
+ padding: '0 6px',
87
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
88
+ whiteSpace: 'nowrap'
89
+ };
90
+
91
+ // --- SVG Icons (14x14) ---
92
+
93
+ function PencilIcon() {
94
+ return (
95
+ <svg
96
+ width="14"
97
+ height="14"
98
+ viewBox="0 0 14 14"
99
+ fill="none"
100
+ stroke="currentColor"
101
+ strokeWidth="1.5"
102
+ strokeLinecap="round"
103
+ strokeLinejoin="round"
104
+ >
105
+ <path d="M10 1.5l2.5 2.5L4.5 12H2v-2.5z" />
106
+ </svg>
107
+ );
108
+ }
109
+
110
+ function SubtractIcon() {
111
+ return (
112
+ <svg
113
+ width="14"
114
+ height="14"
115
+ viewBox="0 0 14 14"
116
+ fill="none"
117
+ stroke="currentColor"
118
+ strokeWidth="1.1"
119
+ >
120
+ <rect x="1" y="1" width="8" height="8" rx="1.5" />
121
+ <rect x="5" y="5" width="8" height="8" rx="1.5" fill="rgba(36,40,41,0.88)" />
122
+ </svg>
123
+ );
124
+ }
125
+
126
+ function UnionIcon() {
127
+ return (
128
+ <svg
129
+ width="14"
130
+ height="14"
131
+ viewBox="0 0 14 14"
132
+ fill="none"
133
+ stroke="currentColor"
134
+ strokeWidth="1.1"
135
+ >
136
+ <rect x="1" y="1" width="8" height="8" rx="1.5" />
137
+ <rect x="5" y="5" width="8" height="8" rx="1.5" />
138
+ </svg>
139
+ );
140
+ }
141
+
142
+ function IntersectIcon() {
143
+ return (
144
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" strokeWidth="1.1">
145
+ <rect x="1" y="1" width="8" height="8" rx="1.5" stroke="currentColor" opacity="0.4" />
146
+ <rect x="5" y="5" width="8" height="8" rx="1.5" stroke="currentColor" opacity="0.4" />
147
+ <rect x="5" y="5" width="4" height="4" fill="currentColor" opacity="0.6" />
148
+ </svg>
149
+ );
150
+ }
151
+
152
+ function TrashIcon() {
153
+ return (
154
+ <svg
155
+ width="14"
156
+ height="14"
157
+ viewBox="0 0 14 14"
158
+ fill="none"
159
+ stroke="currentColor"
160
+ strokeWidth="1.3"
161
+ strokeLinecap="round"
162
+ strokeLinejoin="round"
163
+ >
164
+ <path d="M2.5 4h9M5.5 4V2.5h3V4M3.5 4l.5 8h6l.5-8" />
165
+ </svg>
166
+ );
167
+ }
168
+
169
+ function DownloadIcon() {
170
+ return (
171
+ <svg
172
+ width="14"
173
+ height="14"
174
+ viewBox="0 0 14 14"
175
+ fill="none"
176
+ stroke="currentColor"
177
+ strokeWidth="1.3"
178
+ strokeLinecap="round"
179
+ strokeLinejoin="round"
180
+ >
181
+ <path d="M7 2v7M4.5 6.5L7 9l2.5-2.5M2.5 11.5h9" />
182
+ </svg>
183
+ );
184
+ }
185
+
186
+ // --- Widget ---
187
+
188
+ const BOOLEAN_OPS: Array<{
189
+ op: BooleanOperation;
190
+ icon: () => JSX.Element;
191
+ label: string;
192
+ title: string;
193
+ }> = [
194
+ {op: null, icon: PencilIcon, label: 'Edit', title: 'Draw new features'},
195
+ {op: 'difference', icon: SubtractIcon, label: 'Sub', title: 'Subtract from selection'},
196
+ {op: 'union', icon: UnionIcon, label: 'Union', title: 'Union with selection'},
197
+ {op: 'intersection', icon: IntersectIcon, label: 'Sect', title: 'Intersect with selection'}
198
+ ];
199
+
200
+ export class EditorToolbarWidget extends Widget<EditorToolbarWidgetProps> {
201
+ static override defaultProps = {
202
+ id: 'editor-toolbar',
203
+ _container: null,
204
+ placement: 'bottom-left',
205
+ booleanOperation: null,
206
+ featureCount: 0,
207
+ style: {},
208
+ className: ''
209
+ } satisfies Required<WidgetProps> &
210
+ Required<Pick<EditorToolbarWidgetProps, 'placement'>> &
211
+ EditorToolbarWidgetProps;
212
+
213
+ placement: WidgetPlacement = 'bottom-left';
214
+ className = 'deck-widget-editor-toolbar';
215
+ deck?: Deck | null = null;
216
+ private appliedCustomClassName: string | null = null;
217
+
218
+ constructor(props: EditorToolbarWidgetProps = {}) {
219
+ super({...EditorToolbarWidget.defaultProps, ...props});
220
+ this.placement = props.placement ?? EditorToolbarWidget.defaultProps.placement;
221
+ }
222
+
223
+ override setProps(props: Partial<EditorToolbarWidgetProps>): void {
224
+ if (props.placement !== undefined) {
225
+ this.placement = props.placement;
226
+ }
227
+ super.setProps(props);
228
+ this.renderToolbar();
229
+ }
230
+
231
+ override onAdd({deck}: {deck: Deck}): void {
232
+ this.deck = deck;
233
+ }
234
+
235
+ override onRemove(): void {
236
+ this.deck = null;
237
+ const root = this.rootElement;
238
+ if (root) {
239
+ render(null, root);
240
+ }
241
+ this.rootElement = null;
242
+ }
243
+
244
+ override onRenderHTML(rootElement: HTMLElement): void {
245
+ const style = {...ROOT_STYLE, ...this.props.style};
246
+ Object.assign(rootElement.style, style);
247
+ if (this.appliedCustomClassName && this.appliedCustomClassName !== this.props.className) {
248
+ rootElement.classList.remove(this.appliedCustomClassName);
249
+ this.appliedCustomClassName = null;
250
+ }
251
+ if (this.props.className) {
252
+ rootElement.classList.add(this.props.className);
253
+ this.appliedCustomClassName = this.props.className;
254
+ }
255
+ rootElement.classList.add(this.className);
256
+ this.renderToolbar();
257
+ }
258
+
259
+ private renderToolbar() {
260
+ const root = this.rootElement;
261
+ if (!root) {
262
+ return;
263
+ }
264
+
265
+ const booleanOp = this.props.booleanOperation ?? null;
266
+ const featureCount = this.props.featureCount ?? 0;
267
+
268
+ const stopEvent = (event: Event) => {
269
+ event.stopPropagation();
270
+ if (typeof (event as any).stopImmediatePropagation === 'function') {
271
+ (event as any).stopImmediatePropagation();
272
+ }
273
+ };
274
+
275
+ const ui = (
276
+ <div
277
+ style={TRAY_STYLE}
278
+ onPointerDown={stopEvent}
279
+ onPointerMove={stopEvent}
280
+ onPointerUp={stopEvent}
281
+ onMouseDown={stopEvent}
282
+ onMouseMove={stopEvent}
283
+ onMouseUp={stopEvent}
284
+ onTouchStart={stopEvent}
285
+ onTouchMove={stopEvent}
286
+ onTouchEnd={stopEvent}
287
+ >
288
+ {/* Boolean operation toggle buttons */}
289
+ {BOOLEAN_OPS.map(({op, icon: Icon, label, title}) => {
290
+ const active = booleanOp === op;
291
+ return (
292
+ <button
293
+ key={label}
294
+ type="button"
295
+ title={title}
296
+ aria-pressed={active}
297
+ style={{...BUTTON_STYLE, ...(active ? BUTTON_ACTIVE_STYLE : {})}}
298
+ onClick={(event) => {
299
+ stopEvent(event);
300
+ this.props.onSetBooleanOperation?.(op);
301
+ }}
302
+ >
303
+ <Icon />
304
+ <span>{label}</span>
305
+ </button>
306
+ );
307
+ })}
308
+
309
+ <div style={DIVIDER_STYLE} />
310
+
311
+ {/* Clear button */}
312
+ <button
313
+ type="button"
314
+ title="Clear all features"
315
+ style={BUTTON_STYLE}
316
+ onClick={(event) => {
317
+ stopEvent(event);
318
+ this.props.onClear?.();
319
+ }}
320
+ >
321
+ <TrashIcon />
322
+ </button>
323
+
324
+ {/* Export button */}
325
+ <button
326
+ type="button"
327
+ title="Download as GeoJSON"
328
+ style={BUTTON_STYLE}
329
+ onClick={(event) => {
330
+ stopEvent(event);
331
+ this.props.onExport?.();
332
+ }}
333
+ >
334
+ <DownloadIcon />
335
+ </button>
336
+
337
+ <div style={DIVIDER_STYLE} />
338
+
339
+ {/* Feature count badge */}
340
+ <span style={BADGE_STYLE}>
341
+ {featureCount} feature{featureCount !== 1 ? 's' : ''}
342
+ </span>
343
+ </div>
344
+ );
345
+
346
+ render(ui, root);
347
+ }
348
+ }
@@ -1,7 +0,0 @@
1
- /**
2
- * A multiplier for screen-space width/scale for Arc, Line, Icon and Text layers.
3
- * Required in order to maintain the same appearance after upgrading to deck.gl v8.5.
4
- * https://github.com/visgl/deck.gl/blob/master/docs/upgrade-guide.md
5
- */
6
- export declare const PROJECTED_PIXEL_SIZE_MULTIPLIER: number;
7
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,QAAQ,CAAC"}