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

Allow for lowering zoom levels #128

Open
thibaultmol opened this issue Dec 26, 2024 · 5 comments
Open

Allow for lowering zoom levels #128

thibaultmol opened this issue Dec 26, 2024 · 5 comments

Comments

@thibaultmol
Copy link

Def if you're exploring data on osm using the "map data" layer in the layers tab, it would be nice to be able to zoom in more than the current z zoom limit

@deevroman
Copy link
Owner

The main problem here is that if you set maxZoom greater than the maximum zoom of the layer (OSM Standard = 19), then nothing will be displayed on the map except for the gray background.

maxZooms:

CyclOSM = 20
CycleOSM = 21
TransportMap = 20
TracetrackTopo = 19
Humanitarian = 20

For now I do not know how to enable the overzoom in Leaflet.

@thibaultmol
Copy link
Author

thibaultmol commented Dec 27, 2024

ah right, guess this'll be solvable once osm org uses the osm vector tiles... actually.. could you use js to switch to vector tiles or is that too much work (and not worth it, just wait till osm does it themselves?)

https://weeklyosm.eu/archives/17587#:~:text=Vector%20tiles%20are,as%20a%20map.

@deevroman

This comment was marked as outdated.

@deevroman
Copy link
Owner

deevroman commented Dec 27, 2024

Okay, that's how it works:

map.options.maxZoom = 23
var layers = []
map.eachLayer(i => layers.push(i))
layers[0].options.maxZoom = 23

It remains to understand why this works, and when this code should be run :)

For example, this would also be useful for such changesets: https://osm.org/changeset/160584534

@deevroman
Copy link
Owner

in 0.7, a setting was added that enables overzoom when the Map Data layer is active. This option is disabled by default, because sometimes you can see gray tiles.

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