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

Should we continue faking zoom levels for non-Mapbox GL maps? #130

Open
ebrelsford opened this issue Dec 8, 2022 · 2 comments
Open

Should we continue faking zoom levels for non-Mapbox GL maps? #130

ebrelsford opened this issue Dec 8, 2022 · 2 comments

Comments

@ebrelsford
Copy link
Contributor

As mentioned in #129 here.

Both Google and Leaflet maps use zoom levels that are off by 1 from Mapbox GL/Maplibre maps. In our current implementation we bump the zoom levels to prioritize maps aligning in the interface rather than the zoom levels being 100% accurate. For example:

image

For Google Maps we do this in a few places:

map.moveCamera({
center: {
lat: center.lat,
lng: center.lng,
},
zoom: zoom + 1,
heading: bearing,
tilt: pitch,
});

const getCurrentMapView = () => {
return {
bearing: map.getHeading(),
center: {
lng: map.getCenter().lng(),
lat: map.getCenter().lat(),
},
pitch: map.getTilt(),
zoom: map.getZoom() - 1,
};
};

And we do something similar for Leaflet maps.

The argument for keeping this as it is is that we will generally only be using Google/Leaflet maps as reference maps and it is less important that the zoom levels are accurate. Looking at multiple map panes with the Google/Leaflet maps at different scales could be confusing.

@bdon
Copy link
Contributor

bdon commented Mar 4, 2023

Couldn't we drop leaflet completely in favor of display via maplibre raster sources? example

https://github.com/bdon/maperture/blob/main/public/config/osm-carto.json

passing tileSize=256 should make the viewports match 1:1 for reference.

@ebrelsford
Copy link
Contributor Author

We certainly could use mapbox/maplibre for raster sources or at least have that as an option! We would want to hold on to Leaflet support for Tangram for now though I believe.

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

2 participants