I'm currently working on a web application where there are OpenLayers geometries that are clickable. However, since the size of the geometries can be rather small, it can be hard to click on them. Is it possible to add padding to increase the clickable area without increasing the size of the polyline?

UPDATE: I've since figured out that the way the application works, when a point is clicked, OpenLayers takes the coordinate and tries to find what is at that coordinate. So I have to find a way to expand the coordinate and send it a few other coordinates to see if it will select what I want.

  • Another option would be to show details for the polyline that is nearest to where the click happened. There is an answer for how to do that in response to this question – Alexander Jan 29 '16 at 15:40
  • @alex Thank you! I think that's going to be really helpful. – tibsar Jan 29 '16 at 15:59

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.