Created
April 16, 2012 13:00
-
-
Save dmozzy/2398636 to your computer and use it in GitHub Desktop.
Calculate Distance using google.maps.geometry.spherical.computeDistanceBetween
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry" type="text/javascript"></script> | |
<script type="text/javascript"> | |
function calcDistance (fromLat, fromLng, toLat, toLng) { | |
return google.maps.geometry.spherical.computeDistanceBetween( | |
new google.maps.LatLng(fromLat, fromLng), new google.maps.LatLng(toLat, toLng)); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank You... this worked for me!