skaterdav85 Posted January 28, 2011 Share Posted January 28, 2011 I am creating a store locator page on a mobile device using the phone's current location and the lat/long of the store. What is the most efficient method on a mobile device to find the distances between the 2 points? Should I use something like the Vincenty Formula: http://www.movable-type.co.uk/scripts/latlong-vincenty.htmlor the Google Maps API? Link to comment Share on other sites More sharing options...
boen_robot Posted January 29, 2011 Share Posted January 29, 2011 It seems the formula is for straight lines... and directions don't usually involve straights.You should better use Google's API for directions, ideally letting people choose between car and walking directions. Link to comment Share on other sites More sharing options...
jeffman Posted January 29, 2011 Share Posted January 29, 2011 Yup. In a hypothetical city laid out with perfectly rectangular grids, a straight line will always be approx 1.4 times too short.In a mountainous region (like the one where I live) a straight line is generally way too short. I routinely drive 4-5 times the straight-line distance to reach nearby cities. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.