Skip to content

Map overlays missing when viewing raster layer #915

Closed
OpenHistoricalMap/ohm-website
#278

Description

@1ec5

Any map overlay, such as a highlighted feature or changeset bounding box, fails to appear when viewing a raster layer and only appears upon switching to a vector layer.

Problem

Steps to reproduce:

  1. On openhistoricalmap.org, open the Layers sidebar and switch to an OpenStreetMap-based raster layer (Standard, CyclOSM, or Humanitarian).
  2. View an element, such as the Bullfrog County relation.

Expected results: The map immediately highlights Bullfrog County and zooms it to fit the viewport.

Actual results: No highlight. However, switching to an OpenHistoricalMap-based vector layer (Historical, Railway, Woodblock, Japanese Scroll) causes the map to highlight Bullfrog County and zoom it to fit the viewport – even if you’ve intentionally panned somewhere else by then.

The Standard layer without any overlays.

The Historical layer with a time slider and the county overlaid.

Diagnosis

As far as I can tell, the code to add the overlay to the map is blocked on first loading the time slider. However, in an OSM-based layer, there’s no time slider, so the overlay code never runs:

https://github.com/OpenHistoricalMap/ohm-website/blob/43b6c1bf455a92eb1b4969c18ffd83c2d63f95ba/app/assets/javascripts/index.js#L352-L369
https://github.com/OpenHistoricalMap/ohm-website/blob/43b6c1bf455a92eb1b4969c18ffd83c2d63f95ba/app/assets/javascripts/index/timeslider.js#L34-L38
https://github.com/OpenHistoricalMap/ohm-website/blob/43b6c1bf455a92eb1b4969c18ffd83c2d63f95ba/app/assets/javascripts/index/timeslider.js#L64-L70

Activity

  1. added
    website
    on Nov 23, 2024
  2. 1ec5 commented on Nov 23, 2024

    @1ec5
    MemberAuthor

    I suppose the missing overlays aren’t so surprising against an OSM basemap, but belatedly zooming to the overlay after switching layers does feel a bit jarring. It would probably be better to consistently show the overlays regardless of the basemap data source, since the overlays aren’t filtered by time anyways.

  3. 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

    Labels

    website

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions