-
-
Notifications
You must be signed in to change notification settings - Fork 715
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
[Feature] Allow "underzooming" to show entire map on non-square viewports when renderWorldCopies=false #4510
Comments
The currently restricted zoom-out behavior is not intended if I understand the renderWorldCopies docs correctly:
|
Restricted behaviour is intended, despite this quote. |
I was able to implement this by modifying a few lines of (Edit: See below comment for a temporary workaround for 3D.) However, on a 3D terrain map, it locks up when under-zoomed below 0 or when pitching at zoom levels below 2, sometimes throwing an 'outside of bounds' error:
|
Hi @sbachinin, the general use case is for when users wish to see the entire map no matter the aspect ratio of the viewport. For me specifically, I am implementing MapLibre for visualizing scans of paintings as single maps, and users have requested the ability to "fully zoom out" where they expect to see the entire painting. |
I would say that for paintings you can have them shown in a larger zoom, can't you? i.e. show full painting in zoom 3, or even 7 would solve this, wouldn't it? |
@HarelM ah, do you mean by padding the original images with a wide border so that the generated tilesets have plenty of empty space around the actual scan? |
Not sure if it's the same as what Harel means but - |
I use I hadn't yet considered rendering it smaller than the map. Perhaps because of how I have considered centering the painting, but for coordinate transformation that adds one more step (an XY offset). Having (0,0) as the origin for everything is easier. |
You can use image source instead of tiling I believe. |
The scans are of gigapixel magnitude — 100k × 100k px — so we rely on tiling. |
In my opinion, the idea of "underzooming" (viewing the whole globe on a single-globe map) totally makes sense. As for the complexity, I doubt that you can make it work well with little code. |
Good points. I agree that this should become the new default behavior for single-globe maps. I'll give it a try and update here when I've got something working. |
I've rescinded that solution as I've found a more intuitive design with two user settings — one for underzooming and one for overpanning. I'll explain here once I have a demo. |
Here is a demo of my new design that allows you to underzoom and overpan a single-copy world: https://larsmaxfield.github.io/swings/maplibre-underzoom/unbounded.html There are three parameters which I currently name as follows:
The If you underzoom the map such that the bounds must exceed the limit of Here are demos on tall- and wide-bounded maps: Tall area: Wide area: |
Why not use minZoom and bounds to define this behavior instead of introducing new configurations? |
I considered that, but:
|
I tend to think that the definitions added here are not in line with the previous configurations. |
Could you explain how they're not in line? Or point to a good example I could learn from? If it helps, the approach I took here is to default the map to current MapLibre behavior — no underzoom and no overpan unless both Good advice to see how a plugin could solve this. I'm still getting familiar with everything that can be done with MapLibre and hadn't considered that. I will try that out. Nevertheless I agree with @sbachinin that underzooming could be the default single-world behavior. |
Most options are not in the range of 0 to 1, see here: |
I updated the number options to be percentages with Still looking into the plugin route. |
Currently if
renderWorldCopies = false
and the viewport is not square, the map does not allow the user to zoom out enough to show the entire map.You can see this in the render world copies example by fully zooming out and toggling the option:
Zooming out is limited to when the map's bounds are reached on the left and right sides (with a wide viewport) or the top and bottom sides (with a tall viewport).
I assume this is the intended behavior.Edit: This appears to not be the intended behavior; see comment below.However, this can be abrupt for users who expect to be able to see the entire map when they attempt to fully zoom out the map.
I would like an option to allow the map to be "underzoomed" until the entire map is visible when
renderWorldCopies = false
, whereby the background area outside the map is transparent or assigned a color:Perhaps the option could be something like
showEntireMap
orallowUnderZoom
, though I'm not familiar with best practices in naming and implementation.(One could think of this as (un)constraining the zoom and pan of the map, which the OpenSeadragon image viewer does nicely here: https://openseadragon.github.io/examples/ui-zoom-and-pan/.)
The text was updated successfully, but these errors were encountered: