[mapserver-users] quickly finding which point on map is nearest to mouse click
Scott D Cogan
Scott D Cogan" <cogansco@_nospam_.edu
Mon, 8 Apr 2002 14:50:47 -0400
I have a map with certain lat/lon coordinates marked as sites. I would like
users to be able to click on the map and have information for the nearest
site become highlighted. To do this, I have converted the mouse click
coordinates to lat/lon coordinates which are mapped. Then I am planning on
calculating for each site, the distance between the click and the site, and
storing the remembering the closest one. Is there a quicker way to do this?
Would it be beneficial to use the distanceToPoint function in mapscript?
-scott