htmlInfoWindow.open()

April 20, 2019 ยท View on GitHub

:green_heart: This is the latest document.

htmlInfoWindow.open()

Open the htmlInfoWIndow.

htmlInfoWindow.open(marker);

Parameters

nametypedescription
markerMarkerMarker instance

Demo code

<div id="map_canvas"></div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);

var htmlInfoWindow = new plugin.google.maps.HtmlInfoWindow();

var html = "<img src='./House-icon.png' width='64' height='64' >" +
           "<br>" +
           "This is an example";
htmlInfoWindow.setContent(html);

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

marker.on(plugin.google.maps.event.MARKER_CLICK, function() {
  htmlInfoWindow.open(marker);
});
marker.trigger(plugin.google.maps.event.MARKER_CLICK);