[mapserver-users] quickly finding which point on map is nearest to mouse click

Scott D Cogan cogansco at msu.edu
Mon Apr 8 14:50:47 EDT 2002


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




More information about the mapserver-users mailing list