Hello!
Can you help me with Cesium, is there any code for polygon “object snap” function? Object snap for endpoint and near when you draw second polygons?
Thank you,
Kind regards
Hello!
Can you help me with Cesium, is there any code for polygon “object snap” function? Object snap for endpoint and near when you draw second polygons?
Thank you,
Kind regards
I think that there is no “built-in” functionality for that (to be confirmed by the CesiumJS core team). The reason for that may be that it raises a few question about the desired interaction and details of the behavior of this “snapping”. For example: Should it snap to all existing points (and if so, where exactly are these points defined or collected?) Should the “snap radius” depend on the zoom level? How to visualize the snap radius? Should it be possible to disable the snapping temporarily, to be able to set points precisely at a certain position? …
But the basic functionality could probably be implemented as follows:
The effect could roughly look like this:
Again, there are many details for the implementation that may depend on your exact requirements, and how exactly you are currently creating and drawing the polygons. But one possible implementation is sketched in this sandcastle:
(Parts of this are based on the Drawing On Terrain sandcastle)
Thank you so much @Macro13