@vcmap/core 5.3.3 → 6.0.0-rc.10

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 (400) hide show
  1. package/dist/cesium.d.ts +12 -0
  2. package/dist/index.d.ts +27 -19
  3. package/dist/index.js +22 -14
  4. package/dist/index.js.map +1 -1
  5. package/dist/ol.d.ts +15 -2
  6. package/dist/src/category/category.d.ts +5 -4
  7. package/dist/src/category/category.js +2 -1
  8. package/dist/src/category/category.js.map +1 -1
  9. package/dist/src/category/categoryCollection.js.map +1 -1
  10. package/dist/src/cesium/cesiumVcsCameraPrimitive.d.ts +1 -0
  11. package/dist/src/cesium/cesiumVcsCameraPrimitive.js +4 -0
  12. package/dist/src/cesium/cesiumVcsCameraPrimitive.js.map +1 -1
  13. package/dist/src/classRegistry.d.ts +4 -3
  14. package/dist/src/classRegistry.js +2 -0
  15. package/dist/src/classRegistry.js.map +1 -1
  16. package/dist/src/featureProvider/abstractFeatureProvider.js.map +1 -1
  17. package/dist/src/featureProvider/wmsFeatureProvider.js.map +1 -1
  18. package/dist/src/interaction/abstractInteraction.js.map +1 -1
  19. package/dist/src/interaction/coordinateAtPixel.js.map +1 -1
  20. package/dist/src/interaction/eventHandler.js.map +1 -1
  21. package/dist/src/interaction/featureAtPixelInteraction.d.ts +4 -12
  22. package/dist/src/interaction/featureAtPixelInteraction.js +5 -21
  23. package/dist/src/interaction/featureAtPixelInteraction.js.map +1 -1
  24. package/dist/src/interaction/featureProviderInteraction.js.map +1 -1
  25. package/dist/src/interaction/interactionChain.js.map +1 -1
  26. package/dist/src/interaction/interactionType.js +4 -4
  27. package/dist/src/interaction/interactionType.js.map +1 -1
  28. package/dist/src/layer/cesium/cesiumTilesetCesiumImpl.js.map +1 -1
  29. package/dist/src/layer/cesium/clusterContext.d.ts +12 -16
  30. package/dist/src/layer/cesium/clusterContext.js +75 -43
  31. package/dist/src/layer/cesium/clusterContext.js.map +1 -1
  32. package/dist/src/layer/cesium/dataSourceCesiumImpl.js.map +1 -1
  33. package/dist/src/layer/cesium/rasterLayerCesiumImpl.js.map +1 -1
  34. package/dist/src/layer/cesium/resourceHelper.js.map +1 -1
  35. package/dist/src/layer/cesium/singleImageCesiumImpl.js.map +1 -1
  36. package/dist/src/layer/cesium/terrainCesiumImpl.js.map +1 -1
  37. package/dist/src/layer/cesium/tmsCesiumImpl.js.map +1 -1
  38. package/dist/src/layer/cesium/vectorCesiumImpl.d.ts +2 -3
  39. package/dist/src/layer/cesium/vectorCesiumImpl.js +16 -10
  40. package/dist/src/layer/cesium/vectorCesiumImpl.js.map +1 -1
  41. package/dist/src/layer/cesium/vectorContext.d.ts +11 -54
  42. package/dist/src/layer/cesium/vectorContext.js +154 -171
  43. package/dist/src/layer/cesium/vectorContext.js.map +1 -1
  44. package/dist/src/layer/cesium/vectorRasterTileCesiumImpl.js.map +1 -1
  45. package/dist/src/layer/cesium/vectorTileImageryProvider.js.map +1 -1
  46. package/dist/src/layer/cesium/wmsCesiumImpl.js.map +1 -1
  47. package/dist/src/layer/cesiumTilesetLayer.js.map +1 -1
  48. package/dist/src/layer/czmlLayer.js.map +1 -1
  49. package/dist/src/layer/dataSourceLayer.js.map +1 -1
  50. package/dist/src/layer/featureLayer.js.map +1 -1
  51. package/dist/src/layer/featureStoreFeatureVisibility.js.map +1 -1
  52. package/dist/src/layer/featureStoreLayer.js.map +1 -1
  53. package/dist/src/layer/featureStoreLayerChanges.js.map +1 -1
  54. package/dist/src/layer/featureVisibility.js +4 -5
  55. package/dist/src/layer/featureVisibility.js.map +1 -1
  56. package/dist/src/layer/geojsonHelpers.d.ts +1 -1
  57. package/dist/src/layer/geojsonHelpers.js +5 -10
  58. package/dist/src/layer/geojsonHelpers.js.map +1 -1
  59. package/dist/src/layer/geojsonLayer.js.map +1 -1
  60. package/dist/src/layer/globalHider.js.map +1 -1
  61. package/dist/src/layer/layer.js.map +1 -1
  62. package/dist/src/layer/layerImplementation.js.map +1 -1
  63. package/dist/src/layer/oblique/layerObliqueImpl.js.map +1 -1
  64. package/dist/src/layer/oblique/obliqueHelpers.js +9 -9
  65. package/dist/src/layer/oblique/obliqueHelpers.js.map +1 -1
  66. package/dist/src/layer/oblique/vectorObliqueImpl.d.ts +3 -3
  67. package/dist/src/layer/oblique/vectorObliqueImpl.js.map +1 -1
  68. package/dist/src/layer/openStreetMapLayer.js.map +1 -1
  69. package/dist/src/layer/openlayers/layerOpenlayersImpl.js.map +1 -1
  70. package/dist/src/layer/openlayers/rasterLayerOpenlayersImpl.js.map +1 -1
  71. package/dist/src/layer/openlayers/singleImageOpenlayersImpl.js.map +1 -1
  72. package/dist/src/layer/openlayers/tmsOpenlayersImpl.js.map +1 -1
  73. package/dist/src/layer/openlayers/vectorOpenlayersImpl.d.ts +2 -2
  74. package/dist/src/layer/openlayers/vectorOpenlayersImpl.js.map +1 -1
  75. package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.d.ts +1 -7
  76. package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js +18 -47
  77. package/dist/src/layer/openlayers/vectorTileOpenlayersImpl.js.map +1 -1
  78. package/dist/src/layer/openlayers/wmsOpenlayersImpl.js.map +1 -1
  79. package/dist/src/layer/openlayers/wmtsOpenlayersImpl.js.map +1 -1
  80. package/dist/src/layer/pointCloudLayer.js.map +1 -1
  81. package/dist/src/layer/rasterLayer.js +1 -1
  82. package/dist/src/layer/rasterLayer.js.map +1 -1
  83. package/dist/src/layer/singleImageLayer.js.map +1 -1
  84. package/dist/src/layer/terrainHelpers.js.map +1 -1
  85. package/dist/src/layer/terrainLayer.js.map +1 -1
  86. package/dist/src/layer/tileLoadedHelper.js.map +1 -1
  87. package/dist/src/layer/tileProvider/mvtTileProvider.js.map +1 -1
  88. package/dist/src/layer/tileProvider/staticGeojsonTileProvider.js.map +1 -1
  89. package/dist/src/layer/tileProvider/tileProvider.js.map +1 -1
  90. package/dist/src/layer/tileProvider/urlTemplateTileProvider.js.map +1 -1
  91. package/dist/src/layer/tmsLayer.js.map +1 -1
  92. package/dist/src/layer/vectorHelpers.js.map +1 -1
  93. package/dist/src/layer/vectorLayer.d.ts +0 -37
  94. package/dist/src/layer/vectorLayer.js +1 -3
  95. package/dist/src/layer/vectorLayer.js.map +1 -1
  96. package/dist/src/layer/vectorProperties.d.ts +10 -5
  97. package/dist/src/layer/vectorProperties.js +59 -10
  98. package/dist/src/layer/vectorProperties.js.map +1 -1
  99. package/dist/src/layer/vectorTileLayer.js.map +1 -1
  100. package/dist/src/layer/wfsLayer.js.map +1 -1
  101. package/dist/src/layer/wmsHelpers.js.map +1 -1
  102. package/dist/src/layer/wmsLayer.js.map +1 -1
  103. package/dist/src/layer/wmtsLayer.js.map +1 -1
  104. package/dist/src/map/baseOLMap.js +1 -1
  105. package/dist/src/map/baseOLMap.js.map +1 -1
  106. package/dist/src/map/cameraLimiter.js +1 -1
  107. package/dist/src/map/cameraLimiter.js.map +1 -1
  108. package/dist/src/map/cesiumMap.js.map +1 -1
  109. package/dist/src/map/obliqueMap.js.map +1 -1
  110. package/dist/src/map/openlayersMap.js +1 -1
  111. package/dist/src/map/openlayersMap.js.map +1 -1
  112. package/dist/src/map/vcsMap.js.map +1 -1
  113. package/dist/src/oblique/helpers.js +5 -5
  114. package/dist/src/oblique/helpers.js.map +1 -1
  115. package/dist/src/oblique/obliqueCollection.js.map +1 -1
  116. package/dist/src/oblique/obliqueDataSet.js +5 -5
  117. package/dist/src/oblique/obliqueDataSet.js.map +1 -1
  118. package/dist/src/oblique/obliqueImage.js.map +1 -1
  119. package/dist/src/oblique/obliqueImageMeta.js.map +1 -1
  120. package/dist/src/oblique/obliqueProvider.js.map +1 -1
  121. package/dist/src/oblique/obliqueView.js.map +1 -1
  122. package/dist/src/oblique/obliqueViewDirection.js +1 -1
  123. package/dist/src/oblique/obliqueViewDirection.js.map +1 -1
  124. package/dist/src/oblique/parseImageJson.js.map +1 -1
  125. package/dist/src/ol/feature.js.map +1 -1
  126. package/dist/src/ol/geom/geometryCollection.js +80 -6
  127. package/dist/src/ol/geom/geometryCollection.js.map +1 -1
  128. package/dist/src/ol/render/canvas/canvasTileRenderer.js.map +1 -1
  129. package/dist/src/ol/source/ClusterEnhancedVectorSource.js.map +1 -1
  130. package/dist/src/ol/source/VcsCluster.js.map +1 -1
  131. package/dist/src/overrideClassRegistry.d.ts +2 -2
  132. package/dist/src/overrideClassRegistry.js +5 -3
  133. package/dist/src/overrideClassRegistry.js.map +1 -1
  134. package/dist/src/style/arcStyle.js +1 -0
  135. package/dist/src/style/arcStyle.js.map +1 -1
  136. package/dist/src/style/arrowStyle.js +6 -6
  137. package/dist/src/style/arrowStyle.js.map +1 -1
  138. package/dist/src/style/declarativeStyleItem.js.map +1 -1
  139. package/dist/src/style/shapesCategory.js.map +1 -1
  140. package/dist/src/style/styleFactory.js.map +1 -1
  141. package/dist/src/style/styleHelpers.js +4 -2
  142. package/dist/src/style/styleHelpers.js.map +1 -1
  143. package/dist/src/style/styleItem.js.map +1 -1
  144. package/dist/src/style/vectorStyleItem.js +9 -9
  145. package/dist/src/style/vectorStyleItem.js.map +1 -1
  146. package/dist/src/style/writeStyle.js.map +1 -1
  147. package/dist/src/util/clipping/clippingObject.js.map +1 -1
  148. package/dist/src/util/clipping/clippingObjectManager.js.map +1 -1
  149. package/dist/src/util/clipping/clippingPlaneHelper.js +2 -2
  150. package/dist/src/util/clipping/clippingPlaneHelper.js.map +1 -1
  151. package/dist/src/util/collection.js.map +1 -1
  152. package/dist/src/util/displayQuality/displayQuality.d.ts +1 -0
  153. package/dist/src/util/displayQuality/displayQuality.js +13 -2
  154. package/dist/src/util/displayQuality/displayQuality.js.map +1 -1
  155. package/dist/src/util/editor/createFeatureSession.d.ts +10 -2
  156. package/dist/src/util/editor/createFeatureSession.js +75 -9
  157. package/dist/src/util/editor/createFeatureSession.js.map +1 -1
  158. package/dist/src/util/editor/editFeaturesSession.d.ts +10 -4
  159. package/dist/src/util/editor/editFeaturesSession.js +74 -37
  160. package/dist/src/util/editor/editFeaturesSession.js.map +1 -1
  161. package/dist/src/util/editor/editGeometrySession.d.ts +7 -2
  162. package/dist/src/util/editor/editGeometrySession.js +109 -66
  163. package/dist/src/util/editor/editGeometrySession.js.map +1 -1
  164. package/dist/src/util/editor/editorHelpers.d.ts +13 -6
  165. package/dist/src/util/editor/editorHelpers.js +53 -23
  166. package/dist/src/util/editor/editorHelpers.js.map +1 -1
  167. package/dist/src/util/editor/editorSessionHelpers.d.ts +6 -6
  168. package/dist/src/util/editor/editorSessionHelpers.js +8 -18
  169. package/dist/src/util/editor/editorSessionHelpers.js.map +1 -1
  170. package/dist/src/util/editor/editorSymbols.d.ts +1 -1
  171. package/dist/src/util/editor/editorSymbols.js +1 -1
  172. package/dist/src/util/editor/editorSymbols.js.map +1 -1
  173. package/dist/src/util/editor/interactions/createBBoxInteraction.d.ts +1 -0
  174. package/dist/src/util/editor/interactions/createBBoxInteraction.js +20 -16
  175. package/dist/src/util/editor/interactions/createBBoxInteraction.js.map +1 -1
  176. package/dist/src/util/editor/interactions/createCircleInteraction.js +1 -1
  177. package/dist/src/util/editor/interactions/createCircleInteraction.js.map +1 -1
  178. package/dist/src/util/editor/interactions/createLineStringInteraction.js +3 -3
  179. package/dist/src/util/editor/interactions/createLineStringInteraction.js.map +1 -1
  180. package/dist/src/util/editor/interactions/createPointInteraction.js +1 -1
  181. package/dist/src/util/editor/interactions/createPointInteraction.js.map +1 -1
  182. package/dist/src/util/editor/interactions/createPolygonInteraction.d.ts +4 -0
  183. package/dist/src/util/editor/interactions/createPolygonInteraction.js +9 -3
  184. package/dist/src/util/editor/interactions/createPolygonInteraction.js.map +1 -1
  185. package/dist/src/util/editor/interactions/creationSnapping.d.ts +26 -0
  186. package/dist/src/util/editor/interactions/creationSnapping.js +139 -0
  187. package/dist/src/util/editor/interactions/creationSnapping.js.map +1 -0
  188. package/dist/src/util/editor/interactions/editFeaturesMouseOverInteraction.js.map +1 -1
  189. package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js +11 -9
  190. package/dist/src/util/editor/interactions/editGeometryMouseOverInteraction.js.map +1 -1
  191. package/dist/src/util/editor/interactions/ensureHandlerSelectionInteraction.js.map +1 -1
  192. package/dist/src/util/editor/interactions/insertVertexInteraction.d.ts +3 -1
  193. package/dist/src/util/editor/interactions/insertVertexInteraction.js +14 -6
  194. package/dist/src/util/editor/interactions/insertVertexInteraction.js.map +1 -1
  195. package/dist/src/util/editor/interactions/layerSnapping.d.ts +19 -0
  196. package/dist/src/util/editor/interactions/layerSnapping.js +87 -0
  197. package/dist/src/util/editor/interactions/layerSnapping.js.map +1 -0
  198. package/dist/src/util/editor/interactions/mapInteractionController.js.map +1 -1
  199. package/dist/src/util/editor/interactions/removeVertexInteraction.d.ts +1 -1
  200. package/dist/src/util/editor/interactions/removeVertexInteraction.js +2 -2
  201. package/dist/src/util/editor/interactions/removeVertexInteraction.js.map +1 -1
  202. package/dist/src/util/editor/interactions/segmentLengthInteraction.d.ts +16 -0
  203. package/dist/src/util/editor/interactions/segmentLengthInteraction.js +167 -0
  204. package/dist/src/util/editor/interactions/segmentLengthInteraction.js.map +1 -0
  205. package/dist/src/util/editor/interactions/selectFeatureMouseOverInteraction.js +1 -1
  206. package/dist/src/util/editor/interactions/selectFeatureMouseOverInteraction.js.map +1 -1
  207. package/dist/src/util/editor/interactions/selectMultiFeatureInteraction.d.ts +1 -1
  208. package/dist/src/util/editor/interactions/selectMultiFeatureInteraction.js.map +1 -1
  209. package/dist/src/util/editor/interactions/selectSingleFeatureInteraction.d.ts +1 -1
  210. package/dist/src/util/editor/interactions/selectSingleFeatureInteraction.js.map +1 -1
  211. package/dist/src/util/editor/interactions/translateVertexInteraction.js +4 -8
  212. package/dist/src/util/editor/interactions/translateVertexInteraction.js.map +1 -1
  213. package/dist/src/util/editor/interactions/translationSnapping.d.ts +25 -0
  214. package/dist/src/util/editor/interactions/translationSnapping.js +180 -0
  215. package/dist/src/util/editor/interactions/translationSnapping.js.map +1 -0
  216. package/dist/src/util/editor/selectFeaturesSession.js.map +1 -1
  217. package/dist/src/util/editor/snappingHelpers.d.ts +44 -0
  218. package/dist/src/util/editor/snappingHelpers.js +329 -0
  219. package/dist/src/util/editor/snappingHelpers.js.map +1 -0
  220. package/dist/src/util/editor/transformation/create2DHandlers.js +26 -26
  221. package/dist/src/util/editor/transformation/create2DHandlers.js.map +1 -1
  222. package/dist/src/util/editor/transformation/create3DHandlers.js +65 -14
  223. package/dist/src/util/editor/transformation/create3DHandlers.js.map +1 -1
  224. package/dist/src/util/editor/transformation/extrudeInteraction.js.map +1 -1
  225. package/dist/src/util/editor/transformation/rotateInteraction.js.map +1 -1
  226. package/dist/src/util/editor/transformation/scaleInteraction.js +27 -5
  227. package/dist/src/util/editor/transformation/scaleInteraction.js.map +1 -1
  228. package/dist/src/util/editor/transformation/transformationHandler.js +56 -38
  229. package/dist/src/util/editor/transformation/transformationHandler.js.map +1 -1
  230. package/dist/src/util/editor/transformation/transformationTypes.d.ts +2 -0
  231. package/dist/src/util/editor/transformation/transformationTypes.js +6 -2
  232. package/dist/src/util/editor/transformation/transformationTypes.js.map +1 -1
  233. package/dist/src/util/editor/transformation/translateInteraction.js.map +1 -1
  234. package/dist/src/util/editor/validateGeoemetry.js.map +1 -1
  235. package/dist/src/util/exclusiveManager.js.map +1 -1
  236. package/dist/src/util/extent.js.map +1 -1
  237. package/dist/src/util/featureconverter/arcToCesium.d.ts +5 -19
  238. package/dist/src/util/featureconverter/arcToCesium.js +15 -42
  239. package/dist/src/util/featureconverter/arcToCesium.js.map +1 -1
  240. package/dist/src/util/featureconverter/circleToCesium.d.ts +2 -27
  241. package/dist/src/util/featureconverter/circleToCesium.js +85 -64
  242. package/dist/src/util/featureconverter/circleToCesium.js.map +1 -1
  243. package/dist/src/util/featureconverter/clampedPrimitive.d.ts +2 -0
  244. package/dist/src/util/featureconverter/clampedPrimitive.js +29 -0
  245. package/dist/src/util/featureconverter/clampedPrimitive.js.map +1 -0
  246. package/dist/src/util/featureconverter/convert.d.ts +30 -7
  247. package/dist/src/util/featureconverter/convert.js +221 -44
  248. package/dist/src/util/featureconverter/convert.js.map +1 -1
  249. package/dist/src/util/featureconverter/extent3D.d.ts +4 -3
  250. package/dist/src/util/featureconverter/extent3D.js +4 -3
  251. package/dist/src/util/featureconverter/extent3D.js.map +1 -1
  252. package/dist/src/util/featureconverter/lineStringToCesium.d.ts +12 -27
  253. package/dist/src/util/featureconverter/lineStringToCesium.js +85 -107
  254. package/dist/src/util/featureconverter/lineStringToCesium.js.map +1 -1
  255. package/dist/src/util/featureconverter/pointHelpers.d.ts +8 -11
  256. package/dist/src/util/featureconverter/pointHelpers.js +141 -121
  257. package/dist/src/util/featureconverter/pointHelpers.js.map +1 -1
  258. package/dist/src/util/featureconverter/pointToCesium.d.ts +14 -17
  259. package/dist/src/util/featureconverter/pointToCesium.js +50 -98
  260. package/dist/src/util/featureconverter/pointToCesium.js.map +1 -1
  261. package/dist/src/util/featureconverter/polygonToCesium.d.ts +2 -26
  262. package/dist/src/util/featureconverter/polygonToCesium.js +63 -73
  263. package/dist/src/util/featureconverter/polygonToCesium.js.map +1 -1
  264. package/dist/src/util/featureconverter/storeyHelpers.d.ts +17 -0
  265. package/dist/src/util/featureconverter/storeyHelpers.js +78 -0
  266. package/dist/src/util/featureconverter/storeyHelpers.js.map +1 -0
  267. package/dist/src/util/featureconverter/vectorGeometryFactory.d.ts +54 -0
  268. package/dist/src/util/featureconverter/vectorGeometryFactory.js +278 -0
  269. package/dist/src/util/featureconverter/vectorGeometryFactory.js.map +1 -0
  270. package/dist/src/util/featureconverter/vectorHeightInfo.d.ts +86 -0
  271. package/dist/src/util/featureconverter/vectorHeightInfo.js +240 -0
  272. package/dist/src/util/featureconverter/vectorHeightInfo.js.map +1 -0
  273. package/dist/src/util/fetch.js.map +1 -1
  274. package/dist/src/util/flight/flightAnchor.js.map +1 -1
  275. package/dist/src/util/flight/flightCollection.js.map +1 -1
  276. package/dist/src/util/flight/flightHelpers.js.map +1 -1
  277. package/dist/src/util/flight/flightInstance.js.map +1 -1
  278. package/dist/src/util/flight/flightPlayer.d.ts +11 -6
  279. package/dist/src/util/flight/flightPlayer.js +52 -16
  280. package/dist/src/util/flight/flightPlayer.js.map +1 -1
  281. package/dist/src/util/flight/flightVisualizer.js.map +1 -1
  282. package/dist/src/util/geometryHelpers.d.ts +34 -2
  283. package/dist/src/util/geometryHelpers.js +172 -4
  284. package/dist/src/util/geometryHelpers.js.map +1 -1
  285. package/dist/src/util/hiddenObjects.js.map +1 -1
  286. package/dist/src/util/indexedCollection.js.map +1 -1
  287. package/dist/src/util/layerCollection.js.map +1 -1
  288. package/dist/src/util/locale.js.map +1 -1
  289. package/dist/src/util/mapCollection.js.map +1 -1
  290. package/dist/src/util/math.d.ts +18 -2
  291. package/dist/src/util/math.js +55 -12
  292. package/dist/src/util/math.js.map +1 -1
  293. package/dist/src/util/overrideCollection.d.ts +7 -7
  294. package/dist/src/util/overrideCollection.js +10 -7
  295. package/dist/src/util/overrideCollection.js.map +1 -1
  296. package/dist/src/util/projection.js.map +1 -1
  297. package/dist/src/util/urlHelpers.js.map +1 -1
  298. package/dist/src/util/viewpoint.js.map +1 -1
  299. package/dist/src/vcsApp.d.ts +3 -3
  300. package/dist/src/vcsApp.js +1 -0
  301. package/dist/src/vcsApp.js.map +1 -1
  302. package/dist/src/vcsEvent.js.map +1 -1
  303. package/dist/src/vcsModule.js.map +1 -1
  304. package/dist/src/vcsModuleHelpers.d.ts +1 -0
  305. package/dist/src/vcsModuleHelpers.js +16 -2
  306. package/dist/src/vcsModuleHelpers.js.map +1 -1
  307. package/dist/src/vcsObject.js.map +1 -1
  308. package/dist/tests/unit/helpers/cesiumHelpers.d.ts +11 -11
  309. package/dist/tests/unit/helpers/cesiumHelpers.js +6 -1
  310. package/dist/tests/unit/helpers/cesiumHelpers.js.map +1 -1
  311. package/dist/tests/unit/helpers/helpers.d.ts +2 -9
  312. package/dist/tests/unit/helpers/helpers.js +4 -10
  313. package/dist/tests/unit/helpers/helpers.js.map +1 -1
  314. package/dist/tests/unit/helpers/importJSON.js.map +1 -1
  315. package/dist/tests/unit/helpers/obliqueHelpers.js.map +1 -1
  316. package/index.ts +84 -36
  317. package/package.json +21 -21
  318. package/src/category/category.ts +11 -9
  319. package/src/category/categoryCollection.ts +1 -1
  320. package/src/cesium/cesium.d.ts +12 -0
  321. package/src/cesium/cesiumVcsCameraPrimitive.ts +5 -0
  322. package/src/classRegistry.ts +7 -4
  323. package/src/featureProvider/wmsFeatureProvider.ts +1 -1
  324. package/src/global.d.ts +6 -1
  325. package/src/interaction/featureAtPixelInteraction.ts +7 -26
  326. package/src/layer/cesium/clusterContext.ts +97 -93
  327. package/src/layer/cesium/vectorCesiumImpl.ts +17 -11
  328. package/src/layer/cesium/vectorContext.ts +229 -348
  329. package/src/layer/featureVisibility.ts +3 -6
  330. package/src/layer/geojsonHelpers.ts +9 -12
  331. package/src/layer/oblique/obliqueHelpers.ts +9 -9
  332. package/src/layer/oblique/vectorObliqueImpl.ts +2 -2
  333. package/src/layer/openlayers/vectorOpenlayersImpl.ts +2 -2
  334. package/src/layer/openlayers/vectorTileOpenlayersImpl.ts +23 -53
  335. package/src/layer/tileLoadedHelper.ts +1 -3
  336. package/src/layer/tileProvider/mvtTileProvider.ts +2 -2
  337. package/src/layer/vectorLayer.ts +1 -74
  338. package/src/layer/vectorProperties.ts +80 -16
  339. package/src/map/baseOLMap.ts +1 -1
  340. package/src/oblique/helpers.ts +11 -5
  341. package/src/oblique/obliqueDataSet.ts +4 -4
  342. package/src/ol/geom/geometryCollection.js +96 -6
  343. package/src/ol/ol.d.ts +15 -2
  344. package/src/overrideClassRegistry.ts +13 -7
  345. package/src/style/arcStyle.ts +1 -0
  346. package/src/style/arrowStyle.ts +7 -7
  347. package/src/style/declarativeStyleItem.ts +2 -2
  348. package/src/style/styleHelpers.ts +15 -13
  349. package/src/style/vectorStyleItem.ts +14 -14
  350. package/src/util/clipping/clippingObject.ts +1 -3
  351. package/src/util/clipping/clippingPlaneHelper.ts +3 -4
  352. package/src/util/displayQuality/displayQuality.ts +13 -1
  353. package/src/util/editor/createFeatureSession.ts +107 -13
  354. package/src/util/editor/editFeaturesSession.ts +105 -39
  355. package/src/util/editor/editGeometrySession.ts +157 -83
  356. package/src/util/editor/editorHelpers.ts +85 -33
  357. package/src/util/editor/editorSessionHelpers.ts +13 -20
  358. package/src/util/editor/editorSymbols.ts +1 -1
  359. package/src/util/editor/interactions/createBBoxInteraction.ts +25 -16
  360. package/src/util/editor/interactions/createCircleInteraction.ts +1 -1
  361. package/src/util/editor/interactions/createLineStringInteraction.ts +9 -3
  362. package/src/util/editor/interactions/createPointInteraction.ts +1 -1
  363. package/src/util/editor/interactions/createPolygonInteraction.ts +16 -3
  364. package/src/util/editor/interactions/creationSnapping.ts +226 -0
  365. package/src/util/editor/interactions/editGeometryMouseOverInteraction.ts +7 -6
  366. package/src/util/editor/interactions/insertVertexInteraction.ts +27 -7
  367. package/src/util/editor/interactions/layerSnapping.ts +136 -0
  368. package/src/util/editor/interactions/removeVertexInteraction.ts +3 -4
  369. package/src/util/editor/interactions/segmentLengthInteraction.ts +227 -0
  370. package/src/util/editor/interactions/translateVertexInteraction.ts +11 -12
  371. package/src/util/editor/interactions/translationSnapping.ts +302 -0
  372. package/src/util/editor/snappingHelpers.ts +490 -0
  373. package/src/util/editor/transformation/create2DHandlers.ts +38 -26
  374. package/src/util/editor/transformation/create3DHandlers.ts +84 -22
  375. package/src/util/editor/transformation/scaleInteraction.ts +28 -5
  376. package/src/util/editor/transformation/transformationHandler.ts +72 -41
  377. package/src/util/editor/transformation/transformationTypes.ts +5 -0
  378. package/src/util/featureconverter/arcToCesium.ts +25 -95
  379. package/src/util/featureconverter/circleToCesium.ts +128 -114
  380. package/src/util/featureconverter/clampedPrimitive.ts +70 -0
  381. package/src/util/featureconverter/convert.ts +447 -113
  382. package/src/util/featureconverter/extent3D.ts +13 -6
  383. package/src/util/featureconverter/lineStringToCesium.ts +134 -181
  384. package/src/util/featureconverter/pointHelpers.ts +285 -219
  385. package/src/util/featureconverter/pointToCesium.ts +117 -177
  386. package/src/util/featureconverter/polygonToCesium.ts +99 -118
  387. package/src/util/featureconverter/storeyHelpers.ts +104 -0
  388. package/src/util/featureconverter/vectorGeometryFactory.ts +601 -0
  389. package/src/util/featureconverter/vectorHeightInfo.ts +392 -0
  390. package/src/util/flight/flightPlayer.ts +64 -22
  391. package/src/util/geometryHelpers.ts +239 -9
  392. package/src/util/hiddenObjects.ts +4 -4
  393. package/src/util/math.ts +87 -12
  394. package/src/util/overrideCollection.ts +33 -21
  395. package/src/vcsApp.ts +11 -4
  396. package/src/vcsModuleHelpers.ts +25 -2
  397. package/dist/src/util/featureconverter/featureconverterHelper.d.ts +0 -35
  398. package/dist/src/util/featureconverter/featureconverterHelper.js +0 -403
  399. package/dist/src/util/featureconverter/featureconverterHelper.js.map +0 -1
  400. package/src/util/featureconverter/featureconverterHelper.ts +0 -668
@@ -1,5 +1,4 @@
1
1
  import type { Point, Polygon, Circle, LineString } from 'ol/geom.js';
2
- import { HeightReference } from '@vcmap-cesium/engine';
3
2
  import VectorLayer from '../../layer/vectorLayer.js';
4
3
  import { mercatorProjection } from '../projection.js';
5
4
  import InteractionChain from '../../interaction/interactionChain.js';
@@ -10,6 +9,13 @@ import { markVolatile } from '../../vcsModule.js';
10
9
  import { PrimitiveOptionsType } from '../../layer/vectorProperties.js';
11
10
  import EventHandler from '../../interaction/eventHandler.js';
12
11
  import type VcsApp from '../../vcsApp.js';
12
+ import { InteractionEvent } from '../../interaction/abstractInteraction.js';
13
+
14
+ export const alreadySnapped = Symbol('alreadySnapped');
15
+
16
+ export type SnappingInteractionEvent = InteractionEvent & {
17
+ [alreadySnapped]?: boolean;
18
+ };
13
19
 
14
20
  export enum SessionType {
15
21
  CREATE = 'create',
@@ -138,27 +144,14 @@ export type GeometryToType<T extends GeometryType> =
138
144
  ? Circle
139
145
  : never;
140
146
 
141
- export type PickingBehavior = {
142
- setForAltitudeMode(altitudeMode: HeightReference): void;
143
- reset(): void;
144
- };
145
-
146
- export function createPickingBehavior(app: VcsApp): PickingBehavior {
147
+ export function setupPickingBehavior(app: VcsApp): () => void {
147
148
  const initialPickPosition =
148
149
  app.maps.eventHandler.featureInteraction.pickPosition;
149
150
 
150
- return {
151
- setForAltitudeMode(altitudeMode: HeightReference): void {
152
- if (altitudeMode === HeightReference.NONE) {
153
- app.maps.eventHandler.featureInteraction.pickPosition =
154
- EventType.CLICKMOVE | EventType.DRAGEVENTS;
155
- } else {
156
- app.maps.eventHandler.featureInteraction.pickPosition = EventType.NONE;
157
- }
158
- },
159
- reset(): void {
160
- app.maps.eventHandler.featureInteraction.pickPosition =
161
- initialPickPosition;
162
- },
151
+ app.maps.eventHandler.featureInteraction.pickPosition =
152
+ EventType.CLICKMOVE | EventType.DRAGEVENTS;
153
+
154
+ return () => {
155
+ app.maps.eventHandler.featureInteraction.pickPosition = initialPickPosition;
163
156
  };
164
157
  }
@@ -5,7 +5,7 @@ export const vertexSymbol = Symbol('Vertex');
5
5
  /**
6
6
  * Symbol to denote the vertexes index in the vertices array. This is important for snapping & bbox operations
7
7
  */
8
- export const vertexIndex = Symbol('VertexIndex');
8
+ export const vertexIndexSymbol = Symbol('VertexIndex');
9
9
  /**
10
10
  * Symbol added to primitives and features to denote that these are handlers. It is expected, that the value of the symobl is
11
11
  * equal to an {@link AxisAndPlanes}
@@ -13,6 +13,7 @@ import {
13
13
  } from '../../../layer/vectorSymbols.js';
14
14
  import ObliqueMap from '../../../map/obliqueMap.js';
15
15
  import type { CreateInteraction } from '../createFeatureSession.js';
16
+ import { is2DLayout } from '../../geometryHelpers.js';
16
17
 
17
18
  /**
18
19
  * Offset to prevent bbox from collapsing
@@ -32,6 +33,8 @@ class CreateBBoxInteraction
32
33
 
33
34
  private _lastCoordinate: Coordinate | null = null;
34
35
 
36
+ private _is3D = false;
37
+
35
38
  finished = new VcsEvent<Polygon | null>();
36
39
 
37
40
  created = new VcsEvent<Polygon>();
@@ -56,27 +59,32 @@ class CreateBBoxInteraction
56
59
  this._lastCoordinate[1] += precisionOffset;
57
60
  }
58
61
 
59
- this._lastCoordinate[2] = this._origin[2];
60
- let ringCoordinates;
62
+ if (this._is3D) {
63
+ this._lastCoordinate[2] = this._origin[2];
64
+ }
65
+
66
+ let lowerRight: Coordinate;
67
+ let upperLeft: Coordinate;
68
+
61
69
  if (
62
70
  (originXHigher && originYHigher) ||
63
71
  (!originXHigher && !originYHigher)
64
72
  ) {
65
- ringCoordinates = [
66
- this._origin,
67
- [this._lastCoordinate[0], this._origin[1], this._origin[2]],
68
- this._lastCoordinate,
69
- [this._origin[0], this._lastCoordinate[1], this._origin[2]],
70
- ];
73
+ lowerRight = [this._lastCoordinate[0], this._origin[1]];
74
+ upperLeft = [this._origin[0], this._lastCoordinate[1]];
71
75
  } else {
72
- ringCoordinates = [
73
- this._origin,
74
- [this._origin[0], this._lastCoordinate[1], this._origin[2]],
75
- this._lastCoordinate,
76
- [this._lastCoordinate[0], this._origin[1], this._origin[2]],
77
- ];
76
+ lowerRight = [this._origin[0], this._lastCoordinate[1]];
77
+ upperLeft = [this._lastCoordinate[0], this._origin[1]];
78
78
  }
79
- this._geometry.setCoordinates([ringCoordinates]);
79
+
80
+ if (this._is3D) {
81
+ lowerRight.push(this._origin[2]);
82
+ upperLeft.push(this._origin[2]);
83
+ }
84
+
85
+ this._geometry.setCoordinates([
86
+ [this._origin, lowerRight, this._lastCoordinate, upperLeft],
87
+ ]);
80
88
  }
81
89
  }
82
90
 
@@ -94,8 +102,9 @@ class CreateBBoxInteraction
94
102
  if (this._geometry) {
95
103
  this.finish();
96
104
  } else {
97
- this._geometry = new Polygon([[event.positionOrPixel.slice()]], 'XYZ');
105
+ this._geometry = new Polygon([[event.positionOrPixel.slice()]]);
98
106
  this._geometry.set('_vcsGeomType', GeometryType.BBox);
107
+ this._is3D = !is2DLayout(this._geometry.getLayout());
99
108
  if (event.map instanceof ObliqueMap) {
100
109
  this._geometry[alreadyTransformedToImage] = true;
101
110
  } else {
@@ -60,7 +60,7 @@ class CreateCircleInteraction
60
60
  if (this._geometry) {
61
61
  this.finish();
62
62
  } else {
63
- this._geometry = new Circle(event.positionOrPixel, 20, 'XYZ');
63
+ this._geometry = new Circle(event.positionOrPixel, 20);
64
64
  this._geometry[actuallyIsCircle] = event.map instanceof ObliqueMap;
65
65
  if (event.map instanceof ObliqueMap) {
66
66
  this._geometry[alreadyTransformedToImage] = true;
@@ -3,7 +3,10 @@ import type { Coordinate } from 'ol/coordinate.js';
3
3
  import AbstractInteraction, {
4
4
  EventAfterEventHandler,
5
5
  } from '../../../interaction/abstractInteraction.js';
6
- import { EventType } from '../../../interaction/interactionType.js';
6
+ import {
7
+ EventType,
8
+ ModificationKeyType,
9
+ } from '../../../interaction/interactionType.js';
7
10
  import VcsEvent from '../../../vcsEvent.js';
8
11
  import {
9
12
  alreadyTransformedToImage,
@@ -31,7 +34,10 @@ class CreateLineStringInteraction
31
34
  created = new VcsEvent<LineString>();
32
35
 
33
36
  constructor() {
34
- super(EventType.CLICKMOVE | EventType.DBLCLICK);
37
+ super(
38
+ EventType.CLICKMOVE | EventType.DBLCLICK,
39
+ ModificationKeyType.NONE | ModificationKeyType.CTRL,
40
+ );
35
41
  this.setActive();
36
42
  }
37
43
 
@@ -57,7 +63,7 @@ class CreateLineStringInteraction
57
63
 
58
64
  if (event.type & EventType.CLICK) {
59
65
  if (!this._geometry) {
60
- this._geometry = new LineString([event.positionOrPixel], 'XYZ');
66
+ this._geometry = new LineString([event.positionOrPixel]);
61
67
  if (event.map instanceof ObliqueMap) {
62
68
  this._geometry[alreadyTransformedToImage] = true;
63
69
  } else {
@@ -31,7 +31,7 @@ class CreatePointInteraction
31
31
  }
32
32
 
33
33
  pipe(event: EventAfterEventHandler): Promise<EventAfterEventHandler> {
34
- this._geometry = new Point(event.positionOrPixel, 'XYZ');
34
+ this._geometry = new Point(event.positionOrPixel);
35
35
  if (event.map instanceof ObliqueMap) {
36
36
  this._geometry[alreadyTransformedToImage] = true;
37
37
  } else {
@@ -3,7 +3,10 @@ import type { Coordinate } from 'ol/coordinate.js';
3
3
  import AbstractInteraction, {
4
4
  EventAfterEventHandler,
5
5
  } from '../../../interaction/abstractInteraction.js';
6
- import { EventType } from '../../../interaction/interactionType.js';
6
+ import {
7
+ EventType,
8
+ ModificationKeyType,
9
+ } from '../../../interaction/interactionType.js';
7
10
  import VcsEvent from '../../../vcsEvent.js';
8
11
  import {
9
12
  alreadyTransformedToImage,
@@ -12,6 +15,11 @@ import {
12
15
  import ObliqueMap from '../../../map/obliqueMap.js';
13
16
  import { CreateInteraction } from '../createFeatureSession.js';
14
17
 
18
+ /**
19
+ * Set on polygon geometries which have a validity placeholder active
20
+ */
21
+ export const validityPlaceholder = Symbol('validityPlaceholder');
22
+
15
23
  class CreatePolygonInteraction
16
24
  extends AbstractInteraction
17
25
  implements CreateInteraction<Polygon>
@@ -34,7 +42,10 @@ class CreatePolygonInteraction
34
42
  created = new VcsEvent<Polygon>();
35
43
 
36
44
  constructor() {
37
- super(EventType.CLICKMOVE | EventType.DBLCLICK);
45
+ super(
46
+ EventType.CLICKMOVE | EventType.DBLCLICK,
47
+ ModificationKeyType.NONE | ModificationKeyType.CTRL,
48
+ );
38
49
  this.setActive();
39
50
  }
40
51
 
@@ -60,12 +71,13 @@ class CreatePolygonInteraction
60
71
 
61
72
  if (event.type & EventType.CLICK) {
62
73
  if (!this._geometry) {
63
- this._geometry = new Polygon([[event.positionOrPixel.slice()]], 'XYZ');
74
+ this._geometry = new Polygon([[event.positionOrPixel.slice()]]);
64
75
  if (event.map instanceof ObliqueMap) {
65
76
  this._geometry[alreadyTransformedToImage] = true;
66
77
  } else {
67
78
  this._geometry[alreadyTransformedToMercator] = true;
68
79
  }
80
+ this._geometry[validityPlaceholder] = true;
69
81
  this.created.raiseEvent(this._geometry);
70
82
  this._coordinates = [event.positionOrPixel.slice()];
71
83
  this._lastCoordinate = [...event.positionOrPixel];
@@ -76,6 +88,7 @@ class CreatePolygonInteraction
76
88
  this._lastCoordinate = [...(this._lastCoordinate as Coordinate)];
77
89
  this._coordinates.splice(2, 1, this._lastCoordinate);
78
90
  this._validityPlaceHolder = null;
91
+ this._geometry[validityPlaceholder] = false;
79
92
  } else {
80
93
  this._lastCoordinate = [...(this._lastCoordinate as Coordinate)];
81
94
  this._coordinates.push(this._lastCoordinate);
@@ -0,0 +1,226 @@
1
+ import { LineString, Polygon } from 'ol/geom.js';
2
+ import { Coordinate } from 'ol/coordinate.js';
3
+ import { unByKey } from 'ol/Observable.js';
4
+ import AbstractInteraction from '../../../interaction/abstractInteraction.js';
5
+ import {
6
+ EventType,
7
+ ModificationKeyType,
8
+ } from '../../../interaction/interactionType.js';
9
+ import {
10
+ getSnappedCoordinateForResults,
11
+ getAngleSnapResult,
12
+ setSnappingFeatures,
13
+ SnapResult,
14
+ getGeometrySnapResult,
15
+ SnapType,
16
+ snapTypes,
17
+ } from '../snappingHelpers.js';
18
+ import { getCartesianBearing } from '../../math.js';
19
+ import type VectorLayer from '../../../layer/vectorLayer.js';
20
+ import { validityPlaceholder } from './createPolygonInteraction.js';
21
+ import {
22
+ alreadySnapped,
23
+ SnappingInteractionEvent,
24
+ } from '../editorSessionHelpers.js';
25
+
26
+ function getBearings(coordinates: Coordinate[]): number[] {
27
+ // we dont want to take into account the last bearing, since that would be our own
28
+ const length = coordinates.length - 2;
29
+ if (length > 0) {
30
+ const bearings = new Array<number>(length);
31
+ for (let i = 0; i < length; i++) {
32
+ bearings[i] = getCartesianBearing(coordinates[i], coordinates[i + 1]);
33
+ }
34
+ return bearings;
35
+ }
36
+
37
+ return [];
38
+ }
39
+
40
+ export default class CreationSnapping extends AbstractInteraction {
41
+ private _coordinates: Coordinate[] = [];
42
+
43
+ private _bearings: number[] = [];
44
+
45
+ private _scratchLayer: VectorLayer;
46
+
47
+ private _isPolygon = false;
48
+
49
+ private _coordinatesDirty = false;
50
+
51
+ private _geometryLister: (() => void) | undefined;
52
+
53
+ private _removeFeatures: (() => void) | undefined;
54
+
55
+ private _snappingGeometry: LineString | undefined;
56
+
57
+ private _snapToVertex = true;
58
+
59
+ private _snapToEdge = true;
60
+
61
+ private _snapOrthogonal = true;
62
+
63
+ private _snapParallel = true;
64
+
65
+ constructor(scratchLayer: VectorLayer, snapTo: SnapType[] = [...snapTypes]) {
66
+ super(
67
+ EventType.CLICKMOVE | EventType.DBLCLICK,
68
+ ModificationKeyType.NONE | ModificationKeyType.CTRL,
69
+ );
70
+
71
+ this._scratchLayer = scratchLayer;
72
+ this.snapTo = snapTo;
73
+ }
74
+
75
+ get snapTo(): SnapType[] {
76
+ const snapTo: SnapType[] = [];
77
+ if (this._snapToVertex) {
78
+ snapTo.push('vertex');
79
+ }
80
+
81
+ if (this._snapToEdge) {
82
+ snapTo.push('edge');
83
+ }
84
+
85
+ if (this._snapOrthogonal) {
86
+ snapTo.push('orthogonal');
87
+ }
88
+
89
+ if (this._snapParallel) {
90
+ snapTo.push('parallel');
91
+ }
92
+
93
+ return snapTo;
94
+ }
95
+
96
+ set snapTo(snapTo: SnapType[]) {
97
+ this._snapToVertex = snapTo.includes('vertex');
98
+ this._snapToEdge = snapTo.includes('edge');
99
+ this._snapOrthogonal = snapTo.includes('orthogonal');
100
+ this._snapParallel = snapTo.includes('parallel');
101
+ }
102
+
103
+ private _setCoordinates(coordinates: Coordinate[]): void {
104
+ this._coordinates = coordinates;
105
+ this._bearings = getBearings(this._coordinates);
106
+ if (this._coordinates.length > 2) {
107
+ this._snappingGeometry = new LineString(
108
+ this._coordinates.slice(0, this._coordinates.length - 1),
109
+ );
110
+ }
111
+ }
112
+
113
+ setGeometry(geometry: LineString | Polygon): void {
114
+ this._geometryLister?.();
115
+ this._snappingGeometry = undefined;
116
+ let setCoordinates: () => void;
117
+ if (geometry instanceof Polygon) {
118
+ this._isPolygon = true;
119
+ setCoordinates = (): void => {
120
+ if (!geometry[validityPlaceholder]) {
121
+ this._setCoordinates(geometry.getCoordinates()[0]);
122
+ }
123
+ };
124
+ } else {
125
+ this._isPolygon = false;
126
+ setCoordinates = (): void => {
127
+ this._setCoordinates(geometry.getCoordinates());
128
+ };
129
+ }
130
+ setCoordinates();
131
+ const key = geometry.on('change', () => {
132
+ if (this._coordinatesDirty) {
133
+ setCoordinates();
134
+ this._coordinatesDirty = false;
135
+ }
136
+ });
137
+ this._geometryLister = (): void => {
138
+ unByKey(key);
139
+ };
140
+ }
141
+
142
+ pipe(event: SnappingInteractionEvent): Promise<SnappingInteractionEvent> {
143
+ this._removeFeatures?.();
144
+ if (event.type === EventType.CLICK) {
145
+ event.chainEnded?.addEventListener(() => {
146
+ this._coordinatesDirty = true;
147
+ });
148
+ }
149
+ if (
150
+ !event[alreadySnapped] &&
151
+ event.key !== ModificationKeyType.CTRL &&
152
+ this._coordinates.length >= 3
153
+ ) {
154
+ const results = new Array<SnapResult | undefined>(2);
155
+ const maxDistanceSquared =
156
+ (event.map.getCurrentResolution(event.positionOrPixel!) * 12) ** 2;
157
+
158
+ if (this._snappingGeometry) {
159
+ results[0] = getGeometrySnapResult(
160
+ [this._snappingGeometry],
161
+ event.positionOrPixel!,
162
+ maxDistanceSquared,
163
+ this._snapToVertex,
164
+ this._snapToEdge,
165
+ );
166
+ }
167
+
168
+ if (!results[0] && (this._snapOrthogonal || this._snapParallel)) {
169
+ results[0] = getAngleSnapResult(
170
+ event.positionOrPixel!,
171
+ this._coordinates.at(-2)!,
172
+ this._coordinates.at(-3)!,
173
+ this._bearings,
174
+ this._coordinates.length - 2,
175
+ maxDistanceSquared,
176
+ this._snapOrthogonal,
177
+ this._snapParallel,
178
+ );
179
+
180
+ if (this._isPolygon) {
181
+ const newCandidate = results[0]?.snapped ?? event.positionOrPixel!;
182
+ results[1] = getAngleSnapResult(
183
+ newCandidate,
184
+ this._coordinates.at(0)!,
185
+ this._coordinates.at(1)!,
186
+ this._bearings,
187
+ 0,
188
+ maxDistanceSquared,
189
+ this._snapOrthogonal,
190
+ this._snapParallel,
191
+ );
192
+ }
193
+ }
194
+
195
+ const lastResult = getSnappedCoordinateForResults(
196
+ results,
197
+ this._coordinates,
198
+ maxDistanceSquared,
199
+ );
200
+
201
+ if (lastResult) {
202
+ if (event.positionOrPixel!.length > lastResult.length) {
203
+ lastResult[2] = event.positionOrPixel![2];
204
+ } else if (event.positionOrPixel!.length < lastResult.length) {
205
+ lastResult.pop();
206
+ }
207
+
208
+ event.positionOrPixel = lastResult;
209
+
210
+ this._removeFeatures = setSnappingFeatures(
211
+ results,
212
+ this._coordinates,
213
+ this._scratchLayer,
214
+ );
215
+ }
216
+ }
217
+
218
+ return Promise.resolve(event);
219
+ }
220
+
221
+ destroy(): void {
222
+ this._geometryLister?.();
223
+ this._removeFeatures?.();
224
+ super.destroy();
225
+ }
226
+ }
@@ -1,4 +1,4 @@
1
- import { mouseOverSymbol, vertexSymbol } from '../editorSymbols.js';
1
+ import { mouseOverSymbol } from '../editorSymbols.js';
2
2
  import AbstractInteraction, {
3
3
  EventAfterEventHandler,
4
4
  } from '../../../interaction/abstractInteraction.js';
@@ -6,7 +6,7 @@ import {
6
6
  ModificationKeyType,
7
7
  EventType,
8
8
  } from '../../../interaction/interactionType.js';
9
- import { Vertex } from '../editorHelpers.js';
9
+ import { isVertex, Vertex } from '../editorHelpers.js';
10
10
 
11
11
  const pointerSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 19 19">
12
12
  <g id="pen">
@@ -46,17 +46,18 @@ class EditGeometryMouseOverInteraction extends AbstractInteraction {
46
46
  constructor(denyRemoval?: boolean) {
47
47
  super(
48
48
  EventType.MOVE,
49
- denyRemoval
49
+ (denyRemoval
50
50
  ? ModificationKeyType.NONE
51
- : ModificationKeyType.NONE | ModificationKeyType.SHIFT,
51
+ : ModificationKeyType.NONE | ModificationKeyType.SHIFT) |
52
+ ModificationKeyType.CTRL,
52
53
  );
53
54
 
54
55
  this.setActive();
55
56
  }
56
57
 
57
58
  pipe(event: EventAfterEventHandler): Promise<EventAfterEventHandler> {
58
- if (event.feature && (event.feature as Vertex)[vertexSymbol]) {
59
- this._currentVertex = event.feature as Vertex;
59
+ if (isVertex(event.feature)) {
60
+ this._currentVertex = event.feature;
60
61
  } else {
61
62
  this._currentVertex = null;
62
63
  }
@@ -7,7 +7,7 @@ import {
7
7
  EventType,
8
8
  ModificationKeyType,
9
9
  } from '../../../interaction/interactionType.js';
10
- import { cartesian2DDistance } from '../../math.js';
10
+ import { cartesian2DDistanceSquared } from '../../math.js';
11
11
  import {
12
12
  createVertex,
13
13
  getOlcsPropsFromFeature,
@@ -16,6 +16,9 @@ import {
16
16
  type Vertex,
17
17
  } from '../editorHelpers.js';
18
18
  import VcsEvent from '../../../vcsEvent.js';
19
+ import { is2DLayout } from '../../geometryHelpers.js';
20
+ import { isClampedHeightReference } from '../../featureconverter/vectorHeightInfo.js';
21
+ import VectorProperties from '../../../layer/vectorProperties.js';
19
22
 
20
23
  export type VertexInsertedEvent = {
21
24
  vertex: Vertex;
@@ -31,6 +34,8 @@ class InsertVertexInteraction extends AbstractInteraction {
31
34
 
32
35
  private _isLinearRing: boolean;
33
36
 
37
+ private _vectorProperties: VectorProperties;
38
+
34
39
  /**
35
40
  * @param feature
36
41
  * @param geometry
@@ -38,11 +43,13 @@ class InsertVertexInteraction extends AbstractInteraction {
38
43
  constructor(
39
44
  feature: Feature<LineString | Polygon>,
40
45
  geometry: LineString | LinearRing,
46
+ vectorProperties: VectorProperties,
41
47
  ) {
42
48
  super(EventType.CLICK, ModificationKeyType.NONE);
43
49
 
44
50
  this._feature = feature;
45
51
  this._geometry = geometry;
52
+ this._vectorProperties = vectorProperties;
46
53
  this._isLinearRing = this._geometry instanceof LinearRing;
47
54
  this.setActive();
48
55
  }
@@ -56,15 +63,27 @@ class InsertVertexInteraction extends AbstractInteraction {
56
63
  if (this._isLinearRing) {
57
64
  lineCoords.push(lineCoords[0]);
58
65
  }
59
- const distance = cartesian2DDistance(closestCoord, coordinate); // todo respect altitude mode here. e.g. distance3D
60
- if (distance < event.map.getCurrentResolution(coordinate) * 5) {
66
+ const distanceSquared = cartesian2DDistanceSquared(
67
+ closestCoord,
68
+ coordinate,
69
+ ); // todo respect altitude mode here. e.g. distance3D
70
+ const is2DLine =
71
+ is2DLayout(this._geometry.getLayout()) ||
72
+ isClampedHeightReference(
73
+ this._vectorProperties.getAltitudeMode(this._feature),
74
+ );
75
+
76
+ // XXX how to handle relative to ground height references?
77
+ if (
78
+ distanceSquared <
79
+ (event.map.getCurrentResolution(coordinate) * 5) ** 2
80
+ ) {
61
81
  const length = lineCoords.length - 1;
62
82
  let i = 0;
63
83
  for (i; i < length; i++) {
64
- const onLine =
65
- this._feature.get('olcs_altitudeMode') === 'clampToGround' // todo altitude mode
66
- ? pointOnLine2D(lineCoords[i], lineCoords[i + 1], closestCoord)
67
- : pointOnLine3D(lineCoords[i], lineCoords[i + 1], closestCoord);
84
+ const onLine = is2DLine
85
+ ? pointOnLine2D(lineCoords[i], lineCoords[i + 1], closestCoord)
86
+ : pointOnLine3D(lineCoords[i], lineCoords[i + 1], closestCoord);
68
87
  if (onLine) {
69
88
  break;
70
89
  }
@@ -78,6 +97,7 @@ class InsertVertexInteraction extends AbstractInteraction {
78
97
  vertex: createVertex(
79
98
  closestCoord,
80
99
  getOlcsPropsFromFeature(this._feature),
100
+ -1,
81
101
  ),
82
102
  index,
83
103
  });