javascript - how to disable click event on marker after single click -


after single click on marker, i'd to:

  1. disable click event on map
  2. wait 5 seconds
  3. 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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -