OpenHistoricalMap / issues

File your issues here, regardless of repo until we get all our repos squared away; we don't want to miss anything.
Creative Commons Zero v1.0 Universal
19 stars 1 forks source link

Error loading Historic style: duplicate layer id “roads_pedestrian_street” #594

Closed 1ec5 closed 1 year ago

1ec5 commented 1 year ago

OpenHistoricalMap/map-styles@2a079676cfe9b578cb17ac88c24c616990fafd0e added a redundant roads_pedestrian_street line layer to the Historic style that triggers the following error on any MapLibre GL map:

Error: layers[128]: duplicate layer id "roads_pedestrian_street", previously used at line undefined
    kn https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:31
    Yt https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:35
    _load https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:35
    _request https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:35
    N https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:31
    promise callback*N/</< https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:31
    N https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:31
    promise callback*N/< https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:31
    N https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:31
    Z https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:31
    getJSON https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:31
    loadURL https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:35
    _updateStyle https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:35
    setStyle https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:35
    Map https://unpkg.com/maplibre-gl@^2.4/dist/maplibre-gl.js:35
    <anonymous> https://openhistoricalmap.github.io/ohm-embed-1yr/embed-map-single-year.js:17
    EventListener.handleEvent* https://openhistoricalmap.github.io/ohm-embed-1yr/embed-map-single-year.js:11
maplibre-gl.js:31:12106

It looks like the intention was to move the layer rather than duplicating it, so the old layer needs to be removed to avoid this conflict. As it is, the stylesheet is invalid.

This regression currently affects Overpass turbo, the OHM embed, and the OSM Wiki. It does not affect the main openhistoricalmap.org slippy map for some reason, maybe because the leaflet-mapbox-gl plugin is more lenient.

Overpass turbo

/cc @vknoppkewetzel

danrademacher commented 1 year ago

This doesn't affect the main website because there's an air gap to that site where we copy the style into to main repo and make some changes to it to allow for dynamic swapping between staging and prod endpoints.

For these other services, we should change them all to load from https://github.com/OpenHistoricalMap/map-styles/blob/staging/ohm_timeslider_tegola/tegola-ohm-production.json

This is the file where we do full testing before we deploy to the website

danrademacher commented 1 year ago

Actually, I'm wrong about this solution. Back in this ticket, https://github.com/OpenHistoricalMap/issues/issues/341#issuecomment-1059645119, we had to move away from using the production version, which is specifically optimized for inclusion in the website, where the complete style is built via Javascript, meaning the production version is not a full and valid style file.

I know Vanessa was testing changes in Maputnik to even make style updates, so it seems like this could be an issue where Maputnik doesn't care about duplicates but other renderers fail

danrademacher commented 1 year ago

Fixed in https://github.com/OpenHistoricalMap/map-styles/commit/57443530452c8fb0253b5031560bb73b8410da2f

vknoppkewetzel commented 1 year ago

Hello thank you! Yes my intention was to delete the "old" pedestrian road layer and I missed it. Still getting used to making adjustments in Maputnik. thanks for flagging and fixing here

1ec5 commented 1 year ago

Thanks, this is working again.

the complete style is built via Javascript, meaning the production version is not a full and valid style file.

Interesting, I didn’t realize that. I was quite puzzled that a stylesheet request never showed up in the Network tab of the browser’s console.