【发布时间】:2016-01-19 13:16:01
【问题描述】:
我正在尝试使用谷歌地图创建基于城市的坐标,这是我现在拥有的示例,我总是出错?
var address = 'Zurich, Ch';
var geocoder = new google.maps.Geocoder();
geocoder.geocode({
'address': address
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var Lat = results[0].geometry.location.lat();
var Lng = results[0].geometry.location.lng();
} else {
alert("Something got wrong " + status);
}
});
var myOptions = {
zoom: 11,
center: new google.maps.LatLng(Lat, Lng),
};
【问题讨论】:
-
你得到什么错误?
标签: google-maps geocode