Hey, Could someone point me to documentation on how to find distance between to locations via their lat/long or another way to do what i'm trying to do
I have a list of locations and their latitude/longitude and I want to display a map that zooms out to display a minimum of 10 locations near a location that is typed in.

Finding distances
incendy
Ok it is a little complex becouse the world is not flat (shock!) its a sphere (sort of).
If you don't care about accuracy and the points are within a few hundred miles then you can go with simple trig.
square root of ((Lat2-lat1)squared + (Long2-Long1)squared)
type thing. But if you want accuracy you should read this:
http://www.movable-type.co.uk/scripts/LatLong.html
John.
mahima
Shady9399
I needed this exact same thing and have posted the code to the Code Wiki.
Get it here: http://viavirtualearth.com/Wiki/distance.ashx
ACHawk
vbnvbn
double lat = 40.657498;
double lng = -111.865899;
int DiameterEarth = 25000;
double degreeOfLatitude = DiameterEarth / 360;
double oneMileDegree = (1 / degreeOfLatitude) * 10;
double degreeOfLongitude = degreeOfLatitude * Math.Cos(lat * (180 / Math.PI));
double oneMileDegreeLng = (1 / degreeOfLongitude) * 10;
Console.WriteLine("Lat Range: {0}:{1}", lat - oneMileDegree, lat + oneMileDegree);
Console.WriteLine("Long Range: {0}:{1}", lng - oneMileDegreeLng, lng + oneMileDegreeLng);
Console.ReadLine();
Nimrand
Yeah thats the best one JonnyAJAX, that's the site where i got the more accurate circles from.
I'm thinking maybe we need to wrap a few of these up into a helper class specifically for VE.
Thanks for putting it on the WIKI.
John.
Monte Chan
you could also try to use the map getRoute method (passing as parameters both lats and longs) and then in the callback you can know how far away are both points.
regards
dario