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

Add Basemap Logic with Radio Buttons #7

Open
dnseminara opened this issue Feb 7, 2017 · 3 comments
Open

Add Basemap Logic with Radio Buttons #7

dnseminara opened this issue Feb 7, 2017 · 3 comments
Assignees

Comments

@dnseminara
Copy link
Contributor

map.setStyle()

@dnseminara dnseminara self-assigned this Feb 7, 2017
@dnseminara
Copy link
Contributor Author

dnseminara commented Feb 7, 2017

Blah. "basemaps" are treated like other styles. There's no routine way to toggle them. Using map.setStyle() blows the entire map away.

Snippet from mapbox/mapbox-gl-js#2267:

Unlike Leaftlet, mapbox-gl-js doesn't have a concept of "basemap" vs "other layers." All layers are part of the same entity, the style.

@reyemtm
Copy link

reyemtm commented Oct 31, 2018

If you really want a basemap control you would have to load the layers s in a function, then call that function when the style is loaded - see mapbox/mapbox-gl-js#2268. You would also have to keep track of what layers were visible, all the data that was drawn on the map, etc. for when the basemap changes.

@dnseminara
Copy link
Contributor Author

@reyemtm - thanks for the link and refresher - I forgot all about this issue. I've implemented this elsewhere since creating this ticket. Ideally - one of these days I'll incorporate that into the Layer Tree's functionality...

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

2 participants