Changeset 4858 in josm


Ignore:
Timestamp:
Jan 23, 2012 3:17:45 PM (16 months ago)
Author:
bastiK
Message:

fixed remotecontrol new_layer: do not subtract download area of current layer

File:
1 edited

Legend:

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

    r4834 r4858  
    7878                else 
    7979                { 
    80  
    81                     // find out whether some data has already been downloaded 
    82                     Area present = null; 
    8380                    Area toDownload = null; 
    84                     DataSet ds = Main.main.getCurrentDataSet(); 
    85                     if (ds != null) { 
    86                         present = ds.getDataSourceArea(); 
    87                     } 
    88                     if (present != null && !present.isEmpty()) { 
    89                         toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat)); 
    90                         toDownload.subtract(present); 
    91                         if (!toDownload.isEmpty()) 
    92                         { 
    93                             // the result might not be a rectangle (L shaped etc) 
    94                             Rectangle2D downloadBounds = toDownload.getBounds2D(); 
    95                             minlat = downloadBounds.getMinY(); 
    96                             minlon = downloadBounds.getMinX(); 
    97                             maxlat = downloadBounds.getMaxY(); 
    98                             maxlon = downloadBounds.getMaxX(); 
    99                         } 
    100                     } 
    101                     if((toDownload != null) && toDownload.isEmpty()) 
     81                    if (!newLayer) { 
     82                        // find out whether some data has already been downloaded 
     83                        Area present = null; 
     84                        DataSet ds = Main.main.getCurrentDataSet(); 
     85                        if (ds != null) { 
     86                            present = ds.getDataSourceArea(); 
     87                        } 
     88                        if (present != null && !present.isEmpty()) { 
     89                            toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat)); 
     90                            toDownload.subtract(present); 
     91                            if (!toDownload.isEmpty()) 
     92                            { 
     93                                // the result might not be a rectangle (L shaped etc) 
     94                                Rectangle2D downloadBounds = toDownload.getBounds2D(); 
     95                                minlat = downloadBounds.getMinY(); 
     96                                minlon = downloadBounds.getMinX(); 
     97                                maxlat = downloadBounds.getMaxY(); 
     98                                maxlon = downloadBounds.getMaxX(); 
     99                            } 
     100                        } 
     101                    } 
     102                    if (toDownload != null && toDownload.isEmpty()) 
    102103                    { 
    103104                        System.out.println("RemoteControl: no download necessary"); 
Note: See TracChangeset for help on using the changeset viewer.