How to calculate a latlng on google map ceartain distance away from another?
Posted
by Rene Saarsoo
on Stack Overflow
See other posts from Stack Overflow
or by Rene Saarsoo
Published on 2010-04-14T11:44:52Z
Indexed on
2010/04/14
11:53 UTC
Read the original article
Hit count: 177
google-maps
|JavaScript
To draw a circle on map I have a center GLatLng (A) and a radius (r) in meters.
Here's a diagram:
-----------
--/ \--
-/ \-
/ \
/ \
/ r \
| *-------------*
\ A / B
\ /
\ /
-\ /-
--\ /--
-----------
How to calculate the GLatLng at position B? Assuming that r is parallel to the equator.
Getting the radius when A and B is given is trivial using the GLatLng.distanceFrom() method - but doing it the other way around not so. Seems that I need to do some heavier math.
© Stack Overflow or respective owner