#10861 closed enhancement (fixed)
Zoom to layer when opening new file
Reported by: | bastiK | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 14.12 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
When a new file is opened, JOSM should zoom to the viewport of the new layer, rather than keeping the old view.
The current behavior is strange if the layer is completely off screen and usually you want to see what is opened.
Attachments (0)
Change History (16)
comment:1 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 8 years ago by
That's actually a very bad idea if you try to open an additional layer containing for example GNS place names of a country! With other words it takes minutes before the place name file for Indonesia opens! Try to open http://katpatuka.org/pub/osm/osm-id.7z, a 49 Mb file containing ~250.000 nodes (which easily opened in ver. 7777 when the first layer was at zoomlevel 15).
Now josm now has a real hard time to display 250.000 nodes!
comment:3 follow-up: 7 Changed 8 years ago by
Maybe change zoom only if the new layer bounds do not contain the current ones?
comment:4 follow-up: 8 Changed 8 years ago by
If new layer is one and only layer
do as is
else
if open layer count = 2
use zoomlevel of older layer
else
don't know
endif
endif
comment:5 Changed 8 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
so I reopen the ticket.
comment:6 follow-up: 9 Changed 8 years ago by
There are various workarounds:
(1) Open once, zoom in, save as session. Next time you open the session file, the initial zoom will be preserved.
(2) If it is impossible to open even a single time, then open a dummy file, save the session (.jos). Then remove the dummy file and replace if with the real one (same file name).
(3) Unrelated to sessions, but works only for .osm data files: Set a filter to hide everything. Then zoom in and disable the filter.
I realize, these strategies are sneaky and far from obvious, but so was your method to display a huge file by opening a small one first.
The current behavior is good for the average user and I would like to keep it this way in principle.
comment:7 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Replying to Don-vip:
Maybe change zoom only if the new layer bounds do not contain the current ones?
This means that JOSM will sometimes zoom to the layer and sometimes not. The user may be puzzled as this condition is not completely obvious. Intuitively, it would make more sense to keep the bounding box when the new layer bounds are completely within the current view.
Otherwise I think this would be an okay solution. Let's see if we get more feedback.
comment:8 Changed 8 years ago by
comment:9 follow-up: 10 Changed 8 years ago by
Replying to bastiK:
There are various workarounds:
(1) Open once, zoom in, save as session. Next time you open the session file, the initial zoom will be preserved.
(2) If it is impossible to open even a single time, then open a dummy file, save the session (.jos). Then remove the dummy file and replace if with the real one (same file name).
(3) Unrelated to sessions, but works only for .osm data files: Set a filter to hide everything. Then zoom in and disable the filter.
I realize, these strategies are sneaky and far from obvious, but so was your method to display a huge file by opening a small one first.
The current behavior is good for the average user and I would like to keep it this way in principle.
What I actually do not understand is why someone wants to see the viewport of a new layer when opening it! For years now there exists keypress 2 to accomplish this if you need that feature!
By the way workaround (1) does not work for me. Take some file (http://katpatuka.org/pub/osm/osm-my-hydro.7z contains ~30.000 GNS river names of Malaysia), open it (full viewport displays), select one node, keypress 3 zooms to node, save as session, close session, reopen session - what happens? Again full viewport displays.
comment:10 Changed 8 years ago by
Replying to katpatuka:
What I actually do not understand is why someone wants to see the viewport of a new layer when opening it!
When you open a new layer, it is normal that you want to interact with it immediately. Especially the case where the new layer is completely out of view was strange as the mapview didn't change at all.
By the way workaround (1) does not work for me. Take some file (http://katpatuka.org/pub/osm/osm-my-hydro.7z contains ~30.000 GNS river names of Malaysia), open it (full viewport displays), select one node, keypress 3 zooms to node, save as session, close session, reopen session - what happens? Again full viewport displays.
Works for me. Please open a separate bug report (attach your session file).
comment:12 Changed 8 years ago by
For the records: someone suggested a workaround on irc channel to the problem which works fine: first activate Wireframe View before loading a 30.000-node .osm file (which I'd never used before...). Only dots are displayed without names then (having to display 30.000 node names in viewport makes josm slow). After that you can switch back to other layer, zoom down again and deactivate Wireframe View.
comment:13 follow-up: 14 Changed 8 years ago by
i almost reported the new behaviour as a bug :)
(ended up reporting only a subset - zoom changed when converting - as ticket #11304).
i'd like to ask for reconsideration regarding this change. my reasoning is similar as katpatuka's - one can easily hit '2' to zoom to a layer, but getting back to the previous zoomlevel seems to be somewhere between complicated and impossible.
my usecase - having a gpx file open, zoomed in to some small section of it and wondering whether some other gpx file would cover that section, too. so i open that file. with 7777 and earlier i could see the same section and easily decide whether that was good. with recent versions... it's a complicated zoom/pan/zoom/whereisit.
note that when the zoom level is changed josm also starts downloading any imagery for the new zoom, which is a bit of a problem on slow/metered connections.
comment:14 Changed 8 years ago by
Replying to richlv:
i'd like to ask for reconsideration regarding this change. my reasoning is similar as katpatuka's - one can easily hit '2' to zoom to a layer, but getting back to the previous zoomlevel seems to be somewhere between complicated and impossible.
Simply hit '8' to get to the previous zoomlevel.
comment:15 Changed 8 years ago by
ah, thanks - i still find the new behaviour inconvenient, but that shortcut helps a bit :)
comment:16 Changed 8 years ago by
This change is targeted at the average user and most common workflow. If you find one very rare corner case where the old behavior was more convenient, this is not a reason for me to revert. Especially when there is an obvious workaround.
In 7817/josm: