Using ol3 I can use ol.interaction.Modify to enable users to move points, and add, move and delete vertices of lines and polygons.

Is it possible to enable users to change a point into a line (or a polygon)? One use case is where they have identified houses with points at a low zoom level, but now want to go to a higher zoom level so want to show the same houses as polygons.

I can think of one way (by providing a special button), but is there any more natural OpenLayers way?

  • First, you don't need to change it to point from polygon to keep its shape. Second, you can remove point and create polygon by checking map level. – Chase Choi Dec 26 '17 at 0:29
  • Thanks for your reply. I think I understand what you are saying, but I don't think it really addresses my issue. On your first, I would like the user to be able to change a point to a polygon, not the other way round. On your second, this sounds like something I could program in, but not something the user can do. – Peter Cooper Jan 1 '18 at 6:16
  • what about to create polygon which has the same points something like [[0, 0], [0, 0], [0,0]] then it looks like a point then allow users to modify it to make polygon shape. – Chase Choi Jan 2 '18 at 1:27
  • If there is no OpenLayers way then this is what I plan to do - add a button in my dialogue that the user can press to change the geometry type of a feature, eg a point into a polygon. Thanks. – Peter Cooper Jan 3 '18 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.