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

c++ - C/pp Sockets, recv()/send() works only under gdb -

GO: Serve static pages -

objective c - How to open front/back camera at the same time in iOS developing? -