Leaflet-active-area

An active area ?

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

A typical use case is to set a map as background (like that example) and center it on the top of the screen for example.

Try to center the map to London, Paris, zoom in, out, fitbounds or flyto. As you see, the center of the map is within the div with a green border and not the center of the screen.

Zone active ?

Ce plugin vous permet d’utiliser une petite portion de votre carte comme zone active. Les méthodes de positionnement (setView, fitBounds, setZoom) s’appliqueront à cette porition au lieu de toute la carte.

Un exemple typique est d’afficher une carte sur la totalité de l’écran (comme sur cet exemple) mais de la centrer en haut de l’écran par exemple.

Essayer de centrer la carte sur Londres, Paris, zoomer, dézoomer, fitbounds ou flyto.. Comme vous pouvez le voir, la carte se centre à l’intérieur du div avec une bordure verte et non depuis le centre de l’écran.

https://github.com/Mappy/Leaflet-active-area