Closed jeffreyameyer closed 3 years ago
I thought this would be a simple case of changing minzoom to 3: https://github.com/OpenHistoricalMap/ohm-website/commit/5f172fc87ecbc135b6bc0ffbae3ce379430fef08
But the result is that you can still zoom out but the map tries to stick to z3 and gets buggy, as shown here: https://recordit.co/BkW6KrKytu
Let's have @gregallensworth take a look and see what the better way is to restrict minzoom
The minZoom
on line 27 is for the new L.MapboxGL
https://github.com/OpenHistoricalMap/ohm-website/blob/5f172fc87ecbc135b6bc0ffbae3ce379430fef08/app/assets/javascripts/index.js#L81-L85 sets the options for the L.Map
This is where you would stick minZoom and maxZoom if you want them to apply to the map instead of to a specific layer.
I'll whip this up, and also add some comments so folks would look in both places in the future.
Testing this out and this is super weird -- z3 on live site is not the same as z3 on local dev? Is this something about vector tiles z3 vs leaflet z3? But both are leaflet.
Don't have time to sort this yet, but the localdev version is too close:
Is this one of those things where leaflet & tegola index zooms differently?
On Tue, Jun 8, 2021, 11:31 AM Dan Rademacher @.***> wrote:
Testing this out and this is super weird -- z3 on live site is not the same as z3 on local dev? Is this something about vector tiles z3 vs leaflet z3? But both are leaflet.
Don't have time to sort this yet, but the localdev version is too close: [image: image] https://user-images.githubusercontent.com/1423200/121238483-0103df00-c84d-11eb-9e38-5361da1455bd.png
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenHistoricalMap/issues/issues/244#issuecomment-856999370, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALM4EWYMSRJLD3BAEBUPVTTRZOYVANCNFSM46BLTL3Q .
I think that's somehow part of the problem, but since both maps in the screenshot are Leaflet, and the very same leaflet.
Anyway, I am now testing setting the min to z2.
Here's on the 27" screen:
And the 13"
I imagine that with a larger monitor would allow some level of wrap-around, but this seems like a good compromise to me
This is now live on openhistoricalmap.org -- minzoom = 2
What's your idea for a cool feature that would help you use OHM better. Please provide a clear and concise description of the problem you'd like to solve & how you'd like to solve it. Or, the other way around! e.g. I'd like to have the inspector show time-related pictures of the object, so I can get a better idea of what the place was like at the time.
I'd like to have the min zoom level for OHM set to 3. This is the standard presentation style for Google and Bing maps. Mapbox min is 1(ish) and Apple appears to have a min of 3.3(ish).
That would remove the crazy situation where you see the entire world tile around repeatedly... ![image](https://user-images.githubusercontent.com/1494546/120700006-f8369600-c465-11eb-8020-76c8780fd770.png
The user behavior this prevents is the rapid zoom out to a really unusable point, then having to zoom in and zoom out a bunch. This will help speed people to usable zoom levels.
Current workarounds Is there any way to meet this need using a workaround or "hack" right now? Not that I know of...