Hello, I am new to the Google API. I am doing a PoC for incorporating the Google Maps to my company's site. All I am trying to do is to GEOCODE and find out the distance between 2 addresses in US.
I took 2 addresses determined their geocodes using the HTTP Service: http://maps.google.com/maps/geo?q=????????&key=?????????&sensor=false&output=xml 2500 N State Road 7, Hollywood, 33021 (-80.2083941, 26.0322144) 590 W Flagler St, Miami, 33130 (-80.2042310, 25.7735980) Then I tried to find out the distance using GLatLng.distanceFrom() I wasnt sure whether the distance would be Driving Distance or over a straight line. However the addresses that I picked up are almost in straight line. Hence both the distances should be close to each other. If I get the directions on the Google Maps, I get a distance of 20 miles, whereas I get 4918 meters using the GLatLng.distanceFrom() method. I have no clue why this is happening. Any help in this regard is appreciated. Below is the code I used: <%-- Check whether the browser is compatible --%> if (GBrowserIsCompatible()) { alert("Browser is compatible"); var point1 = new GLatLng(-80.2083941, 26.0322144); var point2 = new GLatLng(-80.2042310, 25.7735980); var distance = point2.distanceFrom(point1); alert(distance); } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
