Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Switching to OpenLayers and back to MapLibre hides all styles #874

Closed
nyurik opened this issue Feb 4, 2024 · 12 comments · Fixed by #1021
Closed

Switching to OpenLayers and back to MapLibre hides all styles #874

nyurik opened this issue Feb 4, 2024 · 12 comments · Fixed by #1021

Comments

@nyurik
Copy link
Member

nyurik commented Feb 4, 2024

Maputnik version: v2.0 as published on maplibre.org/maputnik
Browser: Chrome
OS: Linux

Description of the bug:
All styles stop working after switching to OpenLayers (experimental) and back

Steps to reproduce the behavior:

  1. Open https://maplibre.org/maputnik/
  2. In Style Settings change last setting - style renderer to Open Layers
  3. Observe styling is nearly the same (not certain if openlayers is actually used)
  4. Change it back to MapLibre GL
  5. Observe that styling is good, but some background images may still show on low zooms
@HarelM
Copy link
Collaborator

HarelM commented Mar 9, 2024

I think the support for openlayers is broken so badly we should simply remove the open layers rendering option and reduce the maintenance work.

Checkout the openlayers label for other issues.

@birkskyum
Copy link
Member

@nyurik , maputnik has had a lot of things updated - do you still see this?

@nyurik
Copy link
Member Author

nyurik commented Jan 21, 2025

I just checked - openlayers does not show anything at all anymore

@birkskyum
Copy link
Member

birkskyum commented Jan 21, 2025

This is what I see following your instructions with the demotiles:

https://demotiles.maplibre.org/globe.json

Screen.Recording.2025-01-21.at.22.12.20.mov

@birkskyum
Copy link
Member

birkskyum commented Jan 21, 2025

Is it a certain specific style that's not working?

@nyurik
Copy link
Member Author

nyurik commented Jan 21, 2025

I am getting a blank (off-white) screen when I open the Americana style. The MapTiler basic does work ok.

@nyurik
Copy link
Member Author

nyurik commented Jan 21, 2025

P.S. Also, with MapTiler basic , switching to open layers works ok, but switching back to maplibre goes boom (off white background)

@birkskyum
Copy link
Member

The maptiler is because it looses the api key

@birkskyum
Copy link
Member

birkskyum commented Jan 21, 2025

The americana is because ol-mapbox-style is incompatible with the Americana, and Maputnik is running the latest version on the ol-mapbox-style. The ol-mapbox-style doesn't care about the maplibre-style-spec at all, so it's questionable how useful it is.

@prusswan
Copy link

prusswan commented Jan 24, 2025

The ol-mapbox-style doesn't care about the maplibre-style-spec at all, so it's questionable how useful it is.

Perhaps an issue can be raised with them? ol-mapbox-style does mention MapLibre Style

@birkskyum
Copy link
Member

birkskyum commented Jan 28, 2025

UPDATE:

ol-mapbox-style have just now switched from mapbox style spec to maplibre style spec

cc @HarelM , @nyurik

@HarelM
Copy link
Collaborator

HarelM commented Jan 28, 2025

Thanks for the link!

birkskyum added a commit that referenced this issue Jan 28, 2025
Going from e.g. MapTiler to OpenLayers and back will lose the maptlier
key.

This code finds the urls in the style that has "{key}" and insert the
correct API keys

Fixes the error reported here, cc @nyurik 
- Fixes
#874 (comment)

Related to:
- #869

## Launch Checklist

<!-- Thanks for the PR! Feel free to add or remove items from the
checklist. -->


 - [ ] Briefly describe the changes in this PR.
 - [ ] Link to related issues.
- [ ] Include before/after visuals or gifs if this PR includes visual
changes.
 - [ ] Write tests for all new functionality.
 - [ ] Add an entry to `CHANGELOG.md` under the `## main` section.
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants