Changeset 726 in josm


Ignore:
Timestamp:
2008-07-18T10:12:21+02:00 (16 years ago)
Author:
framm
Message:
  • automatically swap lat/lon in download dialog if necessary. patch by Gervase Markham <gerv@…>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r682 r726  
    5858
    5959        public void download(DownloadAction action, double minlat, double minlon, double maxlat, double maxlon) {
     60    // Swap min and max if user has specified them the wrong way round
     61    // (easy to do if you are crossing 0, for example)
     62    if (minlat > maxlat) {
     63      double t = minlat; minlat = maxlat; maxlat = t;
     64    }
     65    if (minlon > maxlon) {
     66      double t = minlon; minlon = maxlon; maxlon = t;
     67    }
     68   
    6069                Task task = new Task(action.dialog == null || action.dialog.newLayer.isSelected(), new BoundingBoxDownloader(minlat, minlon, maxlat, maxlon));
    6170                Main.worker.execute(task);
Note: See TracChangeset for help on using the changeset viewer.