Hi Daniel,
unfortunately that didn’t work for me.
I have added a script to a page below the map, the map is added via WordPress, the script in the template file.
document.querySelectorAll('.btn_swiper').forEach(link=> {
link.addEventListener('click', function() {
const lng = document.querySelector('.swiper-slide-active').getAttribute('data-longitude');
const lat = document.querySelector('.swiper-slide-active').getAttribute('data-latitude');
console.log(lng, lat);
oumMap.flyTo([lat,lng], 18);
})
})
And I get the following error: oumMap.flyTo([lat,lng], 18);
When I add the script in the file: frontend-block-map.js with map.flyto… it works fine.
But I need it in combination with the swiper.js
Thanks,
Sven