2016-11-11 45 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()方法。