gpt4 book ai didi

javascript - 谷歌地图 API : Cannot read property '__e3_' of undefined

转载 作者:IT王子 更新时间:2023-10-29 03:21:28 27 4
gpt4 key购买 nike

这是我要添加的监听器 -

var map;
var geocoder;
function initialize() {
var myOptions = {
zoom: 8,
center: new google.maps.LatLng(22, 88),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
}
//google.maps.event.addDomListener(window, 'load', initialize);
google.maps.event.addListener(map, 'click', function(event) {
geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'latLng': event.latLng}, function(results, status) {

if (status == google.maps.GeocoderStatus.OK) {
alert(results);
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
});

但它在控制台中生成此错误 -

Uncaught TypeError: Cannot read property '__e3_' of undefined
Ke
Ie
R.addListener
(anonymous function)

尝试搜索。但是没有解决。

最佳答案

将您的监听器移至初始化函数。

关于javascript - 谷歌地图 API : Cannot read property '__e3_' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7058094/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com