umap-project / umap

uMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site.
https://umap-project.org
Other
1.2k stars 227 forks source link

Set minNativeZoom and maxNativeZoom for a map #982

Open tordans opened 2 years ago

tordans commented 2 years ago

This is similar to https://github.com/umap-project/umap/issues/103, but for the values.

They allow to set a maxZoom for the tiles (that is the "native" value) independent from the maxZoom for the viewer.

Example:

das-g commented 1 year ago

While this can be handy in any leaflet-based map, this would be especially handy in uMap maps, as the user-drawn contents might be smaller, closer to one another or more detailed than anything displayed on the background layer, so users might have to zoom in for both, editing and properly viewing these features. (E.g. when using uMap for mapping an indoor event location, with lots of temporary (event-specific) amenities that wouldn't themselves belong in OSM.) Yet, one would not want to only set maxZoom higher without having the background layer's native max zoom treated as maxNativeZoom, as a blurry background is still a better reference than no background at all.

yohanboniface commented 2 days ago

In other words: this would allow to zoom lower than what the tiles usually allow (eg. for drawing something very accurately), and in this case the shown tiles are the max zoom one, scaled (so a bit blurry).