Skip to content

Conversation

adimitrov
Copy link
Contributor

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.

@@ -325,6 +326,19 @@ L.TileLayer = L.Class.extend({
}
}

if(this.options.tileBounds) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add space after each if
  2. I think it would make more sense to call it just bounds.

@adimitrov
Copy link
Contributor Author

Renamed the option and I ran jake this time to make sure there are no errors.

@adimitrov adimitrov closed this Oct 23, 2012
@adimitrov adimitrov reopened this Oct 25, 2012
@@ -42,6 +43,10 @@ L.TileLayer = L.Class.extend({
this.options.maxZoom--;
}

if (options.bounds) {
options.bounds = L.LatLngBounds(options.bounds);
Copy link
Member

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).

@alana314
Copy link

Thank you adimitrov, this works great for me, +1 for adding this to the master branch.

jfirebaugh added a commit to mapbox/mapbox.js that referenced this pull request Feb 22, 2013
@tmcw
Copy link
Contributor

tmcw commented Feb 23, 2013

👍 Only refinement I can see is indentation - var , chains should be 4-space indent in Leaflet's style afaik.

mourner added a commit that referenced this pull request Feb 25, 2013
Add tileBounds option to limit tile loading to a given region
@mourner mourner merged commit a169b6c into Leaflet:master Feb 25, 2013
@mourner
Copy link
Member

mourner commented Feb 25, 2013

Thanks everyone, merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants