Skip to content
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

Allow a custom method as tile getter in L.TileLayer #2828

Closed
codemasher opened this issue Jul 31, 2014 · 6 comments
Closed

Allow a custom method as tile getter in L.TileLayer #2828

codemasher opened this issue Jul 31, 2014 · 6 comments

Comments

@codemasher
Copy link

I work with custom map tiles for game maps like the Guild Wars 2 Maps API which have a limited tile coverage and i was looking for a way to prevent 404 spam and speed up the display of the blank error tiles.
Google Maps allows this in it's ImageMapTypeOptions object, so i made a silly little edit to mime this behaviour: https://github.com/codemasher/Leaflet/commit/b2577e5a05b45f3f83f0bf8bdbe36389bff61628 - demo over here
However, i don't have that much insight in Leaflet to know if this would break something and how to implement it the best way, so i have to leave it up to you guys.

@bennlich
Copy link
Contributor

Hmm. Have you looked at the bounds option?

@codemasher
Copy link
Author

Thanks for that hint, i've overlooked this option. However, when bounds is set, Leaflet won't even attempt to load the error/blank tile (obviously). I could live with it for now but i'd still prefer a custom method to have more control about the tiles to load.

@bennlich
Copy link
Contributor

However, when bounds is set, Leaflet won't even attempt to load the error/blank tile (obviously).

Oh, I thought this was what you wanted? To speed up the display of blank error tiles?

Have you also looked at the errorTileUrl option?

@codemasher
Copy link
Author

Yes, the errorTileURL is set, thats why i pointed it out in my previous comment. My main point was to prevent the 404 spam, which the bounds option does, but since there are no tile errors, it won't load the blank tile, therefore the "obviously".

@bennlich
Copy link
Contributor

bennlich commented Oct 1, 2014

Ahh, I see. That makes sense.
On Sep 30, 2014 2:04 PM, "smiley" notifications@github.com wrote:

Yes, the errorTileURL is set, thats why i pointed it out in my previous
comment. My main point was to prevent the 404 spam, which the bounds
option does, but since there are no tile errors, it won't load the blank
tile, therefore the "obviously".


Reply to this email directly or view it on GitHub
#2828 (comment).

@danzel
Copy link
Member

danzel commented Oct 1, 2014

You can inherit from TileLayer and do your custom override there.
I don't think we need an option for this.

@danzel danzel closed this as completed Oct 1, 2014
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

No branches or pull requests

3 participants