1

By default zoom to, setview functions show the center point of the map in the center point of div measured by pixel of browser. I want to show the center at slightly right when left panel is visible. In http://2gis.ru/ site, they used the similar function. How can I do this?

1 Answer 1

2

You will probably be interested in one of those plugins:

  • Leaflet-active-area

    This plugin allows you to use a smaller portion of the map as an active area. All positioning methods (setView, fitBounds, setZoom) will be applied on this portion instead of the all map.

  • Leaflet.ControlledBounds

    Inspired by Leaflet-active-area, automatically detects the largest area of the map not covered by any map controls and applies setView, fitBounds, setZoom, getBounds to that area.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.