Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 948 Bytes

File metadata and controls

42 lines (32 loc) · 948 Bytes

⚠️ This document is aim for older versions (from 2.3.0 to 2.5.3). Document for new version is https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.6.0/README.md

marker.isVisible()

Return true if the marker is visible.


Demo code

<div id="map_canvas">
  <span class="smallPanel"><button>marker.isVisible() = true</button></span>
</div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);

// Add a marker
var marker = map.addMarker({
  'position': {
    lat: 0,
    lng: 0
  }
});

var button = div.getElementsByTagName('button')[0];
button.addEventListener("click", function() {
  if (marker.isVisible()) {
    marker.setVisible(false);
  } else{
    marker.setVisible(true);
  }
  button.innerHTML = "marker.isVisible() = " + marker.isVisible();
});