Skip to content

MapLibre/Mapbox and Leaflet zooms are different by one #22

Description

@dschep

The same viewport in MapLibre will render one zoom level lower in Leaflet maps.

For example 4/40/-100 on osm.org(leaflet) vs americanamap.org(maplibre)

https://www.openstreetmap.org/#map=4/40.00/-100.00
image

vs

https://americanamap.org/#map=4/40/-100
image

In MapSwap I deal with this by templating the URLs for MapLibre-style zoom with {z} and those for Leaflet-style zoom with {Z} and replacing {Z} with zoom+1 rather than zoom (this means MapSwap operates on a MapLibre-style zoom level. You may want to go the other way and interpret the zoom as Leaflet-style)

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions