- Timestamp:
- 2014-12-22T01:01:08+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
r7760 r7871 57 57 } 58 58 59 @Override 60 protected void handleRequest() throws RequestHandlerErrorException { 59 protected ImageryInfo buildImageryInfo() { 61 60 String url = args.get("url"); 62 61 String title = args.get("title"); … … 74 73 imgInfo.setIcon(bing.getIcon()); 75 74 } 76 String min _zoom = args.get("min_zoom");77 if (min _zoom != null && !min_zoom.isEmpty()) {75 String minZoom = args.get("min_zoom"); 76 if (minZoom != null && !minZoom.isEmpty()) { 78 77 try { 79 imgInfo.setDefaultMinZoom(Integer.parseInt(min _zoom));78 imgInfo.setDefaultMinZoom(Integer.parseInt(minZoom)); 80 79 } catch (NumberFormatException e) { 81 80 Main.error(e); 82 81 } 83 82 } 84 String max _zoom = args.get("max_zoom");85 if (max _zoom != null && !max_zoom.isEmpty()) {83 String maxZoom = args.get("max_zoom"); 84 if (maxZoom != null && !maxZoom.isEmpty()) { 86 85 try { 87 imgInfo.setDefaultMaxZoom(Integer.parseInt(max _zoom));86 imgInfo.setDefaultMaxZoom(Integer.parseInt(maxZoom)); 88 87 } catch (NumberFormatException e) { 89 88 Main.error(e); 89 } 90 } 91 return imgInfo; 92 } 93 94 @Override 95 protected void handleRequest() throws RequestHandlerErrorException { 96 final ImageryInfo imgInfo = buildImageryInfo(); 97 if (Main.isDisplayingMapView()) { 98 for (ImageryLayer layer : Main.map.mapView.getLayersOfType(ImageryLayer.class)) { 99 if (layer.getInfo().equals(imgInfo)) { 100 Main.info("Imagery layer already exists: "+imgInfo); 101 return; 102 } 90 103 } 91 104 } … … 114 127 args.put("url", decodeParam(query.substring(urlIdx + 5))); 115 128 query = query.substring(0, urlIdx); 116 } else { 117 if (query.indexOf('#') != -1) { 118 query = query.substring(0, query.indexOf('#')); 119 } 129 } else if (query.indexOf('#') != -1) { 130 query = query.substring(0, query.indexOf('#')); 120 131 } 121 132 String[] params = query.split("&", -1);
Note:
See TracChangeset
for help on using the changeset viewer.