Interact with the maps objects script not working
-
Hello,
I’ve had Traveler’s map for over a year now with no issues. On one of my website’s pages (https://globetrotterkyle.com/korea-adventures/), I have the shortcode [travlers-map] added and the following script added so that the map only shows South Korea.
<script>
// Listen for the event.
document.addEventListener(‘cttm_map_loaded’, function (e) {
// cttm_map is an array of all the maps included in the page, so we loop through each.
for (let i = 0; i < cttm_map.length; i++) {
//You can now interact with the map object.
cttm_map[i].setView([45.30824,5.85554], 10);
}
}, false);
</script>The map loads perfectly and it looks exactly the way I want it to.
Now I am trying to add a separate, new page to my website where I only want to show Europe. However, I’m using the same shortcode and script and I’m getting an error. When I remove the script, I’m only able to show a map of the entire world.
What am I doing wrong? I want to have the traveler’s map show only europe but, it’s showing the entire world. Please help!
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.