Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.2 KB

File metadata and controls

49 lines (35 loc) · 1.2 KB

💚 This is the latest document.

tileOverlay.setVisible()

Change visibility of the tileoverlay.

tileoverlay.setVisible(flag);

Parameters

name type description
flag boolean true: visible, false: invisible

Demo code

<div id="map_canvas">
  <span class="smallPanel"><input type="checkbox" id="toggleCheckbox" checked="checked">tileoverlay.setVisible(true)</span>
</div>
var mapDiv = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(mapDiv);

// Add a tile overlay
var tileOverlay = map.addTileOverlay({
  // &lt;x&gt;,&lt;y&gt; and &lt;zoom&gt; are replaced with values
  // (i.e. http://tile.stamen.com/toner/2/1/2.png)
  getTile: function(x, y, zoom) {
    return "http://tile.stamen.com/toner/" + zoom + "/" + x + "/" + y + ".png";
  }
});

var checkbox = document.getElementById("toggleCheckbox");
checkbox.addEventListener("change", function() {

  // Change the visible property
  tileOverlay.setVisible(checkbox.checked);

});