Changeset 5600 in josm for trunk


Ignore:
Timestamp:
2012-11-25T21:24:25+01:00 (12 years ago)
Author:
simon04
Message:

fix #8142 - Remote control: add zoom_mode parameter to load_and_zoom handler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r5460 r5600  
    126126        }
    127127
     128        final Bounds bbox = new Bounds(new LatLon(minlat, minlon), new LatLon(maxlat, maxlon));
    128129        if (args.containsKey("select") && PermissionPrefWithDefault.CHANGE_SELECTION.isAllowed()) {
    129130            // select objects after downloading, zoom to selection.
     
    168169                    ds.setSelected(newSel);
    169170                    if (PermissionPrefWithDefault.CHANGE_VIEWPORT.isAllowed()) {
    170                         AutoScaleAction.autoScale("selection");
     171                        // zoom_mode=(download|selection), defaults to selection
     172                        if (!"download".equals(args.get("zoom_mode"))) {
     173                            AutoScaleAction.autoScale("selection");
     174                        } else {
     175                            zoom(bbox);
     176                        }
    171177                    }
    172178                    if (Main.isDisplayingMapView() && Main.map.relationListDialog != null) {
     
    179185        } else if (PermissionPrefWithDefault.CHANGE_VIEWPORT.isAllowed()) {
    180186            // after downloading, zoom to downloaded area.
    181             zoom(minlat, maxlat, minlon, maxlon);
     187            zoom(bbox);
    182188        }
    183189
     
    215221    }
    216222
    217     protected void zoom(double minlat, double maxlat, double minlon, double maxlon) {
    218         final Bounds bounds = new Bounds(new LatLon(minlat, minlon),
    219                 new LatLon(maxlat, maxlon));
    220 
     223    protected void zoom(final Bounds bounds) {
    221224        // make sure this isn't called unless there *is* a MapView
    222         //
    223225        if (Main.isDisplayingMapView()) {
    224226            Main.worker.execute(new Runnable() {
Note: See TracChangeset for help on using the changeset viewer.