Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I find distance between two places. I have full postal address. I have little idea that we can do it on Google Map but I don’t have to show the map. I just have to calculate and show it to the user. My application is in VB.net. a desktop application.
Posted

Use Bing Map API, it respond you with the xml/json data, pares and use as you want :
http://www.microsoft.com/maps/developers/web.aspx[^]
http://www.microsoft.com/maps/[^]
http://www.bing.com/developers/[^]

Thanks,
Ambesha
 
Share this answer
 
v3
Try this





src="http://maps.googleapis.com/maps/api/js?sensor=true&libraries=geometry">

function calcRoute() {
geocoder = new google.maps.Geocoder();
var start = document.getElementById("start").value;
var end = document.getElementById("end").value;
var slatlng ;
var elatlng;
geocoder.geocode({ 'address': start }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var result = results[0].geometry.location.toString();
slatlng = results[0].geometry.location;
}
});
geocoder.geocode({ 'address': end }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var result = results[0].geometry.location.toString();
elatlng = results[0].geometry.location;
var distance = (google.maps.geometry.spherical.computeDistanceBetween(slatlng , elatlng ) / 1000).toFixed(2);
$('#distance').html("Distance between " +start+" and "+end+" is:"+distance);
}
});


}







 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900