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

Retina support #278

Merged
merged 2 commits into from
Aug 15, 2018
Merged

Retina support #278

merged 2 commits into from
Aug 15, 2018

Conversation

yohanboniface
Copy link
Member

Anyone for a review / test? :)

cc @nebulon42 @kent1D

@kent1D
Copy link
Contributor

kent1D commented Mar 6, 2018

For the review, I don't think I can do something ;)

But I just tested

Here is a test non retina vs retina :
kosmtik_non_retina_vs_retina

And here the retina vs retina :

kosmtik_retina_vs_retina

On my retina screen, it loads directly @2x, on my non retina screen the normal scale.

I had nothing to do, is it right?

@kent1D
Copy link
Contributor

kent1D commented Mar 6, 2018

Mmmh I has a bug maybe zooming too quickly

kosmtik_retina_bug_zoom6

I had to close kosmtik and relaunch it to solve the problem

@kent1D
Copy link
Contributor

kent1D commented Mar 6, 2018

Ok the bug appears in this use case.

2 screens for my computer, one in retina, the other not.

Charging the map on one of them.

Charging the map on the other.

The second one freeze.

Need to click on reload to reload the tiles

@nebulon42
Copy link
Contributor

ATM I don't have a retina display available. How does it detect if it needs retina or not?
Is there the need for a separate map pool?

@yohanboniface
Copy link
Member Author

How does it detect if it needs retina or not?

This is the browser that actually decides to ask for retina tiles (handled by Leaflet directly, see {r} parameter).

Is there the need for a separate map pool?

Yes, because the map itself needs a scale x2

@MattBlissett
Copy link

I'm only running this using the Docker setup in https://github.com/gravitystorm/openstreetmap-carto/, which I've changed:

-RUN npm install -g kosmtik
+RUN npm install -g git://github.com/kosmtik/kosmtik.git#retina

Switching between map pools, in my case by using "Responsive Design Mode" on Firefox developer tools and refreshing the page, causes kent1D's problem when going from 1→2, and when going from 2→1 a similar problem with tiles showing the wrong data:

screenshot_20180515_231343

I'd guess some variables are shared between the two pools, but shouldn't be.

So we don't use the same for retina and normal tiles
@yohanboniface
Copy link
Member Author

Thanks @MattBlissett for pointing me to a way to reproduce!

(Yeah, two months later, I know… ;) )

@jeisenbe jeisenbe mentioned this pull request Feb 29, 2020
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.

None yet

4 participants