-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Add tileBounds option to limit tile loading to a given region #991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -325,6 +326,19 @@ L.TileLayer = L.Class.extend({ | |||
| } | |||
| } | |||
|
|
|||
| if(this.options.tileBounds) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add space after each
if - I think it would make more sense to call it just
bounds.
|
Renamed the option and I ran jake this time to make sure there are no errors. |
| @@ -42,6 +43,10 @@ L.TileLayer = L.Class.extend({ | |||
| this.options.maxZoom--; | |||
| } | |||
|
|
|||
| if (options.bounds) { | |||
| options.bounds = L.LatLngBounds(options.bounds); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should change this to L.latLngBounds (the one you used is a constructor, not a factory method).
|
Thank you adimitrov, this works great for me, +1 for adding this to the master branch. |
Depends on Leaflet/Leaflet#991.
|
👍 Only refinement I can see is indentation - |
Add tileBounds option to limit tile loading to a given region
|
Thanks everyone, merged! |
If someone needs to add a tile overlay that is limited to a given region (ex. city) we need a way to limit the tile requests to this region.