`;
this.getPanes().overlayMouseTarget.appendChild(this.div);
this.tooltip = this.div.querySelector(".tooltip");
// Show title on click
this.div.addEventListener("click", (event) => {
event.stopPropagation();
this.tooltip.style.display = this.tooltip.style.display === "block" ? "none" : "block";
});
// Hide title when clicking outside
google.maps.event.addListener(this.map, "click", () => {
this.tooltip.style.display = "none";
});
}
draw() {
const overlayProjection = this.getProjection();
const position = overlayProjection.fromLatLngToDivPixel(this.position);
if (position && this.div) {
this.div.style.left = `${position.x}px`;
this.div.style.top = `${position.y}px`;
}
}
onRemove() {
if (this.div) {
this.div.parentNode.removeChild(this.div);
this.div = null;
}
}
}
// Add a custom marker at a specific location
new CustomMarker(new google.maps.LatLng(51.444943, 35.651193), cz8850);}}, 250 );}
