Given three points (or more) on a map, I would like to find the point that is closest to all of them and is at the same driving distance from all of them. I would like to do this in Google Maps, using the provided driving directions service.
Any idea?
Thanks a lot
UPDATE
in this question is mentioned a way to find the center of a bunch of locations, which could be a first step
var locations = [
['Bondi Beach', -33.890542, 151.274856, 4],
['Coogee Beach', -33.923036, 151.259052, 5],
['Cronulla Beach', -34.028249, 151.157507, 3],
['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
['Maroubra Beach', -33.950198, 151.259302, 1]
];
//[OTHER CODE]
var bound = new google.maps.LatLngBounds();
for (i = 0; i < locations.length; i++) {
bound.extend( new google.maps.LatLng(locations[i][1], locations[i][2]) );
// OTHER CODE
}
var geoCenter = bound.getCenter();//THIS IS THE GEOGRAPHICAL CENTER
After this, one could just retrieve the driving directions from each point to the center, and hope they're about the same distance. If, for any reason, the distances are too different, some kind of methodology should developed in order to find the desired point.