[OpenLayers-Users] Click to get nearest point on track

Richard Jones richardjnz at yahoo.com
Wed Nov 28 11:58:15 PST 2012


I have managed to import a GPX file using OpenLayers.Format.GPX and addFeatures which displays the track nicely on a dedicated layer.

I would like to allow the user to click anywhere on the displayed track or fairly near it, and a javascript function would be fired with the lat and long passed to it of the corresponding point on the track (or if the click is not quite on the track then the NEAREST corresponding point on the track).

Is it possible to do this?

If it is possible, is there likely to be any confusion between this click and a click-to-drag/pan the map?



More information about the Users mailing list