Changeset 17724 in josm


Ignore:
Timestamp:
2021-04-09T10:38:46+02:00 (4 years ago)
Author:
simon04
Message:

fix #20730, see #20660 - Remote control /imagery: add imagery by id (also all layers)

File:
1 edited

Legend:

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

    r17655 r17724  
    88import java.util.Map;
    99import java.util.Objects;
    10 import java.util.Optional;
    1110import java.util.Set;
    1211
     
    6564        String id = args.get("id");
    6665        if (id != null) {
    67             Optional<ImageryInfo> byId = ImageryLayerInfo.instance.getLayers().stream()
     66            return ImageryLayerInfo.instance.getAllDefaultLayers().stream()
    6867                    .filter(l -> Objects.equals(l.getId(), id))
    69                     .findFirst();
    70             if (byId.isPresent()) {
    71                 return byId.get();
    72             }
     68                    .findFirst()
     69                    .orElseThrow(() -> new IllegalArgumentException("Cannot find layer for id " + id));
    7370        }
    7471        args.computeIfAbsent("type", ignore -> ImageryType.WMS.getDefault().getTypeString());
Note: See TracChangeset for help on using the changeset viewer.