Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 663 Bytes

File metadata and controls

38 lines (29 loc) · 663 Bytes

marker.remove()

Remove the marker.

<div id="map_canvas"></div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);
map.one(plugin.google.maps.event.MAP_READY, function() {

  // Add a marker
  map.addMarker({
    'position': {
      lat: 0,
      lng: 0
    },
    'title': "Click me!",
    'snippet': 'Remove this marker.'
  }, function(marker) {

    // Open the infoWindow
    marker.showInfoWindow();

    // Catch the MARKER_CLICK event
    marker.on(plugin.google.maps.event.INFO_CLICK, function() {

      // Remove the marker.
      marker.remove();

    });
  });
});