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

Map Data overlay should not zoom by itself #3360

Open
hungerburg opened this issue Nov 10, 2021 · 5 comments
Open

Map Data overlay should not zoom by itself #3360

hungerburg opened this issue Nov 10, 2021 · 5 comments
Labels
enhancement Improvements and new feature requests mapview Related to the map view features ui User Interface

Comments

@hungerburg
Copy link

When map data overlay is on, clicking an item, that extends beyond the viewport, will make the map zoom out to show its full extent. If the item is big, this will make the browser window freeze and then report an error.

Please do not zoom - users can do that themselves, they may prefer to pan a bit, it should be their choice. There might be good intentions behind that auto-zoom, yet the result is often not wished for.

@tomhughes
Copy link
Member

Just panning could be very confusing though - if the object is larger than the current viewport then we might pan so that no part of it is actually visible because it surrounds the viewport without actually crossing it in any way.

The window shouldn't be freezing though because if the zoom gets too low then we disable to data layer to avoid trying to display huge amounts of data - it sounds like the threshold for that might need adjusting but as you haven't provided an example it's hard to evaluate the best solution.

@hungerburg
Copy link
Author

I'd say, the script should not mess with zoom, neither should it pan. In a densely mapped area, even changing from z19 to z18 will result in lots of stuff being downloaded, during the download, the page is frozen. Hitting by accident a 500m segment of a street will make it zoom to z17 with even longer stall, or even z16, where after several seconds the page shows the "slow down" warning. Not to mention, the overlay in these zoom levels covers parts of the map in a way to make it practically hidden, not much use of the feature then, in urban area, at least.

Not zooming/panning also will always result in the selected item being inside of the viewport :)

@mmd-osm
Copy link
Contributor

mmd-osm commented Nov 10, 2021

A side note regarding the freezing: we're still requesting XML version of the /map call, which adds quite some overhead due to DOM parsing and subsequent Garbage collection in the browser. Now that JSON format is also available, it might be an idea to switch to JSON format. Maybe a topic for another issue...

@lectrician1 lectrician1 added enhancement Improvements and new feature requests mapview Related to the map view features labels Nov 20, 2021
@mmd-osm mmd-osm added the ui User Interface label Jun 28, 2024
@si-the-pie
Copy link

The automatic zoom-on-select is a barrier to freely exploring the overlayed map data.

For instance when analyzing which ways have what tags the map needs to be at a high zoom level to resolve which way to click on. E.g. this can happen when a bridleway or other path is very close (within a couple of metres) to a district boundary. If the way for the district boundary is mistakenly clicked on (during seeking of the bridleway / path component ways) there's a moment of resignation and a frustrating pause while the map zooms out to the district boundary and a short wait to be advised to zoom back in because there's now too much data!

One way to mitigate this problem might be to have the option of suppressing the zooming behaviour by holding down a shift or control key during the mouse click that selects an overlay.

Another method might be to turn off the default zoom behaviour and instead add a zoom-object-into-view button on the side panel for the selected node/ way / relation.

@deevroman
Copy link
Contributor

It seems that Issue, as well as #2800 #3243, become outdated after

openstreetmap/leaflet-osm#43 (freezing before a warning)
#5563 (XML -> JSON)
#5474 (freezing after consent to rendering)

The only possible problem is that it will be difficult to move the map. However, now the browser is no longer frozen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements and new feature requests mapview Related to the map view features ui User Interface
Projects
None yet
Development

No branches or pull requests

6 participants