Changeset 2395 in josm
- Timestamp:
- 2009-11-07T06:22:27+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r2348 r2395 43 43 import org.openstreetmap.josm.data.osm.OsmPrimitive; 44 44 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 45 import org.openstreetmap.josm.gui.layer.GpxLayer; 45 46 import org.openstreetmap.josm.gui.layer.Layer; 46 47 import org.openstreetmap.josm.gui.layer.MapViewPaintable; … … 148 149 149 150 /** 151 * Adds a GPX layer. A GPX layer is added below the lowest data layer. 152 * 153 * @param layer the GPX layer 154 */ 155 protected void addGpxLayer(GpxLayer layer) { 156 if (layers.isEmpty()) { 157 layers.add(layer); 158 return; 159 } 160 for (int i=layers.size()-1; i> 0; i--) { 161 if (layers.get(i) instanceof OsmDataLayer) { 162 if (i == layers.size()) { 163 layers.add(layer); 164 } else { 165 layers.add(i+1, layer); 166 } 167 return; 168 } 169 } 170 layers.add(layer); 171 } 172 173 /** 150 174 * Add a layer to the current MapView. The layer will be added at topmost 151 175 * position. … … 158 182 if (layer.isBackgroundLayer() || layers.isEmpty()) { 159 183 layers.add(layer); 184 } else if (layer instanceof GpxLayer){ 185 addGpxLayer((GpxLayer)layer); 160 186 } else { 161 187 layers.add(0, layer);
Note:
See TracChangeset
for help on using the changeset viewer.