Skip to content

Latest commit

 

History

History
101 lines (79 loc) · 1.85 KB

File metadata and controls

101 lines (79 loc) · 1.85 KB

HtmlInfoWindow class

let htmlInfoWindow = new HtmlInfoWindow();

let frame: HTMLElement = document.createElement('div');
frame.innerHTML = [
  '<h3>Hearst Castle</h3>',
  '<img src="assets/imgs/hearst_castle.jpg">'
].join("");
frame.getElementsByTagName("img")[0].addEventListener("click", () => {
  htmlInfoWindow.setBackgroundColor('red');
});
htmlInfoWindow.setContent(frame, {
  width: "280px",
  height: "330px"
});

htmlInfoWindow.open(marker);

API Reference


new HtmlInfoWindow()

Params Type Details

Instance method

  • setBackgroundColor(color)

    Changes the backgroundColor

    Params Type Details
    color string Html color string
  • setContent(string | HTMLElement, cssOptions?)

    Set your HTML contents.

    Params Type Details
    content string | HTMLElement String containing text or HTML element
    cssOptions any (optional)CSS styles for the container element of HTMLInfoWindow
  • open(marker)

    Open the htmlInfoWindow

    Params Type Details
    marker Marker Marker instance
  • close()

    Close the htmlInfoWindow