Changeset 31973 in osm for applications/editors/josm


Ignore:
Timestamp:
2016-01-11T23:05:18+01:00 (9 years ago)
Author:
floscher
Message:

[mapillary] No longer activate mapillary layer on creation of the layer

Only successive calls of the MapillaryDownloadAction toggle between the osm-data layer and the mapillary layer.
This issue was mentioned at http://wiki.openstreetmap.org/w/index.php?title=Talk:JOSM/Plugins/Mapillary&oldid=1260860#layer_active.2Finactive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java

    r31840 r31973  
    4242  @Override
    4343  public void actionPerformed(ActionEvent arg0) {
    44     MapillaryLayer.getInstance();
    45     if (Main.map.mapView.getActiveLayer() == MapillaryLayer.getInstance()) {
    46       Main.map.mapView.setActiveLayer(Main.map.mapView.getEditLayer());
    47     } else {
    48       Main.map.mapView.setActiveLayer(MapillaryLayer.getInstance());
     44    if (!MapillaryLayer.hasInstance()) {
     45      // A new mapillary layer is created, so the active layer is not changed
     46      MapillaryLayer.getInstance();
     47      return;
    4948    }
     49    // Successive calls to this action toggle the active layer between the OSM data layer and the mapillary layer
     50    Main.map.mapView.setActiveLayer(
     51        Main.map.mapView.getActiveLayer() == MapillaryLayer.getInstance()
     52          ? Main.map.mapView.getEditLayer()
     53          : MapillaryLayer.getInstance()
     54    );
    5055  }
    5156}
Note: See TracChangeset for help on using the changeset viewer.