Skip to content

Instantly share code, notes, and snippets.

@carmoreira
Created April 14, 2021 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carmoreira/84dc731bee908a7c988c39f4a87b01d2 to your computer and use it in GitHub Desktop.
Save carmoreira/84dc731bee908a7c988c39f4a87b01d2 to your computer and use it in GitHub Desktop.
Interactive Geo Maps - Intercept regions click to run custom code
let mapID = 2755;
iMaps.maps[mapID].series[0].mapPolygons.each(function(region){
region.events.on("hit", function(ev) {
let data = ev.target.dataItem.dataContext;
let region = data.id;
// do whatever you want here
}, this);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment