Modify

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: markb@… 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)

SelectionListDialog.java.diff (546 bytes ) - added by anonymous 15 years ago.
BoundingXYVisitor.java.patch (1.9 KB ) - added by anonymous 15 years ago.

Download all attachments as: .zip

Change History (12)

by anonymous, 15 years ago

comment:1 by anonymous, 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 anonymous, 15 years ago

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).

comment:3 by anonymous, 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 anonymous, 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 anonymous, 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 anonymous, 15 years ago

Type: enhancementdefect

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:7 by anonymous, 15 years ago

Can you please test this with the french coordinate system as well?

comment:8 by anonymous, 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 anonymous, 15 years ago

comment:9 by anonymous, 15 years ago

It was easier than I thought. Now works with all 3 projection types.

Patch updated.

comment:10 by anonymous, 15 years ago

Resolution: fixed
Status: newclosed

Applied in r1226. Thanks for your work.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain framm.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.