Skip to content

Instantly share code, notes, and snippets.

@carmoreira
Last active May 15, 2022
Embed
What would you like to do?
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