Skip to content

Instantly share code, notes, and snippets.

@carmoreira
Created February 3, 2022 09:35
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/d01741175db3ea677c1498509a79c83e to your computer and use it in GitHub Desktop.
Save carmoreira/d01741175db3ea677c1498509a79c83e to your computer and use it in GitHub Desktop.
Reset map on load to fix zoom/center issues
// replace with your map ID
let mapID = 237;
let mapContainer = document.getElementById('map_' + mapID);
mapContainer.addEventListener('mapready', function(ev) {
iMaps.maps[mapID].map.goHome();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment