Opened 15 years ago
Closed 15 years ago
#1963 closed defect (fixed)
[PATCH] Show some context around found object by making bounding box larger
Reported by: | Owned by: | framm | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
When you zoom to a selected node, the magnification is too much and you
can't see any context - I always have to zoom out to see what's around the
node of interest.
The attached patch just makes the bounding box bigger - a simple fix.
Please consider using it!
Attachments (2)
Change History (12)
by , 15 years ago
Attachment: | SelectionListDialog.java.diff added |
---|
comment:1 by , 15 years ago
Summary: | Show some context around found object by making bounding box larger → [PATCH] Show some context around found object by making bounding box larger |
---|
comment:2 by , 15 years ago
comment:3 by , 15 years ago
Bizarrely, I cannot reproduce this problem now. If it reappears, I shall investigate
further. Can we leave this ticket open for a while?
comment:4 by , 15 years ago
Hah!
The bad zoom only happens when projection=org.openstreetmap.josm.data.projection.Epsg4326
When set to Merkator, the zoom works OK, as you say.
So the (real) bug must be in the EPSG code, looking...
comment:5 by , 15 years ago
OK, further investigation shows that the problem occurs using the basic "zoom to
selected" function (key '3'). If a single node is selected, the zoom factor becomes
14 when Merkator is being used and 19 when EPSG is being used.
So we can forget this patch and start hunting for the real bug.
comment:6 by , 15 years ago
Type: | enhancement → defect |
---|
Found the problem (fixed in attached patch).
enlargeBoundingBox() was creating an EastNorth directly but it should have
created a LatLon first which would have factored in the projection's scaling.
Also, changed the 0.0001 to 0.002 which now gives a zoom factor of about 15 for
a node irrespective of the projection in use.
comment:8 by , 15 years ago
Unfortunately, the Lambert Zone doesn't work right. It zooms out to 80km (zoom level 2) when zooming to a single node.
I shall try and look into that later tonight.
by , 15 years ago
Attachment: | BoundingXYVisitor.java.patch added |
---|
comment:9 by , 15 years ago
It was easier than I thought. Now works with all 3 projection types.
Patch updated.
comment:10 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Applied in r1226. Thanks for your work.
I do not understand your intention here. At least on my system the zoom action already has context around and I also remember when I and Frederik implemented it. Please add a screenshot and your preferences file when this is not true for your system (strip private information from prefs).