javascript - mapbox Pan a Map to Marker and Popup -
Is it possible to pan the map on marker onClick in relation to the popup height? ? Currently, the popup disappears behind the map mask, I'm looking for a solution to fit the map, marker and popup (like adding some top padding). featureLayer.on ('click', function (e) {var latLng = e.layer.getLatLng (); map.panTo (latLng);}); I have found a basic solution. You need to add the parameter keepInView BindPop () command. layer.bindPopup ('& lt; p & gt; Hello & lt; / p & gt;', {keepInView: true});