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

Awkward animation of dashes at certain zoom levels #2433

Open
Helium314 opened this issue May 26, 2024 · 4 comments
Open

Awkward animation of dashes at certain zoom levels #2433

Helium314 opened this issue May 26, 2024 · 4 comments

Comments

@Helium314
Copy link
Contributor

Describe the bug
When crossing certains zoom levels (possibly near whole numbers, but I did not check), dashed lines have some sort of animation, which look out of place.

dashes.mp4

To Reproduce
Steps to reproduce the behavior:

  1. Have a line layer with dashes, in this case { "id": "steps", "source": "jawg-streets", "source-layer": "road", "filter": ["all", ["in", ["get", "class"], ["literal", ["path"]]], ["in", ["get", "type"], ["literal", ["steps"]]], ["==", ["geometry-type"], "LineString"], ["!", ["in", ["get", "structure"], ["literal", ["bridge", "tunnel"]]]]], "type": "line","paint": {"line-color": "#f6eee6", "line-width": ["interpolate", ["exponential", 2], ["zoom"], 14.0, 0.35, 16.0, 0.7, 24.0, 179.2], "line-dasharray": [0.6, 0.4]} },
  2. Scroll map to have some dashes in view
  3. Zoom

Expected behavior
Dashes should appear stable, i.e. without anything moving.

Platform information:

  • OS: Android 10 / LineageOS 17.1
  • Platform Android
  • Version 11.0.0
@Helium314 Helium314 added the bug Something isn't working label May 26, 2024
@westnordost
Copy link
Collaborator

The same issue exists for maplibre-gl-js. (Test by zooming in on some steps here https://streetcomplete.app/map-jawg/)

@1ec5
Copy link
Contributor

1ec5 commented Aug 14, 2024

Mapbox removed the dash transition in mapbox/mapbox-gl-js#12326 (after the fork). The rationale in mapbox/mapbox-gl-js#10605 was that, apart from looking funky, it also complicated adding support for data-driven styling with line-dasharray: maplibre/maplibre-gl-js#1235.

@westnordost
Copy link
Collaborator

The issue occurs because MapLibre assumes that the map style itself does not dynamically interpolate the size of the (dashed) lines depending on the zoom level. The style used in the the StreetComplete style linked above scales the line-widths of roads, outlines etc. with the zoom level while most other styles don't.

@westnordost
Copy link
Collaborator

(FWIW, reproducible with org.maplibre.gl:android-sdk:11.3.0-vulkan-pre0)

@louwers louwers removed the bug Something isn't working label Nov 26, 2024
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

4 participants