请帮助! 它不能将变量“ wer”的值更改为“ latidude”。 console.log(wer);打印0,同时console.log(纬度,经度,wer);将“ wer”打印为“纬度”。我没有我做错的事。
wer = 0;
geocoder.geocode({
'placeId': addressAlgus
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latitude = results[0].geometry.location.lat();
var longitude = results[0].geometry.location.lng();
wer = latitude;
window.wer = wer;
// console.log(latitude, longitude, wer);
}
});
console.log(wer);