开发者

Converting DATUM WGS84 coordinates for google map v3 JS Latlng Object

开发者 https://www.devze.com 2023-03-17 15:30 出处:网络
I am trying to convert the following to work with the Google maps v3 JS api. N37 10.320 W122 13.357 How do I convert this to work with the LatLng Object?

I am trying to convert the following to work with the Google maps v3 JS api.

N37 10.320 W122 13.357

How do I convert this to work with the LatLng Object?

I was expecting it to be two decimals, eithe开发者_JAVA百科r positive or negative.

Thanks!


I guess it's just a matter of converting degree-minutes to decimals. The coordinates above mean 37 degrees + 10.320 minutes. 60 minutes make one degree so you should be getting:

lat = degrees + minutes/60

In your example

37.172269 = 37 + 10.320/60

The N/S E/W translate to the sign of the coordinate. I guess North and East mean positive signs, South and West mean negative.

0

精彩评论

暂无评论...
验证码 换一张
取 消