So, I'm trying to implement the haversine formula to get the straight line distances. I've almost completed it expect that I can't get total += distance working to collect all the distances that I calculated.
Could someone assist me and let me know what I'm doing wrong? If I click on any of the markers the formula result appears but I can't get the result to add to the running total. http://people.southwestern.edu/~mccordl/googlemaps/test.php Thanks. On Apr 15, 4:23 pm, "[email protected]" <[email protected]> wrote: > On Apr 15, 1:36 pm, loulou2u <[email protected]> wrote:> That's a good > suggestion. However, how would I figure out the driving > > distance? Is the google map api the only way to figure out the > > driving distance? > > Yes (well, there are probably other ways: measuring it on a map, using > another service, buying the data...) > I have a tool that will let you do that manually with the > API:http://www.geocodezip.com/example_geo2.asp?addr1=2901%20Capital%20of%... > > gives 6.8 mi > > > In your scenario, are you suggesting that I use the "bird's-eye view" > > calculation of a straight line distance? > > That would be even easier (if you have the latitude and longitude for > the 2 points): > javascript:GLog.write(new GLatLng(30.257806, -97.807067).distanceFrom > (new GLatLng(30.27265, -97.740252))); > > gives 6633.1687 meters, which > is:http://www.google.com/search?sourceid=gmail&q=6633.168744825922%20met... > 4.12 miles > > -- Larry > > > > > Thanks > > > On Apr 15, 3:22 pm, Rossko <[email protected]> wrote: > > > > > So my central point is our State Capital and I'm plotting attractions > > > > with their distances from the central point. > > > > > Any Ideas? > > > > Guessing that the attractions don't move round much, do the distance > > > calculations when you add an attraction to your database and store > > > that. Saves a lot of wasted time doing lookups on every page view.- Hide > > > quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
