@deck.gl-community/editable-layers 9.0.0-alpha.1 → 9.0.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 (389) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +2 -81
  3. package/dist/constants.d.ts +1 -0
  4. package/dist/constants.d.ts.map +1 -0
  5. package/dist/constants.js +4 -1
  6. package/dist/edit-modes/composite-mode.d.ts +4 -3
  7. package/dist/edit-modes/composite-mode.d.ts.map +1 -0
  8. package/dist/edit-modes/composite-mode.js +5 -2
  9. package/dist/edit-modes/draw-90degree-polygon-mode.d.ts +4 -3
  10. package/dist/edit-modes/draw-90degree-polygon-mode.d.ts.map +1 -0
  11. package/dist/edit-modes/draw-90degree-polygon-mode.js +30 -25
  12. package/dist/edit-modes/draw-circle-by-diameter-mode.d.ts +4 -3
  13. package/dist/edit-modes/draw-circle-by-diameter-mode.d.ts.map +1 -0
  14. package/dist/edit-modes/draw-circle-by-diameter-mode.js +9 -6
  15. package/dist/edit-modes/draw-circle-from-center-mode.d.ts +4 -3
  16. package/dist/edit-modes/draw-circle-from-center-mode.d.ts.map +1 -0
  17. package/dist/edit-modes/draw-circle-from-center-mode.js +8 -5
  18. package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.d.ts +3 -2
  19. package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.d.ts.map +1 -0
  20. package/dist/edit-modes/draw-ellipse-by-bounding-box-mode.js +5 -2
  21. package/dist/edit-modes/draw-ellipse-using-three-points-mode.d.ts +3 -2
  22. package/dist/edit-modes/draw-ellipse-using-three-points-mode.d.ts.map +1 -0
  23. package/dist/edit-modes/draw-ellipse-using-three-points-mode.js +5 -2
  24. package/dist/edit-modes/draw-line-string-mode.d.ts +4 -3
  25. package/dist/edit-modes/draw-line-string-mode.d.ts.map +1 -0
  26. package/dist/edit-modes/draw-line-string-mode.js +21 -18
  27. package/dist/edit-modes/draw-point-mode.d.ts +4 -3
  28. package/dist/edit-modes/draw-point-mode.d.ts.map +1 -0
  29. package/dist/edit-modes/draw-point-mode.js +8 -5
  30. package/dist/edit-modes/draw-polygon-by-dragging-mode.d.ts +4 -3
  31. package/dist/edit-modes/draw-polygon-by-dragging-mode.d.ts.map +1 -0
  32. package/dist/edit-modes/draw-polygon-by-dragging-mode.js +12 -7
  33. package/dist/edit-modes/draw-polygon-mode.d.ts +4 -3
  34. package/dist/edit-modes/draw-polygon-mode.d.ts.map +1 -0
  35. package/dist/edit-modes/draw-polygon-mode.js +22 -18
  36. package/dist/edit-modes/draw-rectangle-from-center-mode.d.ts +3 -2
  37. package/dist/edit-modes/draw-rectangle-from-center-mode.d.ts.map +1 -0
  38. package/dist/edit-modes/draw-rectangle-from-center-mode.js +4 -1
  39. package/dist/edit-modes/draw-rectangle-mode.d.ts +3 -2
  40. package/dist/edit-modes/draw-rectangle-mode.d.ts.map +1 -0
  41. package/dist/edit-modes/draw-rectangle-mode.js +4 -1
  42. package/dist/edit-modes/draw-rectangle-using-three-points-mode.d.ts +3 -2
  43. package/dist/edit-modes/draw-rectangle-using-three-points-mode.d.ts.map +1 -0
  44. package/dist/edit-modes/draw-rectangle-using-three-points-mode.js +10 -7
  45. package/dist/edit-modes/draw-square-from-center-mode.d.ts +3 -2
  46. package/dist/edit-modes/draw-square-from-center-mode.d.ts.map +1 -0
  47. package/dist/edit-modes/draw-square-from-center-mode.js +4 -1
  48. package/dist/edit-modes/draw-square-mode.d.ts +3 -2
  49. package/dist/edit-modes/draw-square-mode.d.ts.map +1 -0
  50. package/dist/edit-modes/draw-square-mode.js +4 -1
  51. package/dist/edit-modes/duplicate-mode.d.ts +4 -3
  52. package/dist/edit-modes/duplicate-mode.d.ts.map +1 -0
  53. package/dist/edit-modes/duplicate-mode.js +4 -1
  54. package/dist/edit-modes/edit-mode.d.ts +2 -1
  55. package/dist/edit-modes/edit-mode.d.ts.map +1 -0
  56. package/dist/edit-modes/edit-mode.js +3 -1
  57. package/dist/edit-modes/elevation-mode.d.ts +5 -4
  58. package/dist/edit-modes/elevation-mode.d.ts.map +1 -0
  59. package/dist/edit-modes/elevation-mode.js +10 -7
  60. package/dist/edit-modes/extend-line-string-mode.d.ts +4 -3
  61. package/dist/edit-modes/extend-line-string-mode.d.ts.map +1 -0
  62. package/dist/edit-modes/extend-line-string-mode.js +11 -8
  63. package/dist/edit-modes/extrude-mode.d.ts +4 -3
  64. package/dist/edit-modes/extrude-mode.d.ts.map +1 -0
  65. package/dist/edit-modes/extrude-mode.js +12 -9
  66. package/dist/edit-modes/geojson-edit-mode.d.ts +4 -3
  67. package/dist/edit-modes/geojson-edit-mode.d.ts.map +1 -0
  68. package/dist/edit-modes/geojson-edit-mode.js +20 -17
  69. package/dist/edit-modes/immutable-feature-collection.d.ts +3 -1
  70. package/dist/edit-modes/immutable-feature-collection.d.ts.map +1 -0
  71. package/dist/edit-modes/immutable-feature-collection.js +25 -20
  72. package/dist/edit-modes/measure-angle-mode.d.ts +4 -3
  73. package/dist/edit-modes/measure-angle-mode.d.ts.map +1 -0
  74. package/dist/edit-modes/measure-angle-mode.js +9 -9
  75. package/dist/edit-modes/measure-area-mode.d.ts +4 -3
  76. package/dist/edit-modes/measure-area-mode.d.ts.map +1 -0
  77. package/dist/edit-modes/measure-area-mode.js +8 -6
  78. package/dist/edit-modes/measure-distance-mode.d.ts +4 -3
  79. package/dist/edit-modes/measure-distance-mode.d.ts.map +1 -0
  80. package/dist/edit-modes/measure-distance-mode.js +19 -16
  81. package/dist/edit-modes/modify-mode.d.ts +5 -4
  82. package/dist/edit-modes/modify-mode.d.ts.map +1 -0
  83. package/dist/edit-modes/modify-mode.js +19 -16
  84. package/dist/edit-modes/resize-circle-mode.d.ts +6 -5
  85. package/dist/edit-modes/resize-circle-mode.d.ts.map +1 -0
  86. package/dist/edit-modes/resize-circle-mode.js +6 -4
  87. package/dist/edit-modes/rotate-mode.d.ts +4 -3
  88. package/dist/edit-modes/rotate-mode.d.ts.map +1 -0
  89. package/dist/edit-modes/rotate-mode.js +11 -8
  90. package/dist/edit-modes/scale-mode.d.ts +4 -3
  91. package/dist/edit-modes/scale-mode.d.ts.map +1 -0
  92. package/dist/edit-modes/scale-mode.js +11 -8
  93. package/dist/edit-modes/snappable-mode.d.ts +4 -3
  94. package/dist/edit-modes/snappable-mode.d.ts.map +1 -0
  95. package/dist/edit-modes/snappable-mode.js +9 -6
  96. package/dist/edit-modes/split-polygon-mode.d.ts +4 -3
  97. package/dist/edit-modes/split-polygon-mode.d.ts.map +1 -0
  98. package/dist/edit-modes/split-polygon-mode.js +15 -12
  99. package/dist/edit-modes/three-click-polygon-mode.d.ts +4 -3
  100. package/dist/edit-modes/three-click-polygon-mode.d.ts.map +1 -0
  101. package/dist/edit-modes/three-click-polygon-mode.js +10 -7
  102. package/dist/edit-modes/transform-mode.d.ts +4 -3
  103. package/dist/edit-modes/transform-mode.d.ts.map +1 -0
  104. package/dist/edit-modes/transform-mode.js +8 -5
  105. package/dist/edit-modes/translate-mode.d.ts +4 -3
  106. package/dist/edit-modes/translate-mode.d.ts.map +1 -0
  107. package/dist/edit-modes/translate-mode.js +10 -7
  108. package/dist/edit-modes/two-click-polygon-mode.d.ts +4 -3
  109. package/dist/edit-modes/two-click-polygon-mode.d.ts.map +1 -0
  110. package/dist/edit-modes/two-click-polygon-mode.js +10 -7
  111. package/dist/edit-modes/types.d.ts +2 -1
  112. package/dist/edit-modes/types.d.ts.map +1 -0
  113. package/dist/edit-modes/types.js +3 -0
  114. package/dist/edit-modes/utils.d.ts +3 -2
  115. package/dist/edit-modes/utils.d.ts.map +1 -0
  116. package/dist/edit-modes/utils.js +22 -19
  117. package/dist/edit-modes/view-mode.d.ts +2 -1
  118. package/dist/edit-modes/view-mode.d.ts.map +1 -0
  119. package/dist/edit-modes/view-mode.js +4 -1
  120. package/dist/editable-layers/editable-geojson-layer.d.ts +7 -6
  121. package/dist/editable-layers/editable-geojson-layer.d.ts.map +1 -0
  122. package/dist/editable-layers/editable-geojson-layer.js +53 -52
  123. package/dist/editable-layers/editable-h3-cluster-layer.d.ts +3 -2
  124. package/dist/editable-layers/editable-h3-cluster-layer.d.ts.map +1 -0
  125. package/dist/editable-layers/editable-h3-cluster-layer.js +8 -5
  126. package/dist/editable-layers/editable-layer.d.ts +7 -6
  127. package/dist/editable-layers/editable-layer.d.ts.map +1 -0
  128. package/dist/editable-layers/editable-layer.js +18 -15
  129. package/dist/editable-layers/editable-path-layer.d.ts +2 -1
  130. package/dist/editable-layers/editable-path-layer.d.ts.map +1 -0
  131. package/dist/editable-layers/editable-path-layer.js +10 -7
  132. package/dist/editable-layers/elevated-edit-handle-layer.d.ts +2 -1
  133. package/dist/editable-layers/elevated-edit-handle-layer.d.ts.map +1 -0
  134. package/dist/editable-layers/elevated-edit-handle-layer.js +6 -3
  135. package/dist/editable-layers/junction-scatterplot-layer.d.ts +3 -2
  136. package/dist/editable-layers/junction-scatterplot-layer.d.ts.map +1 -0
  137. package/dist/editable-layers/junction-scatterplot-layer.js +10 -7
  138. package/dist/editable-layers/selection-layer.d.ts +2 -1
  139. package/dist/editable-layers/selection-layer.d.ts.map +1 -0
  140. package/dist/editable-layers/selection-layer.js +8 -5
  141. package/dist/index.cjs +70 -542
  142. package/dist/index.cjs.map +4 -4
  143. package/dist/index.d.ts +59 -59
  144. package/dist/index.d.ts.map +1 -0
  145. package/dist/index.js +56 -54
  146. package/dist/lib/constants.d.ts +1 -0
  147. package/dist/lib/constants.d.ts.map +1 -0
  148. package/dist/lib/constants.js +3 -0
  149. package/dist/lib/deck-renderer/deck-cache.d.ts +2 -1
  150. package/dist/lib/deck-renderer/deck-cache.d.ts.map +1 -0
  151. package/dist/lib/deck-renderer/deck-cache.js +1 -1
  152. package/dist/lib/deck-renderer/deck-drawer.d.ts +3 -3
  153. package/dist/lib/deck-renderer/deck-drawer.d.ts.map +1 -0
  154. package/dist/lib/deck-renderer/deck-drawer.js +12 -12
  155. package/dist/lib/feature.d.ts +5 -4
  156. package/dist/lib/feature.d.ts.map +1 -0
  157. package/dist/lib/feature.js +4 -1
  158. package/dist/lib/layer-mouse-event.d.ts +3 -2
  159. package/dist/lib/layer-mouse-event.d.ts.map +1 -0
  160. package/dist/lib/layer-mouse-event.js +4 -1
  161. package/dist/lib/layers/junctions-layer.d.ts +5 -4
  162. package/dist/lib/layers/junctions-layer.d.ts.map +1 -0
  163. package/dist/lib/layers/junctions-layer.js +10 -7
  164. package/dist/lib/layers/segments-layer.d.ts +5 -4
  165. package/dist/lib/layers/segments-layer.d.ts.map +1 -0
  166. package/dist/lib/layers/segments-layer.js +12 -9
  167. package/dist/lib/layers/texts-layer.d.ts +4 -3
  168. package/dist/lib/layers/texts-layer.d.ts.map +1 -0
  169. package/dist/lib/layers/texts-layer.js +9 -6
  170. package/dist/lib/math.d.ts +2 -1
  171. package/dist/lib/math.d.ts.map +1 -0
  172. package/dist/lib/math.js +3 -0
  173. package/dist/lib/{nebula.d.ts → nebula-core.d.ts} +3 -2
  174. package/dist/lib/nebula-core.d.ts.map +1 -0
  175. package/dist/lib/{nebula.js → nebula-core.js} +7 -4
  176. package/dist/lib/nebula-layer.d.ts +3 -2
  177. package/dist/lib/nebula-layer.d.ts.map +1 -0
  178. package/dist/lib/nebula-layer.js +4 -1
  179. package/dist/lib/style.d.ts +1 -0
  180. package/dist/lib/style.d.ts.map +1 -0
  181. package/dist/lib/style.js +5 -2
  182. package/dist/mode-handlers/composite-mode-handler.d.ts +4 -3
  183. package/dist/mode-handlers/composite-mode-handler.d.ts.map +1 -0
  184. package/dist/mode-handlers/composite-mode-handler.js +1 -1
  185. package/dist/mode-handlers/draw-90degree-polygon-handler.d.ts +4 -3
  186. package/dist/mode-handlers/draw-90degree-polygon-handler.d.ts.map +1 -0
  187. package/dist/mode-handlers/draw-90degree-polygon-handler.js +13 -10
  188. package/dist/mode-handlers/draw-circle-by-bounding-box-handler.d.ts +4 -3
  189. package/dist/mode-handlers/draw-circle-by-bounding-box-handler.d.ts.map +1 -0
  190. package/dist/mode-handlers/draw-circle-by-bounding-box-handler.js +5 -2
  191. package/dist/mode-handlers/draw-circle-from-center-handler.d.ts +4 -3
  192. package/dist/mode-handlers/draw-circle-from-center-handler.d.ts.map +1 -0
  193. package/dist/mode-handlers/draw-circle-from-center-handler.js +4 -1
  194. package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.d.ts +4 -3
  195. package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.d.ts.map +1 -0
  196. package/dist/mode-handlers/draw-ellipse-by-bounding-box-handler.js +5 -2
  197. package/dist/mode-handlers/draw-ellipse-using-three-points-handler.d.ts +4 -3
  198. package/dist/mode-handlers/draw-ellipse-using-three-points-handler.d.ts.map +1 -0
  199. package/dist/mode-handlers/draw-ellipse-using-three-points-handler.js +7 -4
  200. package/dist/mode-handlers/draw-line-string-handler.d.ts +3 -2
  201. package/dist/mode-handlers/draw-line-string-handler.d.ts.map +1 -0
  202. package/dist/mode-handlers/draw-line-string-handler.js +8 -5
  203. package/dist/mode-handlers/draw-point-handler.d.ts +3 -2
  204. package/dist/mode-handlers/draw-point-handler.d.ts.map +1 -0
  205. package/dist/mode-handlers/draw-point-handler.js +5 -2
  206. package/dist/mode-handlers/draw-polygon-handler.d.ts +4 -3
  207. package/dist/mode-handlers/draw-polygon-handler.d.ts.map +1 -0
  208. package/dist/mode-handlers/draw-polygon-handler.js +10 -7
  209. package/dist/mode-handlers/draw-rectangle-handler.d.ts +4 -3
  210. package/dist/mode-handlers/draw-rectangle-handler.d.ts.map +1 -0
  211. package/dist/mode-handlers/draw-rectangle-handler.js +4 -1
  212. package/dist/mode-handlers/draw-rectangle-using-three-points-handler.d.ts +4 -3
  213. package/dist/mode-handlers/draw-rectangle-using-three-points-handler.d.ts.map +1 -0
  214. package/dist/mode-handlers/draw-rectangle-using-three-points-handler.js +12 -9
  215. package/dist/mode-handlers/duplicate-handler.d.ts +4 -3
  216. package/dist/mode-handlers/duplicate-handler.d.ts.map +1 -0
  217. package/dist/mode-handlers/duplicate-handler.js +4 -1
  218. package/dist/mode-handlers/elevation-handler.d.ts +6 -5
  219. package/dist/mode-handlers/elevation-handler.d.ts.map +1 -0
  220. package/dist/mode-handlers/elevation-handler.js +10 -7
  221. package/dist/mode-handlers/extrude-handler.d.ts +4 -3
  222. package/dist/mode-handlers/extrude-handler.d.ts.map +1 -0
  223. package/dist/mode-handlers/extrude-handler.js +12 -9
  224. package/dist/mode-handlers/mode-handler.d.ts +4 -3
  225. package/dist/mode-handlers/mode-handler.d.ts.map +1 -0
  226. package/dist/mode-handlers/mode-handler.js +18 -15
  227. package/dist/mode-handlers/modify-handler.d.ts +5 -4
  228. package/dist/mode-handlers/modify-handler.d.ts.map +1 -0
  229. package/dist/mode-handlers/modify-handler.js +18 -15
  230. package/dist/mode-handlers/rotate-handler.d.ts +4 -3
  231. package/dist/mode-handlers/rotate-handler.d.ts.map +1 -0
  232. package/dist/mode-handlers/rotate-handler.js +5 -2
  233. package/dist/mode-handlers/scale-handler.d.ts +4 -3
  234. package/dist/mode-handlers/scale-handler.d.ts.map +1 -0
  235. package/dist/mode-handlers/scale-handler.js +6 -3
  236. package/dist/mode-handlers/snappable-handler.d.ts +4 -3
  237. package/dist/mode-handlers/snappable-handler.d.ts.map +1 -0
  238. package/dist/mode-handlers/snappable-handler.js +6 -3
  239. package/dist/mode-handlers/split-polygon-handler.d.ts +3 -2
  240. package/dist/mode-handlers/split-polygon-handler.d.ts.map +1 -0
  241. package/dist/mode-handlers/split-polygon-handler.js +12 -9
  242. package/dist/mode-handlers/three-click-polygon-handler.d.ts +3 -2
  243. package/dist/mode-handlers/three-click-polygon-handler.d.ts.map +1 -0
  244. package/dist/mode-handlers/three-click-polygon-handler.js +4 -1
  245. package/dist/mode-handlers/translate-handler.d.ts +4 -3
  246. package/dist/mode-handlers/translate-handler.d.ts.map +1 -0
  247. package/dist/mode-handlers/translate-handler.js +5 -2
  248. package/dist/mode-handlers/two-click-polygon-handler.d.ts +3 -2
  249. package/dist/mode-handlers/two-click-polygon-handler.d.ts.map +1 -0
  250. package/dist/mode-handlers/two-click-polygon-handler.js +4 -1
  251. package/dist/mode-handlers/view-handler.d.ts +3 -2
  252. package/dist/mode-handlers/view-handler.d.ts.map +1 -0
  253. package/dist/mode-handlers/view-handler.js +4 -1
  254. package/dist/shaderlib/color/color.d.ts +8 -6
  255. package/dist/shaderlib/color/color.d.ts.map +1 -0
  256. package/dist/shaderlib/color/color.js +7 -4
  257. package/dist/shaderlib/utils/utils.d.ts +3 -2
  258. package/dist/shaderlib/utils/utils.d.ts.map +1 -0
  259. package/dist/shaderlib/utils/utils.js +5 -2
  260. package/dist/{curve-utils.d.ts → utils/curve-utils.d.ts} +1 -0
  261. package/dist/utils/curve-utils.d.ts.map +1 -0
  262. package/dist/{curve-utils.js → utils/curve-utils.js} +7 -4
  263. package/dist/{geojson-types.d.ts → utils/geojson-types.d.ts} +3 -25
  264. package/dist/utils/geojson-types.d.ts.map +1 -0
  265. package/dist/utils/geojson-types.js +4 -0
  266. package/dist/{memoize.d.ts → utils/memoize.d.ts} +2 -1
  267. package/dist/utils/memoize.d.ts.map +1 -0
  268. package/dist/{memoize.js → utils/memoize.js} +4 -1
  269. package/dist/{translateFromCenter.d.ts → utils/translate-from-center.d.ts} +1 -0
  270. package/dist/utils/translate-from-center.d.ts.map +1 -0
  271. package/dist/{translateFromCenter.js → utils/translate-from-center.js} +7 -4
  272. package/dist/{types.d.ts → utils/types.d.ts} +1 -0
  273. package/dist/utils/types.d.ts.map +1 -0
  274. package/dist/utils/types.js +4 -0
  275. package/dist/{utils.d.ts → utils/utils.d.ts} +5 -4
  276. package/dist/utils/utils.d.ts.map +1 -0
  277. package/dist/{utils.js → utils/utils.js} +11 -9
  278. package/package.json +11 -10
  279. package/src/constants.ts +5 -1
  280. package/src/edit-modes/composite-mode.ts +9 -5
  281. package/src/edit-modes/draw-90degree-polygon-mode.ts +38 -34
  282. package/src/edit-modes/draw-circle-by-diameter-mode.ts +16 -12
  283. package/src/edit-modes/draw-circle-from-center-mode.ts +15 -11
  284. package/src/edit-modes/draw-ellipse-by-bounding-box-mode.ts +8 -4
  285. package/src/edit-modes/draw-ellipse-using-three-points-mode.ts +9 -5
  286. package/src/edit-modes/draw-line-string-mode.ts +29 -25
  287. package/src/edit-modes/draw-point-mode.ts +13 -9
  288. package/src/edit-modes/draw-polygon-by-dragging-mode.ts +16 -16
  289. package/src/edit-modes/draw-polygon-mode.ts +28 -23
  290. package/src/edit-modes/draw-rectangle-from-center-mode.ts +6 -2
  291. package/src/edit-modes/draw-rectangle-mode.ts +6 -2
  292. package/src/edit-modes/draw-rectangle-using-three-points-mode.ts +12 -8
  293. package/src/edit-modes/draw-square-from-center-mode.ts +7 -3
  294. package/src/edit-modes/draw-square-mode.ts +7 -3
  295. package/src/edit-modes/duplicate-mode.ts +7 -3
  296. package/src/edit-modes/edit-mode.ts +5 -1
  297. package/src/edit-modes/elevation-mode.ts +13 -9
  298. package/src/edit-modes/extend-line-string-mode.ts +16 -12
  299. package/src/edit-modes/extrude-mode.ts +22 -18
  300. package/src/edit-modes/geojson-edit-mode.ts +37 -33
  301. package/src/edit-modes/immutable-feature-collection.ts +28 -22
  302. package/src/edit-modes/measure-angle-mode.ts +66 -59
  303. package/src/edit-modes/measure-area-mode.ts +13 -10
  304. package/src/edit-modes/measure-distance-mode.ts +37 -33
  305. package/src/edit-modes/modify-mode.ts +36 -32
  306. package/src/edit-modes/resize-circle-mode.ts +8 -5
  307. package/src/edit-modes/rotate-mode.ts +22 -18
  308. package/src/edit-modes/scale-mode.ts +29 -23
  309. package/src/edit-modes/snappable-mode.ts +19 -15
  310. package/src/edit-modes/split-polygon-mode.ts +25 -21
  311. package/src/edit-modes/three-click-polygon-mode.ts +15 -11
  312. package/src/edit-modes/transform-mode.ts +15 -11
  313. package/src/edit-modes/translate-mode.ts +15 -11
  314. package/src/edit-modes/two-click-polygon-mode.ts +15 -11
  315. package/src/edit-modes/types.ts +5 -1
  316. package/src/edit-modes/utils.ts +35 -30
  317. package/src/edit-modes/view-mode.ts +5 -1
  318. package/src/editable-layers/editable-geojson-layer.ts +44 -41
  319. package/src/editable-layers/editable-h3-cluster-layer.ts +17 -14
  320. package/src/editable-layers/editable-layer.ts +42 -32
  321. package/src/editable-layers/editable-path-layer.ts +12 -8
  322. package/src/editable-layers/elevated-edit-handle-layer.ts +11 -7
  323. package/src/editable-layers/junction-scatterplot-layer.ts +15 -11
  324. package/src/editable-layers/selection-layer.ts +11 -7
  325. package/src/index.ts +68 -65
  326. package/src/lib/constants.ts +4 -0
  327. package/src/lib/deck-renderer/deck-cache.ts +1 -1
  328. package/src/lib/deck-renderer/deck-drawer.ts +28 -28
  329. package/src/lib/feature.ts +7 -3
  330. package/src/lib/layer-mouse-event.ts +7 -6
  331. package/src/lib/layers/junctions-layer.ts +14 -10
  332. package/src/lib/layers/segments-layer.ts +24 -20
  333. package/src/lib/layers/texts-layer.ts +18 -14
  334. package/src/lib/math.ts +5 -1
  335. package/src/lib/{nebula.ts → nebula-core.ts} +8 -4
  336. package/src/lib/nebula-layer.ts +9 -5
  337. package/src/lib/style.ts +6 -2
  338. package/src/mode-handlers/composite-mode-handler.ts +6 -6
  339. package/src/mode-handlers/draw-90degree-polygon-handler.ts +22 -18
  340. package/src/mode-handlers/draw-circle-by-bounding-box-handler.ts +10 -6
  341. package/src/mode-handlers/draw-circle-from-center-handler.ts +10 -6
  342. package/src/mode-handlers/draw-ellipse-by-bounding-box-handler.ts +9 -5
  343. package/src/mode-handlers/draw-ellipse-using-three-points-handler.ts +12 -8
  344. package/src/mode-handlers/draw-line-string-handler.ts +12 -8
  345. package/src/mode-handlers/draw-point-handler.ts +9 -5
  346. package/src/mode-handlers/draw-polygon-handler.ts +16 -12
  347. package/src/mode-handlers/draw-rectangle-handler.ts +8 -4
  348. package/src/mode-handlers/draw-rectangle-using-three-points-handler.ts +17 -13
  349. package/src/mode-handlers/duplicate-handler.ts +8 -4
  350. package/src/mode-handlers/elevation-handler.ts +14 -10
  351. package/src/mode-handlers/extrude-handler.ts +15 -11
  352. package/src/mode-handlers/mode-handler.ts +26 -28
  353. package/src/mode-handlers/modify-handler.ts +29 -25
  354. package/src/mode-handlers/rotate-handler.ts +13 -17
  355. package/src/mode-handlers/scale-handler.ts +13 -13
  356. package/src/mode-handlers/snappable-handler.ts +28 -24
  357. package/src/mode-handlers/split-polygon-handler.ts +22 -18
  358. package/src/mode-handlers/three-click-polygon-handler.ts +6 -2
  359. package/src/mode-handlers/translate-handler.ts +12 -8
  360. package/src/mode-handlers/two-click-polygon-handler.ts +6 -2
  361. package/src/mode-handlers/view-handler.ts +7 -3
  362. package/src/shaderlib/color/color.ts +10 -5
  363. package/src/shaderlib/utils/utils.ts +6 -2
  364. package/src/{curve-utils.ts → utils/curve-utils.ts} +11 -7
  365. package/src/{geojson-types.ts → utils/geojson-types.ts} +16 -31
  366. package/src/{memoize.ts → utils/memoize.ts} +5 -1
  367. package/src/{translateFromCenter.ts → utils/translate-from-center.ts} +12 -8
  368. package/src/{types.ts → utils/types.ts} +4 -0
  369. package/src/{utils.ts → utils/utils.ts} +17 -14
  370. package/dist/editable-layers/path-marker-layer/arrow-2d-geometry.d.ts +0 -4
  371. package/dist/editable-layers/path-marker-layer/arrow-2d-geometry.js +0 -55
  372. package/dist/editable-layers/path-marker-layer/create-path-markers.d.ts +0 -16
  373. package/dist/editable-layers/path-marker-layer/create-path-markers.js +0 -75
  374. package/dist/editable-layers/path-marker-layer/path-marker-layer.d.ts +0 -40
  375. package/dist/editable-layers/path-marker-layer/path-marker-layer.js +0 -121
  376. package/dist/editable-layers/path-marker-layer/polyline.d.ts +0 -18
  377. package/dist/editable-layers/path-marker-layer/polyline.js +0 -37
  378. package/dist/editable-layers/path-outline-layer/path-outline-layer.d.ts +0 -26
  379. package/dist/editable-layers/path-outline-layer/path-outline-layer.js +0 -106
  380. package/dist/geojson-types.js +0 -2
  381. package/dist/shaderlib/outline/outline.d.ts +0 -8
  382. package/dist/shaderlib/outline/outline.js +0 -97
  383. package/dist/types.js +0 -1
  384. package/src/editable-layers/path-marker-layer/arrow-2d-geometry.ts +0 -61
  385. package/src/editable-layers/path-marker-layer/create-path-markers.ts +0 -107
  386. package/src/editable-layers/path-marker-layer/path-marker-layer.ts +0 -179
  387. package/src/editable-layers/path-marker-layer/polyline.ts +0 -40
  388. package/src/editable-layers/path-outline-layer/path-outline-layer.ts +0 -147
  389. package/src/shaderlib/outline/outline.ts +0 -101
@@ -1,3 +1,6 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import booleanPointInPolygon from '@turf/boolean-point-in-polygon';
2
5
  import turfDifference from '@turf/difference';
3
6
  import turfBuffer from '@turf/buffer';
@@ -8,8 +11,8 @@ import turfDistance from '@turf/distance';
8
11
  import turfDestination from '@turf/destination';
9
12
  import turfPolygonToLine from '@turf/polygon-to-line';
10
13
  import nearestPointOnLine from '@turf/nearest-point-on-line';
11
- import { generatePointsParallelToLinePoints } from '../utils';
12
- import { ModeHandler } from './mode-handler';
14
+ import { generatePointsParallelToLinePoints } from "../utils/utils.js";
15
+ import { ModeHandler } from "./mode-handler.js";
13
16
  // TODO edit-modes: delete handlers once EditMode fully implemented
14
17
  export class SplitPolygonHandler extends ModeHandler {
15
18
  calculateMapCoords(clickSequence, mapCoords) {
@@ -40,7 +43,7 @@ export class SplitPolygonHandler extends ModeHandler {
40
43
  const lastBearing = turfBearing(firstPoint, closestPoint);
41
44
  const currentDistance = turfDistance(firstPoint, mapCoords, { units: 'meters' });
42
45
  return turfDestination(firstPoint, currentDistance, lastBearing, {
43
- units: 'meters',
46
+ units: 'meters'
44
47
  }).geometry.coordinates;
45
48
  }
46
49
  return mapCoords;
@@ -56,7 +59,7 @@ export class SplitPolygonHandler extends ModeHandler {
56
59
  handleClick(event) {
57
60
  super.handleClick({
58
61
  ...event,
59
- mapCoords: this.calculateMapCoords(this.getClickSequence(), event.mapCoords),
62
+ mapCoords: this.calculateMapCoords(this.getClickSequence(), event.mapCoords)
60
63
  });
61
64
  const editAction = null;
62
65
  const tentativeFeature = this.getTentativeFeature();
@@ -70,7 +73,7 @@ export class SplitPolygonHandler extends ModeHandler {
70
73
  }
71
74
  const pt = {
72
75
  type: 'Point',
73
- coordinates: clickSequence[clickSequence.length - 1],
76
+ coordinates: clickSequence[clickSequence.length - 1]
74
77
  };
75
78
  // @ts-expect-error turf type diff
76
79
  const isPointInPolygon = booleanPointInPolygon(pt, selectedGeometry);
@@ -97,8 +100,8 @@ export class SplitPolygonHandler extends ModeHandler {
97
100
  type: 'Feature',
98
101
  geometry: {
99
102
  type: 'LineString',
100
- coordinates: [...clickSequence, this.calculateMapCoords(clickSequence, mapCoords)],
101
- },
103
+ coordinates: [...clickSequence, this.calculateMapCoords(clickSequence, mapCoords)]
104
+ }
102
105
  });
103
106
  return result;
104
107
  }
@@ -141,13 +144,13 @@ export class SplitPolygonHandler extends ModeHandler {
141
144
  // Update the type to Mulitpolygon
142
145
  const updatedData = this.getImmutableFeatureCollection().replaceGeometry(featureIndex, {
143
146
  type: 'MultiPolygon',
144
- coordinates: updatedCoordinates,
147
+ coordinates: updatedCoordinates
145
148
  });
146
149
  const editAction = {
147
150
  updatedData: updatedData.getObject(),
148
151
  editType: 'split',
149
152
  featureIndexes: [featureIndex],
150
- editContext: null,
153
+ editContext: null
151
154
  };
152
155
  return editAction;
153
156
  }
@@ -1,5 +1,6 @@
1
- import { ClickEvent } from '../edit-modes/types';
2
- import { ModeHandler, EditAction } from './mode-handler';
1
+ import { ClickEvent } from "../edit-modes/types.js";
2
+ import { ModeHandler, EditAction } from "./mode-handler.js";
3
3
  export declare class ThreeClickPolygonHandler extends ModeHandler {
4
4
  handleClick(event: ClickEvent): EditAction | null | undefined;
5
5
  }
6
+ //# sourceMappingURL=three-click-polygon-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"three-click-polygon-handler.d.ts","sourceRoot":"","sources":["../../src/mode-handlers/three-click-polygon-handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,+BAA4B;AAC/C,OAAO,EAAC,WAAW,EAAE,UAAU,EAAC,0BAAuB;AAGvD,qBAAa,wBAAyB,SAAQ,WAAW;IACvD,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS;CAmB9D"}
@@ -1,4 +1,7 @@
1
- import { ModeHandler } from './mode-handler';
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { ModeHandler } from "./mode-handler.js";
2
5
  // TODO edit-modes: delete handlers once EditMode fully implemented
3
6
  export class ThreeClickPolygonHandler extends ModeHandler {
4
7
  handleClick(event) {
@@ -1,6 +1,6 @@
1
- import { FeatureCollection, Position } from '../geojson-types';
2
- import { PointerMoveEvent, StartDraggingEvent, StopDraggingEvent } from '../edit-modes/types';
3
- import { EditAction, ModeHandler } from './mode-handler';
1
+ import { FeatureCollection, Position } from "../utils/geojson-types.js";
2
+ import { PointerMoveEvent, StartDraggingEvent, StopDraggingEvent } from "../edit-modes/types.js";
3
+ import { EditAction, ModeHandler } from "./mode-handler.js";
4
4
  export declare class TranslateHandler extends ModeHandler {
5
5
  _geometryBeforeTranslate: FeatureCollection | null | undefined;
6
6
  _isTranslatable: boolean;
@@ -15,3 +15,4 @@ export declare class TranslateHandler extends ModeHandler {
15
15
  }): string;
16
16
  getTranslateAction(startDragPoint: Position, currentPoint: Position, editType: string): EditAction | null | undefined;
17
17
  }
18
+ //# sourceMappingURL=translate-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate-handler.d.ts","sourceRoot":"","sources":["../../src/mode-handlers/translate-handler.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,iBAAiB,EAAE,QAAQ,EAAC,kCAA+B;AACnE,OAAO,EAAC,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAC,+BAA4B;AAC5F,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,0BAAuB;AAGvD,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,wBAAwB,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/D,eAAe,EAAE,OAAO,CAAc;IAEtC,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG;QAC1C,UAAU,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;QAC1C,YAAY,EAAE,OAAO,CAAC;KACvB;IAuBD,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS;IAS7E,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS;IAgB3E,SAAS,CAAC,EAAC,UAAU,EAAC,EAAE;QAAC,UAAU,EAAE,OAAO,CAAA;KAAC,GAAG,MAAM;IAOtD,kBAAkB,CAChB,cAAc,EAAE,QAAQ,EACxB,YAAY,EAAE,QAAQ,EACtB,QAAQ,EAAE,MAAM,GACf,UAAU,GAAG,IAAI,GAAG,SAAS;CAkCjC"}
@@ -1,8 +1,11 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import turfBearing from '@turf/bearing';
2
5
  import turfDistance from '@turf/distance';
3
6
  import turfTransformTranslate from '@turf/transform-translate';
4
7
  import { point } from '@turf/helpers';
5
- import { ModeHandler } from './mode-handler';
8
+ import { ModeHandler } from "./mode-handler.js";
6
9
  // TODO edit-modes: delete handlers once EditMode fully implemented
7
10
  export class TranslateHandler extends ModeHandler {
8
11
  _geometryBeforeTranslate;
@@ -66,7 +69,7 @@ export class TranslateHandler extends ModeHandler {
66
69
  updatedData: updatedData.getObject(),
67
70
  editType,
68
71
  featureIndexes: selectedIndexes,
69
- editContext: null,
72
+ editContext: null
70
73
  };
71
74
  }
72
75
  }
@@ -1,5 +1,6 @@
1
- import { ClickEvent } from '../edit-modes/types';
2
- import { ModeHandler, EditAction } from './mode-handler';
1
+ import { ClickEvent } from "../edit-modes/types.js";
2
+ import { ModeHandler, EditAction } from "./mode-handler.js";
3
3
  export declare class TwoClickPolygonHandler extends ModeHandler {
4
4
  handleClick(event: ClickEvent): EditAction | null | undefined;
5
5
  }
6
+ //# sourceMappingURL=two-click-polygon-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"two-click-polygon-handler.d.ts","sourceRoot":"","sources":["../../src/mode-handlers/two-click-polygon-handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,+BAA4B;AAC/C,OAAO,EAAC,WAAW,EAAE,UAAU,EAAC,0BAAuB;AAGvD,qBAAa,sBAAuB,SAAQ,WAAW;IACrD,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS;CAmB9D"}
@@ -1,4 +1,7 @@
1
- import { ModeHandler } from './mode-handler';
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { ModeHandler } from "./mode-handler.js";
2
5
  // TODO edit-modes: delete handlers once EditMode fully implemented
3
6
  export class TwoClickPolygonHandler extends ModeHandler {
4
7
  handleClick(event) {
@@ -1,8 +1,9 @@
1
- import { Position } from '../geojson-types';
2
- import { EditHandle, ModeHandler } from './mode-handler';
1
+ import { Position } from "../utils/geojson-types.js";
2
+ import { EditHandle, ModeHandler } from "./mode-handler.js";
3
3
  export declare class ViewHandler extends ModeHandler {
4
4
  getCursor({ isDragging }: {
5
5
  isDragging: boolean;
6
6
  }): string;
7
7
  getEditHandles(picks?: Array<Record<string, any>>, mapCoords?: Position): EditHandle[];
8
8
  }
9
+ //# sourceMappingURL=view-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-handler.d.ts","sourceRoot":"","sources":["../../src/mode-handlers/view-handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAC,kCAA+B;AAChD,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,0BAAuB;AAGvD,qBAAa,WAAY,SAAQ,WAAW;IAC1C,SAAS,CAAC,EAAC,UAAU,EAAC,EAAE;QAAC,UAAU,EAAE,OAAO,CAAA;KAAC,GAAG,MAAM;IAItD,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,QAAQ,GAAG,UAAU,EAAE;CAGvF"}
@@ -1,4 +1,7 @@
1
- import { ModeHandler } from './mode-handler';
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { ModeHandler } from "./mode-handler.js";
2
5
  // TODO edit-modes: delete handlers once EditMode fully implemented
3
6
  export class ViewHandler extends ModeHandler {
4
7
  getCursor({ isDragging }) {
@@ -1,8 +1,10 @@
1
1
  declare function getUniforms(opts?: Record<string, number>): Record<string, number>;
2
- declare const _default: {
3
- name: string;
4
- vs: string;
5
- fs: string;
6
- getUniforms: typeof getUniforms;
2
+ /** Shader module that implements desaturation. @note still WIP */
3
+ export declare const color: {
4
+ readonly name: "color";
5
+ 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";
7
+ readonly getUniforms: typeof getUniforms;
7
8
  };
8
- export default _default;
9
+ export {};
10
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +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,9 +1,11 @@
1
- // TODO - this module is a WIP
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  /* eslint-disable camelcase */
3
5
  const INITIAL_STATE = {
4
6
  color_uOpacity: 1.0,
5
7
  color_uDesaturate: 0.0,
6
- color_uBrightness: 1.0,
8
+ color_uBrightness: 1.0
7
9
  };
8
10
  function getUniforms(opts = INITIAL_STATE) {
9
11
  const uniforms = {};
@@ -43,9 +45,10 @@ vec4 color_filterColor(vec4 color) {
43
45
  return color;
44
46
  }
45
47
  `;
46
- export default {
48
+ /** Shader module that implements desaturation. @note still WIP */
49
+ export const color = {
47
50
  name: 'color',
48
51
  vs,
49
52
  fs,
50
- getUniforms,
53
+ getUniforms
51
54
  };
@@ -1,8 +1,9 @@
1
1
  declare function getUniforms({}?: {}): void;
2
- declare const _default: {
2
+ export declare const utils: {
3
3
  name: string;
4
4
  vs: string;
5
5
  fs: string;
6
6
  getUniforms: typeof getUniforms;
7
7
  };
8
- export default _default;
8
+ export {};
9
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/utils/utils.ts"],"names":[],"mappings":"AASA,iBAAS,WAAW,CAAC,EAAE,KAAgB,QAAI;AAsB3C,eAAO,MAAM,KAAK;;;;;CAKjB,CAAC"}
@@ -1,3 +1,6 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  // TODO - this module is a WIP
2
5
  /* eslint-disable camelcase */
3
6
  const INITIAL_STATE = {};
@@ -20,9 +23,9 @@ vec2 project_clipspace_to_projective_uv(vec4 position) {
20
23
  }
21
24
  `;
22
25
  const fs = vs;
23
- export default {
26
+ export const utils = {
24
27
  name: 'outline',
25
28
  vs,
26
29
  fs,
27
- getUniforms,
30
+ getUniforms
28
31
  };
@@ -1,2 +1,3 @@
1
1
  import type { Feature, MultiLineString, LineString } from '@turf/helpers';
2
2
  export declare function generateCurveFromControlPoints(line: Feature<MultiLineString>): Feature<LineString>;
3
+ //# sourceMappingURL=curve-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curve-utils.d.ts","sourceRoot":"","sources":["../../src/utils/curve-utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAW,MAAM,eAAe,CAAC;AAYlF,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,GAC7B,OAAO,CAAC,UAAU,CAAC,CA2DrB"}
@@ -1,3 +1,6 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import hermite from 'cubic-hermite-spline';
2
5
  import turfDistance from '@turf/distance';
3
6
  import { lineString } from '@turf/helpers';
@@ -27,13 +30,13 @@ export function generateCurveFromControlPoints(line) {
27
30
  // calculate tangents
28
31
  const tangents = [];
29
32
  // first tangent
30
- // @ts-ignore
33
+ // @ts-expect-error TODO
31
34
  tangents.push(calculateSingleTangent(coords[0], coords[1], knots[1] - knots[0]));
32
35
  // second to before last
33
36
  for (let i = 1; i < coords.length - 1; i++) {
34
- // @ts-ignore
37
+ // @ts-expect-error TODO
35
38
  const A = calculateSingleTangent(coords[i], coords[i + 1], knots[i + 1] - knots[i]);
36
- // @ts-ignore
39
+ // @ts-expect-error TODO
37
40
  const B = calculateSingleTangent(coords[i - 1], coords[i], knots[i] - knots[i - 1]);
38
41
  const x = (A[0] + B[0]) / 2.0;
39
42
  const y = (A[1] + B[1]) / 2.0;
@@ -42,7 +45,7 @@ export function generateCurveFromControlPoints(line) {
42
45
  // last tangent
43
46
  const last = coords.length - 1;
44
47
  tangents.push(
45
- // @ts-ignore
48
+ // @ts-expect-error TODO
46
49
  calculateSingleTangent(coords[last - 1], coords[last], knots[last] - knots[last - 1]));
47
50
  // generate curve
48
51
  const result = [];
@@ -1,4 +1,5 @@
1
- export type Position = [number, number] | [number, number, number];
1
+ import type { Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, Position } from 'geojson';
2
+ export { Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, Position };
2
3
  export type PointCoordinates = Position;
3
4
  export type LineStringCoordinates = Position[];
4
5
  export type PolygonCoordinates = Position[][];
@@ -6,30 +7,6 @@ export type MultiPointCoordinates = Position[];
6
7
  export type MultiLineStringCoordinates = Position[][];
7
8
  export type MultiPolygonCoordinates = Position[][][];
8
9
  export type AnyCoordinates = PointCoordinates | LineStringCoordinates | PolygonCoordinates | MultiPointCoordinates | MultiLineStringCoordinates | MultiPolygonCoordinates;
9
- export type Point = {
10
- type: 'Point';
11
- coordinates: PointCoordinates;
12
- };
13
- export type LineString = {
14
- type: 'LineString';
15
- coordinates: LineStringCoordinates;
16
- };
17
- export type Polygon = {
18
- type: 'Polygon';
19
- coordinates: PolygonCoordinates;
20
- };
21
- export type MultiPoint = {
22
- type: 'MultiPoint';
23
- coordinates: MultiPointCoordinates;
24
- };
25
- export type MultiLineString = {
26
- type: 'MultiLineString';
27
- coordinates: MultiLineStringCoordinates;
28
- };
29
- export type MultiPolygon = {
30
- type: 'MultiPolygon';
31
- coordinates: MultiPolygonCoordinates;
32
- };
33
10
  export type Geometry = Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon;
34
11
  export type Polygonal = Polygon | MultiPolygon;
35
12
  export type BoundingBoxArray = [number, number, number, number];
@@ -56,3 +33,4 @@ export type FeatureCollection = {
56
33
  bbox?: BoundingBoxArray;
57
34
  };
58
35
  export type AnyGeoJson = Feature | FeatureCollection;
36
+ //# sourceMappingURL=geojson-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geojson-types.d.ts","sourceRoot":"","sources":["../../src/utils/geojson-types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,KAAK,EACL,UAAU,EACV,OAAO,EACP,UAAU,EACV,eAAe,EACf,YAAY,EACZ,QAAQ,EACT,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAC,CAAC;AAEzF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AACxC,MAAM,MAAM,qBAAqB,GAAG,QAAQ,EAAE,CAAC;AAC/C,MAAM,MAAM,kBAAkB,GAAG,QAAQ,EAAE,EAAE,CAAC;AAC9C,MAAM,MAAM,qBAAqB,GAAG,QAAQ,EAAE,CAAC;AAC/C,MAAM,MAAM,0BAA0B,GAAG,QAAQ,EAAE,EAAE,CAAC;AACtD,MAAM,MAAM,uBAAuB,GAAG,QAAQ,EAAE,EAAE,EAAE,CAAC;AAErD,MAAM,MAAM,cAAc,GACtB,gBAAgB,GAChB,qBAAqB,GACrB,kBAAkB,GAClB,qBAAqB,GACrB,0BAA0B,GAC1B,uBAAuB,CAAC;AAE5B,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,eAAe,GAAG,YAAY,CAAC;AAElG,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,YAAY,CAAC;AAI/C,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEhE,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,QAAQ,IAAI;IAC1C,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,CAAC,CAAC;IACZ,UAAU,CAAC,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,IAAI;IACpD,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,CAAC,CAAC;IACZ,UAAU,EAAE,CAAC,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,OAAO,GACf,SAAS,CAAC,KAAK,CAAC,GAChB,SAAS,CAAC,UAAU,CAAC,GACrB,SAAS,CAAC,OAAO,CAAC,GAClB,SAAS,CAAC,UAAU,CAAC,GACrB,SAAS,CAAC,eAAe,CAAC,GAC1B,SAAS,CAAC,YAAY,CAAC,CAAC;AAE5B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,EAAE,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export {};
@@ -3,4 +3,5 @@
3
3
  * https://en.wikipedia.org/wiki/Memoization
4
4
  * @param {function} compute - the function to be memoized
5
5
  */
6
- export default function memoize(compute: Function): (args: any) => any;
6
+ export declare function memoize(compute: Function): (args: any) => any;
7
+ //# sourceMappingURL=memoize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoize.d.ts","sourceRoot":"","sources":["../../src/utils/memoize.ts"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,QAAQ,UAIzB,GAAG,SAUlB"}
@@ -1,3 +1,6 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  // port from @deck.gl/core
2
5
  function isEqual(a, b) {
3
6
  if (a === b) {
@@ -24,7 +27,7 @@ function isEqual(a, b) {
24
27
  * https://en.wikipedia.org/wiki/Memoization
25
28
  * @param {function} compute - the function to be memoized
26
29
  */
27
- export default function memoize(compute) {
30
+ export function memoize(compute) {
28
31
  let cachedArgs = {};
29
32
  let cachedResult;
30
33
  return (args) => {
@@ -2,3 +2,4 @@ import type { Feature as TurfFeature, Geometry as TurfGeometry } from '@turf/hel
2
2
  export declare function translateFromCenter(feature: TurfFeature<TurfGeometry>, distance: number, direction: number): TurfFeature<TurfGeometry, {
3
3
  [name: string]: any;
4
4
  }>;
5
+ //# sourceMappingURL=translate-from-center.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translate-from-center.d.ts","sourceRoot":"","sources":["../../src/utils/translate-from-center.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAEV,OAAO,IAAI,WAAW,EACtB,QAAQ,IAAI,YAAY,EACzB,MAAM,eAAe,CAAC;AAMvB,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,EAClC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM;;GA8BlB"}
@@ -1,17 +1,20 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import turfCenter from '@turf/center';
2
5
  import turfRhumbBearing from '@turf/rhumb-bearing';
3
6
  import turfRhumbDistance from '@turf/rhumb-distance';
4
7
  import turfRhumbDestination from '@turf/rhumb-destination';
5
- import { mapCoords } from './edit-modes/utils';
8
+ import { mapCoords } from "../edit-modes/utils.js";
6
9
  // This function takes feature's center, moves it,
7
10
  // and builds new feature around it keeping the proportions
8
11
  export function translateFromCenter(feature, distance, direction) {
9
12
  const initialCenterPoint = turfCenter(feature);
10
13
  const movedCenterPoint = turfRhumbDestination(initialCenterPoint, distance, direction);
11
14
  const movedCoordinates = mapCoords(feature.geometry.coordinates, (coordinate) => {
12
- const distance = turfRhumbDistance(initialCenterPoint.geometry.coordinates, coordinate);
13
- const direction = turfRhumbBearing(initialCenterPoint.geometry.coordinates, coordinate);
14
- const movedPosition = turfRhumbDestination(movedCenterPoint.geometry.coordinates, distance, direction).geometry.coordinates;
15
+ const rhumbDistance = turfRhumbDistance(initialCenterPoint.geometry.coordinates, coordinate);
16
+ const rhumbDirection = turfRhumbBearing(initialCenterPoint.geometry.coordinates, coordinate);
17
+ const movedPosition = turfRhumbDestination(movedCenterPoint.geometry.coordinates, rhumbDistance, rhumbDirection).geometry.coordinates;
15
18
  return movedPosition;
16
19
  });
17
20
  feature.geometry.coordinates = movedCoordinates;
@@ -33,3 +33,4 @@ export type Viewport = {
33
33
  bearing?: number;
34
34
  pitch?: number;
35
35
  };
36
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;CACnC,CAAC;AAGF,MAAM,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAErD,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export {};
@@ -1,5 +1,5 @@
1
- import { FeatureOf, FeatureWithProps, LineString, Point, Position } from './geojson-types';
2
- import { Viewport } from './types';
1
+ import { FeatureOf, FeatureWithProps, LineString, Point, Position } from "./geojson-types.js";
2
+ import { Viewport } from "./types.js";
3
3
  export type NearestPointType = FeatureWithProps<Point, {
4
4
  dist: number;
5
5
  index: number;
@@ -13,8 +13,9 @@ export declare function nearestPointOnProjectedLine(line: FeatureOf<LineString>,
13
13
  /**
14
14
  * Inserts toInsert string into base string before insertBefore string.
15
15
  * @param base A string to insert into.
16
- * @param insertBefore A sub string in `base` string to insert before.
16
+ * @param insertBeforeText A sub string in `base` string to insert before.
17
17
  * @param toInsert A string to insert.
18
18
  * @returns Combined string. `base` string if `insertBefore` string isn't found.
19
19
  */
20
- export declare function insertBefore(base: string, insertBefore: string, toInsert: string): string;
20
+ export declare function insertBefore(base: string, insertBeforeText: string, toInsert: string): string;
21
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAC,2BAAwB;AACzF,OAAO,EAAC,QAAQ,EAAC,mBAAgB;AAIjC,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,KAAK,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC;AAEtF,wBAAgB,WAAW,CACzB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EACjD,YAAY,GAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAoB,GAChE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAKlC;AA2BD,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EACrB,EAAE,EAAE,QAAQ,WAYb;AAED,wBAAgB,kCAAkC,CAChD,EAAE,EAAE,QAAQ,EACZ,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,QAAQ,GAClB,QAAQ,EAAE,CAuBZ;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAIjF;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,EAC3B,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,EACzB,QAAQ,EAAE,QAAQ,GACjB,gBAAgB,CA6DlB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM7F"}
@@ -1,3 +1,6 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import destination from '@turf/destination';
2
5
  import bearing from '@turf/bearing';
3
6
  import pointToLineDistance from '@turf/point-to-line-distance';
@@ -49,7 +52,7 @@ export function recursivelyTraverseNestedArrays(array, prefix, fn) {
49
52
  export function generatePointsParallelToLinePoints(p1, p2, mapCoords) {
50
53
  const lineString = {
51
54
  type: 'LineString',
52
- coordinates: [p1, p2],
55
+ coordinates: [p1, p2]
53
56
  };
54
57
  const pt = point(mapCoords);
55
58
  const ddistance = pointToLineDistance(pt, lineString);
@@ -102,7 +105,7 @@ export function nearestPointOnProjectedLine(line, inPoint, viewport) {
102
105
  minPointInfo = {
103
106
  index,
104
107
  x0: (B * (B * x - A * y) - A * C) / div,
105
- y0: (A * (-B * x + A * y) - B * C) / div,
108
+ y0: (A * (-B * x + A * y) - B * C) / div
106
109
  };
107
110
  }
108
111
  });
@@ -118,25 +121,24 @@ export function nearestPointOnProjectedLine(line, inPoint, viewport) {
118
121
  type: 'Feature',
119
122
  geometry: {
120
123
  type: 'Point',
121
- // @ts-expect-error Position type diff
122
- coordinates: wmViewport.unproject([x0, y0, z0]),
124
+ coordinates: wmViewport.unproject([x0, y0, z0])
123
125
  },
124
126
  properties: {
125
127
  // TODO: calculate the distance in proper units
126
128
  dist: minDistance,
127
- index: index - 1,
128
- },
129
+ index: index - 1
130
+ }
129
131
  };
130
132
  }
131
133
  /**
132
134
  * Inserts toInsert string into base string before insertBefore string.
133
135
  * @param base A string to insert into.
134
- * @param insertBefore A sub string in `base` string to insert before.
136
+ * @param insertBeforeText A sub string in `base` string to insert before.
135
137
  * @param toInsert A string to insert.
136
138
  * @returns Combined string. `base` string if `insertBefore` string isn't found.
137
139
  */
138
- export function insertBefore(base, insertBefore, toInsert) {
139
- const at = base.indexOf(insertBefore);
140
+ export function insertBefore(base, insertBeforeText, toInsert) {
141
+ const at = base.indexOf(insertBeforeText);
140
142
  if (at < 0) {
141
143
  return base;
142
144
  }
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.0-alpha.1",
5
+ "version": "9.0.3",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/visgl/deck.gl-community"
@@ -62,23 +62,24 @@
62
62
  "@turf/transform-scale": "^6.5.0",
63
63
  "@turf/transform-translate": "^6.5.0",
64
64
  "@turf/union": "^6.5.0",
65
+ "@types/geojson": "^7946.0.14",
65
66
  "cubic-hermite-spline": "^1.0.1",
66
67
  "eventemitter3": "^5.0.0",
67
- "geojson-types": "^2.0.1",
68
68
  "lodash.throttle": "^4.1.1",
69
69
  "uuid": "9.0.0",
70
70
  "viewport-mercator-project": ">=6.2.3"
71
71
  },
72
72
  "peerDependencies": {
73
- "@deck.gl/core": ">=9.0.5",
74
- "@deck.gl/extensions": ">=9.0.5",
75
- "@deck.gl/geo-layers": ">=9.0.5",
76
- "@deck.gl/layers": ">=9.0.5",
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",
77
78
  "@deck.gl/mesh-layers": ">=9.0.6",
78
- "@luma.gl/constants": ">=9.0.9",
79
- "@luma.gl/core": ">=9.0.9",
80
- "@luma.gl/engine": ">=9.0.9",
79
+ "@luma.gl/constants": ">=9.0.12",
80
+ "@luma.gl/core": ">=9.0.12",
81
+ "@luma.gl/engine": ">=9.0.12",
81
82
  "@math.gl/core": ">=4.0.1"
82
83
  },
83
- "gitHead": "8374ab0ac62a52ae8a6b14276694cabced43de35"
84
+ "gitHead": "8955b0da47771f3524b65360243ee246abeb3660"
84
85
  }
package/src/constants.ts CHANGED
@@ -1,3 +1,7 @@
1
+ // deck.gl-community
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  /**
2
6
  * A multiplier for screen-space width/scale for Arc, Line, Icon and Text layers.
3
7
  * Required in order to maintain the same appearance after upgrading to deck.gl v8.5.
@@ -11,5 +15,5 @@ export const PROJECTED_PIXEL_SIZE_MULTIPLIER = 2 / 3;
11
15
  export const UNIT = {
12
16
  common: 0,
13
17
  meters: 1,
14
- pixels: 2,
18
+ pixels: 2
15
19
  };