2016-11-11 48 views

回答

2

正確調用。要獲得緯度,請將其稱爲lat()方法。要獲得經度,請將其稱爲lng()方法。

例如:

var latitude = results[0].geometry.location.lat(); 
var longitude = results[0].geometry.location.lng(); 
+0

是的,就是這樣! – Faloude

1

results[0].geometry.locationgoogle.maps.LatLng對象,它有一個.lat()方法返回的緯度和一個返回經度.lng()方法。