Is there a way to display the miles between distances?

37 views
Skip to first unread message

Elizeo Benavidez

unread,
Jul 22, 2013, 11:20:55 PM7/22/13
to app-...@googlegroups.com
I'm using the geolocation api and would like to know how to display how many miles the user is away from the destination location.

I thought I heard there was a code snippet that takes care of that.

Thanx

Chayo


Matthew Dobson

unread,
Jul 23, 2013, 2:17:11 PM7/23/13
to app-...@googlegroups.com
There isn't anything out of the box to calculate the distance between two lat longs as far as I know, but there are resources out there to help you figure out the formula. Here is a site that I've used before.


-Matt

Tim Anglade

unread,
Jul 23, 2013, 5:21:25 PM7/23/13
to app-...@googlegroups.com
__________________________________

Yup, I use the same JavaScript algorithm in my store locator sample app. You can see how to use it in context inside an HTML5 / jQuery Mobile app here: https://github.com/timanglade/targets/blob/att/www/index.html#L46-L58

[[49169956765b1c902d69cda0302936926989a0eb-134333525]]
Reply all
Reply to author
Forward
0 new messages