相关文章推荐
仗义的手术刀  ·  【Elastic Search】 ...·  8 月前    · 
淡定的米饭  ·  GLES2.0。通过glEGLImageTa ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am using Modify and Snap interaction together, I am listening the modifyEnd event of the Modify interaction. How can i know the modifyEvent is snapped or not.

Snap interaction does not work well with 3D geometries. My geometries are 3D. Z value is not changing even snapped vertex Z is different. So how can i get the vertex of the snapped position

map.getEventPixel(event.mapBrowserEvent.originalEvent) will be the true position of the pointer.

event.mapBrowserEvent.pixel will the the snapped position.

If they are different the position has been updated by the Snap interaction.

Also if snapped event.mapBrowserEvent.coordinate will be a point exactly on the snapped geometry while map.getCoordinateFromPixel(event.mapBrowserEvent.pixel) will be a less accurate coordinate calculated to one pixel accuracy

I think modify/snap would only be designed to work in 2d on a flat screen. You could interpolate between the existing vertices to set an appropriate z.for a new point. Mike Oct 12, 2020 at 19:35

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .