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) {
        $.fancybox({
            'type': 'iframe',
            'href': 'http://en.wikipedia.org/wiki/'+event.mapObject.title,
            'width': '80%',
            'height': '80%'
        });
});

Here's the demo in action: http://jsfiddle.net/amcharts/J4nAj/

Have more questions? Submit a request

Comments

Powered by Zendesk