谷歌地图API提供的纬度/经度单位

3

我已经向谷歌地图API提供了一个地址,比如"21511 CONGRESS SPRINGS RD, Saratoga",API会给我返回对应的纬度/经度:

latitude=37.252165,longitude=-122.056565,我需要知道这些纬度和经度的单位是什么,它们是以弧度为单位吗?

1个回答

9
现在它们是以度为单位的。但是您可以通过添加以下代码将它们转换为弧度:
google.maps.LatLng.prototype.latRadians = function()
{
   return (Math.PI * this.lat()) / 180;
}
google.maps.LatLng.prototype.lngRadians = function()
{
   return (Math.PI * this.lng()) / 180;
}

想要了解更多,请访问:https://developers.google.com/maps/documentation/javascript/reference#LatLng

如果您还有任何疑问,请留言。

Suyash


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接