Skip to content

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

Closed

Description

@1ec5

OpenHistoricalMap/map-styles@2a07967 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

Activity

  1. danrademacher commented on Sep 4, 2023

    @danrademacher

    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

  2. danrademacher commented on Sep 4, 2023

    @danrademacher

    Actually, I'm wrong about this solution. Back in this ticket, #341 (comment), 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

  3. danrademacher commented on Sep 4, 2023

    @danrademacher
  4. vknoppkewetzel commented on Sep 5, 2023

    @vknoppkewetzel

    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

  5. 1ec5 commented on Sep 5, 2023

    @1ec5
    MemberAuthor

    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.

  6. added theissue type on Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions