Skip to content

Instantly share code, notes, and snippets.

@carmoreira
Created May 20, 2022 11:23
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/3482968239db91a9b9ba6263ac5b5cd0 to your computer and use it in GitHub Desktop.
Save carmoreira/3482968239db91a9b9ba6263ac5b5cd0 to your computer and use it in GitHub Desktop.
Interactive Geo Maps - reset to base series when marker is hovered out
// set map ID
let mapID = 22020;
let mapContainer = document.getElementById('map_' + mapID);
mapContainer.addEventListener('mapready', function(ev) {
let allMarkers = iMapsManager.getMarkersByValue(mapID, '*', 'id');
allMarkers.forEach(function(marker) {
marker.events.on("out", function(ev) {
iMaps.maps[mapID].series.forEach(function(serie){serie.hide();});
iMaps.maps[mapID].allBaseSeries.forEach(function(serie){serie.show();});
}, this);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment