Changeset 16734 in josm for trunk/src/org


Ignore:
Timestamp:
2020-07-06T17:44:17+02:00 (4 years ago)
Author:
simon04
Message:

fix #19483 - Remote control /imagery: parse extended URL (parse imagery type from URL)

File:
1 edited

Legend:

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

    r16589 r16734  
    5353
    5454    protected ImageryInfo buildImageryInfo() {
    55         args.computeIfAbsent("type", ignore -> ImageryType.WMS.getDefault().getTypeString());
     55        ImageryInfo fromExtendedUrl = new ImageryInfo("", args.get("url"));
     56        args.put("url", fromExtendedUrl.getUrl());
     57        args.computeIfAbsent("min_zoom", ignore -> String.valueOf(fromExtendedUrl.getMinZoom()));
     58        args.computeIfAbsent("max_zoom", ignore -> String.valueOf(fromExtendedUrl.getMaxZoom()));
     59        args.computeIfAbsent("type", ignore -> fromExtendedUrl.getSourceType().getTypeString());
    5660        args.computeIfAbsent("name", ignore -> args.getOrDefault("title", tr("Remote imagery")));
    5761        ImageryPreferenceEntry imageryPreferenceEntry = StructUtils.deserializeStruct(args, ImageryPreferenceEntry.class);
     
    101105        return new String[] {
    102106            "/imagery?title=osm&type=tms&url=https://a.tile.openstreetmap.org/%7Bzoom%7D/%7Bx%7D/%7By%7D.png",
     107            "/imagery?url=[0-19]https://a.tile.openstreetmap.org/%7Bzoom%7D/%7Bx%7D/%7By%7D.png",
    103108            "/imagery?title=landsat&type=wms&url=http://irs.gis-lab.info/?" +
    104109                    "layers=landsat&SRS=%7Bproj%7D&WIDTH=%7Bwidth%7D&HEIGHT=%7Bheight%7D&BBOX=%7Bbbox%7D",
Note: See TracChangeset for help on using the changeset viewer.