Using JavaScript Maps with Fancybox

Martynas Majeris -

If you would prefer a Fancybox popup to built-in JavaScript Maps' description box, you're in luck.

You can trap the "clickMapObject" event to handle clicks on the map and use the handler code to open a Fancybox popup.

It's very simple:

map.addListener("clickMapObject", function (event) {
            'type': 'iframe',
            'href': ''+event.mapObject.title,
            'width': '80%',
            'height': '80%'

Here's the demo in action:

Have more questions? Submit a request


Powered by Zendesk