【发布时间】:2016-11-01 00:05:00
【问题描述】:
单击标记后,我想:
- 禁用地图上的点击事件
- 等待 5 秒
-
在地图上重新启用点击事件 我使用 ajax 和 setInterval 3 秒 这是我的代码:
详细信息 = 新 google.maps.LatLng(18.60301515,73.79623622); bindInfoWindow(标记,地图,信息窗口,详细信息);
function bindInfoWindow(marker, map, infoWindow, description) {
google.maps.event.addListener(marker,'click', function() { var geocoder = new google.maps.Geocoder(); geocoder.geocode({ 'latLng': description }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { var location1=results[1].formatted_address; // set content to marker at click event infoWindow.setContent('Location:'+location1+'<br>'); } } }); infoWindow.open(map, marker); });}
谢谢
【问题讨论】:
-
投反对票。与同一用户的其他答案重复
标签: javascript php ajax