Hi Guys,
I’ve found out how to find the distance between 2 lat lng points using google’s distanceFrom method:
// NR14 7PZ
var loc1 = new GLatLng(52.5773139, 1.3712427);
// NR32 1TB
var loc2 = new GLatLng(52.4788314, 1.7577444);
alert(loc2.distanceFrom(loc1) / 1000);
However, I’d like to be able to convert a distance to lat lng.
The main reason I’m doing this is so that I can figure out the bounds of a certain area of a co-ordinate.
For example I specify a point, and then I need to draw a box around this area going x distance North, South, East and West, but until I know how many units make up a kilometre this wont be easy.
I guess I could go to google maps, click on a point and then click on another point and keep doing that until I get exactly 1km away from the original point, then just minus or plus for the lat and lng to find out the unit value for 1km, but I have a feeling that this wont be accurate.
Can anyone lend any advice, I realize that what I’m asking is more a map question than a google maps javascript api question, but perhaps someone has come across this before?