HtmlInfoWindow class
July 15, 2019 ยท View on GitHub
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