Ignore:
Timestamp:
2012-08-15T15:06:01+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #7963 - remotecontrol v1.4 : Add min_zoom and max_zoom parameters for /imagery command

File:
1 edited

Legend:

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

    r5444 r5445  
    4949        String title = args.get("title");
    5050        String type = args.get("type");
    51         if ((title == null) || (title.length() == 0)) {
     51        if ((title == null) || (title.isEmpty())) {
    5252            title = tr("Remote imagery");
    5353        }
    5454        String cookies = args.get("cookies");
    55         ImageryLayer imgLayer = ImageryLayer.create(new ImageryInfo(title, url, type, null, cookies));
    56         Main.main.addLayer(imgLayer);
     55        ImageryInfo imgInfo = new ImageryInfo(title, url, type, null, cookies);
     56        String min_zoom = args.get("min_zoom");
     57        if (min_zoom != null && !min_zoom.isEmpty()) {
     58            try {
     59                imgInfo.setDefaultMinZoom(Integer.parseInt(min_zoom));
     60            } catch (NumberFormatException e) {
     61                System.err.println(e.getMessage());
     62            }
     63        }
     64        String max_zoom = args.get("max_zoom");
     65        if (max_zoom != null && !max_zoom.isEmpty()) {
     66            try {
     67                imgInfo.setDefaultMaxZoom(Integer.parseInt(max_zoom));
     68            } catch (NumberFormatException e) {
     69                System.err.println(e.getMessage());
     70            }
     71        }
     72        Main.main.addLayer(ImageryLayer.create(imgInfo));
    5773    }
    5874
Note: See TracChangeset for help on using the changeset viewer.