Calculate the distance from the two latlng objects

103 views
Skip to first unread message

千秋

unread,
Oct 10, 2011, 10:05:46 PM10/10/11
to Google Maps JavaScript API v3
I want to calculate the distance between two objects latlng, and want
to know the formula for calculating the distance calculation, so that
I can deal with php search data, screening results returned。
My English is not good, please forgive me!

Thank you!

MymsMan

unread,
Oct 11, 2011, 6:33:19 AM10/11/11
to google-map...@googlegroups.com
See http://code.google.com/apis/maps/documentation/javascript/reference.html#spherical
The computeDistanceBetween() method calculates the distance between LatLng pairs

Rossko

unread,
Oct 11, 2011, 3:29:29 PM10/11/11
to Google Maps JavaScript API v3
> I want to calculate the distance between two objects latlng, and want
> to know the formula for calculating the distance calculation

If you want the general formulaes to write code in the language of
your choice, use Google's search engine
http://www.google.com/search?q=lat+long+distance+calculation
example
http://www.mathforum.com/library/drmath/view/51711.html
If you refine your search you can probably find pre-coded examples
http://www.google.com/search?q=php+lat+long+distance+algorithm

千秋

unread,
Oct 11, 2011, 9:53:08 PM10/11/11
to Google Maps JavaScript API v3
Thank you for your answer,google maps api Chinese version of the
update rate slower than the English version, thanks again!

On Oct 11, 6:33 pm, MymsMan <bobbux...@gmail.com> wrote:
> Seehttp://code.google.com/apis/maps/documentation/javascript/reference.h...

千秋

unread,
Oct 11, 2011, 9:57:16 PM10/11/11
to Google Maps JavaScript API v3
Thank you for your help ,I found this url in the relevant formula。

http://code.google.com/intl/zh-CN/apis/maps/articles/phpsqlsearch_v3.html

On Oct 12, 3:29 am, Rossko <ros...@culzean.clara.co.uk> wrote:
> > I want to calculate the distance between two objects latlng, and want
> > to know the formula for calculating the distance calculation
>
> If you want the general formulaes to write code in the language of
> your choice, use Google's search enginehttp://www.google.com/search?q=lat+long+distance+calculation
> examplehttp://www.mathforum.com/library/drmath/view/51711.html
Reply all
Reply to author
Forward
0 new messages