Skip to content

Conversation

urbaniak
Copy link
Contributor

you can use {r} in tileLayer url, to serve different tiles (2x ones) for retina screens, cause the current detectRetina implementation makes the labels in tiles too small

@mourner
Copy link
Member

mourner commented Dec 15, 2013

Thanks! @tmcw what do you think? Is "@2x" a common convention for tiles?

@tmcw
Copy link
Contributor

tmcw commented Dec 16, 2013

I'm not sure - it's Apple's recommendation of a prefix/postfix, but there are providers like CloudMade that do something entirely different, and it's not always upscaled 256 tiles but sometimes 512 tiles. Seems a bit tricky / potentially not ready for a future standard.

@mourner
Copy link
Member

mourner commented Dec 16, 2013

@tmcw CloudMade also uses @2x postfix, although not at the end but after style id: http://cloudmade.com/documentation/map-tiles

It doesn't take too much code so we could include it just for convenience, even if it's not a standard.

@mourner
Copy link
Member

mourner commented Dec 17, 2013

@jieter @calvinmetcalf what are your thoughts on this guys?

@calvinmetcalf
Copy link
Contributor

add options for retinaFlag defaulting to '@2xandnonRetinaFlag` defaulting to an empty string ?

@mourner
Copy link
Member

mourner commented Dec 17, 2013

@calvinmetcalf looks a bit verbose, do you know any tile provider that utilizes non-@2x convention for retina?

@calvinmetcalf
Copy link
Contributor

I should have more clearly pointed out that those were top of my head names I thought were terrible, as far as I know nobody does use anything else or sets a flag for non retina etc, but hard coding it without adding an option to change it from the default seems like the kind of thing which we might regret latter

@mourner
Copy link
Member

mourner commented Dec 17, 2013

Well, I think it's better to add it later than prematurely solve non-existing problems with more code. So good to merge then?

@calvinmetcalf
Copy link
Contributor

my bad I didn't notice it was a pull request and not an issue so thought we were brainstorming, yeah that's fine

@mourner
Copy link
Member

mourner commented Dec 17, 2013

@calvinmetcalf that kind of input is always good in any case, be it pull or issue.

mourner added a commit that referenced this pull request Dec 17, 2013
add {r} format to url, which returns @2x when retina detected and enabled
@mourner mourner merged commit 3469eb9 into Leaflet:master Dec 17, 2013
@patrickarlt patrickarlt mentioned this pull request Dec 21, 2014
60 tasks
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