Skip to content

Instantly share code, notes, and snippets.

@carmoreira
Last active May 15, 2022 16:32
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/e4ddc52021eb130d4d486fccba0ecf0d to your computer and use it in GitHub Desktop.
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
// 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