Content-Length: 268385 | pFad | http://github.com/asleepwalker/leaflet.hardbounds

7C GitHub - asleepwalker/leaflet.hardbounds: Leaflet plugin to prevent panning outside of map bounds
Skip to content

asleepwalker/leaflet.hardbounds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Leaflet.HardBounds Dependency Status

Leaflet plugin to prevent panning outside of map bounds.

Requires: Leaflet v0.6.3 or higher.

Usage

Setup hard bounds:

map.addHardBounds();

Then you can set maxBounds as usual:

var bounds = L.latLngBounds([[51.55, -0.2], [51.45, 0]]);
map.setMaxBounds(bounds);

Or even unset them:

map.setMaxBounds(null);

However, it's better to remove listener if you need hard bounds no more:

map.removeHardBounds();

License

The MIT License.









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/asleepwalker/leaflet.hardbounds

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy