Changeset 1396 in josm for trunk/src/org
- Timestamp:
- 2009-02-14T12:17:03+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r1169 r1396 41 41 rawData.recalculateBounds(); 42 42 Bounds b = rawData.bounds; 43 String name = b.min.lat() + " " + b.min.lon() + " x " + b.max.lat() + " " + b.max.lon();43 String name = tr("Downloaded GPX Data"); 44 44 GpxLayer layer = new GpxLayer(rawData, name); 45 if (newLayer || findMergeLayer() == null) 45 Layer x = findMergeLayer(); 46 if (newLayer || x == null) 46 47 Main.main.addLayer(layer); 47 48 else 48 findMergeLayer().mergeFrom(layer);49 x.mergeFrom(layer); 49 50 } 50 51 51 52 private Layer findMergeLayer() { 53 boolean merge = Main.pref.getBoolean("download.gps.mergeWithLocal", false); 52 54 if (Main.map == null) 53 55 return null; 54 56 Layer active = Main.map.mapView.getActiveLayer(); 55 if (active != null && active instanceof GpxLayer )57 if (active != null && active instanceof GpxLayer && (merge || ((GpxLayer)active).data.fromServer)) 56 58 return active; 57 59 for (Layer l : Main.map.mapView.getAllLayers()) 58 if (l instanceof GpxLayer )60 if (l instanceof GpxLayer && (merge || ((GpxLayer)l).data.fromServer)) 59 61 return l; 60 62 return null;
Note:
See TracChangeset
for help on using the changeset viewer.