Created
November 19, 2021 14:16
-
-
Save carmoreira/88987b90b9cf4630f96addb717011444 to your computer and use it in GitHub Desktop.
Interactive Geo Maps - Set default tooltip for inactive regions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// replace with your map ID and region code. | |
let mapID = 3491443; | |
let mapContainer = document.getElementById('map_' + mapID); | |
mapContainer.addEventListener('mapready', function(ev) { | |
iMaps.maps[mapID].series[0].mapPolygons.each(function(region) { | |
let inactive = region.dataItem.dataContext.madeFromGeoData; | |
if (inactive) { | |
region.dataItem.dataContext.tooltipContent = 'Empty Country'; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment