javascript - how to disable click event on marker after single click -
after single click on marker, i'd to:
- disable click event on map
- wait 5 seconds
re-enable click event on map m using ajax setinterval 3 seconds code:
details = new google.maps.latlng(18.60301515,73.79623622); bindinfowindow(marker, map, infowindow , details);
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 marker @ click event infowindow.setcontent('location:'+location1+'<br>'); } } }); infowindow.open(map, marker); });
}
thanks
i this:
javascript
details = new google.maps.latlng(18.60301515,73.79623622); bindinfowindow(marker, map, infowindow , details); var allowclick = true; function bindinfowindow(marker, map, infowindow, description) { google.maps.event.addlistener(marker,'click', function() { if(allowclick) { allowclick = false; 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; infowindow.setcontent('location:'+location1+'<br>'); } } }); infowindow.open(map, marker); settimeout(function() { allowclick = true; }, 5000); } }); }
Comments
Post a Comment