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);
Params | Type | Details |
---|
-
Changes the backgroundColor
Params Type Details color string Html color string -
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 the htmlInfoWindow
Params Type Details marker Marker Marker instance -
Close the htmlInfoWindow