سؤال

I want to use the snap control in my project. I saw a lot of examples on how to use it in openlayers 2. In my project I am using openlayers 3. Is there a snap control in openlayers 3?

هل كانت مفيدة؟

المحلول

No. It is marked as an open issue, https://github.com/openlayers/ol3/issues/1164. If you look at the source code for modifyinteraction and drawinteraction at https://github.com/openlayers/ol3/blob/master/src/ol/interaction/modifyinteraction.js and https://github.com/openlayers/ol3/blob/master/src/ol/interaction/drawinteraction.js you will see that some of the mechanics of snapping are in place already, but there is no snapping control. OL3 is still in beta (edit, gamma) and there is only a limited budget, so we will either have to wait, or write it yourself and issue a pull request on github :D.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top