Changeset 8805 in josm for trunk/src/org


Ignore:
Timestamp:
2015-09-29T19:56:42+02:00 (5 years ago)
Author:
simon04
Message:

see #6968 - Add also markers when converting data layer to gpx layer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r8728 r8805  
    8383import org.openstreetmap.josm.gui.io.UploadDialog;
    8484import org.openstreetmap.josm.gui.io.UploadLayerTask;
     85import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
    8586import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
    8687import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     
    730731        @Override
    731732        public void actionPerformed(ActionEvent e) {
    732             Main.main.addLayer(new GpxLayer(toGpxData(), tr("Converted from: {0}", getName())));
     733            final GpxData data = toGpxData();
     734            final GpxLayer gpxLayer = new GpxLayer(data, tr("Converted from: {0}", getName()));
     735            Main.main.addLayer(gpxLayer);
     736            if (Main.pref.getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) {
     737                Main.main.addLayer(new MarkerLayer(data, tr("Converted from: {0}", getName()), null, gpxLayer));
     738            }
    733739            Main.main.removeLayer(OsmDataLayer.this);
    734740        }
Note: See TracChangeset for help on using the changeset viewer.