Last active
May 15, 2022 16:32
-
-
Save carmoreira/e4ddc52021eb130d4d486fccba0ecf0d to your computer and use it in GitHub Desktop.
Show all marker series in map, if drilldown is enabled - Interactive Geo Maps
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
// added this control check, in case code was added more than once | |
if (typeof mapCode === 'undefined') { | |
let mapID = 159; // CHANGE MAP ID HERE | |
let mapContainer = document.getElementById('map_' + mapID); | |
mapContainer.addEventListener('mapready', function(ev) { | |
iMaps.maps[mapID].series.forEach(function(serie) { | |
if (serie.className === 'MapImageSeries') { | |
serie.show(); | |
} | |
}); | |
iMaps.maps[mapID].map.zoomControl.children._values[0].events.on('hit', function() { | |
iMaps.maps[mapID].series.forEach(function(serie) { | |
if (serie.className === 'MapImageSeries') { | |
serie.show(); | |
} | |
}); | |
}); | |
}); | |
var mapCode = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment