I'm currently working on implementing a fly function to a marker when a button is clicked. I've already created buttons on the right side of the map and now I want to add this feature to one of them.
var latlng = map.getCenter(); // or [47.478058, 9.720154]
var marker = L.marker(latlng).addTo(map);
L.DomEvent.on(button,'click',function(){
var zoomlvl = 16;
map.flyTo(marker.getLatLng(),zoomlvl)
});
All I need is to integrate this code into my project --> https://jsfiddle.net/paulito92/p92sfz7o/1/ Specifically, I want this functionality for the Availability Zones button. When that button is clicked, I want the map to navigate to the location [48.6333, 2.2333]. I've been encountering issues while trying to implement this function, so any help would be greatly appreciated!
If anyone has insights on how to achieve this, I'd be very grateful.
Thank you all and have a wonderful day :)