I have a map that covers the entire screen and I have a layer that overlays the map. That layer goes from bottom to top. the user interacts with this layer by clicking on different options and these options draw markers on the map.
When I centralize the map, the markers are hidden behind the layer that superimposes the map, thus eliminating the visibility of the marker.
How could I centralize the map and then move it one third above the layer? This question is a remake of How can I change the location center of a map using Leaflet API?
Try doing it this way
var offset = map.getSize().y * 0.15; map.panBy(new L.Point(0, -offset), {animate: false}); But every time I click on an option in the layer to create a marker, the map moves and I lose the center.
Excuse the example image
The idea is that after the map makes the setView place its center above the blue layer that superimposes the map so as not to hide the markers.
