如何使变量失效?

时间:2019-07-19 23:54:14

标签: javascript

请帮助! 它不能将变量“ 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);

0 个答案:

没有答案
相关问题