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

Remember the chosen custom background when set by url #4165

Merged
merged 1 commit into from
Jul 20, 2017

Conversation

pgiraud
Copy link
Contributor

@pgiraud pgiraud commented Jul 20, 2017

Here's a quick workaround for #4162.
@bhousel I'm not sure if it's the best way to fix the issue but it seem to work.

@bhousel bhousel merged commit 5b89003 into openstreetmap:master Jul 20, 2017
@bhousel
Copy link
Member

bhousel commented Jul 20, 2017

Thanks so much @pgiraud - this is pretty good!

Your quick fix worked because it was creating a Custom imagery layer and setting the localStorage template - then the real Custom layer would get created later when the Background ui was added and that template would get picked.

I added a commit after to cleanup the ownership of these objects. Now all the layers, including Custom and None are 'owned' by rendererBackground(), and the uiBackground() does not create a Custom layer, it just finds the existing one by id. The new code is a little easier to reason about.

@pgiraud pgiraud deleted the background-custom-remember branch July 21, 2017 07:12
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.

2 participants