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);});  

small map of mapbox with cut popup

< / Div>

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});  


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -