Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 746 Bytes

File metadata and controls

31 lines (24 loc) · 746 Bytes

map.setClickable()

Set false to ignore all clicks on the map (default: true).

<div class="map" id="map_canvas">
    <span class="smallPanel"><button>current: map.clickable = true</button></span>
</div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);
map.one(plugin.google.maps.event.MAP_READY, function() {

  var clickable = true;
  var button = div.getElementsByTagName('button')[0];
  button.addEventListener('click', function() {
    clickable = !clickable;
    map.setClickable(clickable);
    button.innerHTML = "current: map.clickable = " + clickable;
  });

  map.on(plugin.google.maps.event.MAP_CLICK, function() {
    alert("Click!");
  });

});