Changeset 7760 in josm
- Timestamp:
- 2014-12-01T21:14:03+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
r7251 r7760 9 9 import org.openstreetmap.josm.Main; 10 10 import org.openstreetmap.josm.data.imagery.ImageryInfo; 11 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 12 import org.openstreetmap.josm.data.imagery.ImageryLayerInfo; 11 13 import org.openstreetmap.josm.gui.layer.ImageryLayer; 12 14 import org.openstreetmap.josm.gui.util.GuiHelper; … … 46 48 } 47 49 50 protected static ImageryInfo findBingEntry() { 51 for (ImageryInfo i : ImageryLayerInfo.instance.getDefaultLayers()) { 52 if (ImageryType.BING.equals(i.getImageryType())) { 53 return i; 54 } 55 } 56 return null; 57 } 58 48 59 @Override 49 60 protected void handleRequest() throws RequestHandlerErrorException { … … 51 62 String title = args.get("title"); 52 63 String type = args.get("type"); 53 if ((title == null) || (title.isEmpty())) { 64 final ImageryInfo bing = ImageryType.BING.getTypeString().equals(type) ? findBingEntry() : null; 65 if ((title == null || title.isEmpty()) && bing != null) { 66 title = bing.getName(); 67 } 68 if (title == null || title.isEmpty()) { 54 69 title = tr("Remote imagery"); 55 70 } 56 71 String cookies = args.get("cookies"); 57 72 final ImageryInfo imgInfo = new ImageryInfo(title, url, type, null, cookies); 73 if (bing != null) { 74 imgInfo.setIcon(bing.getIcon()); 75 } 58 76 String min_zoom = args.get("min_zoom"); 59 77 if (min_zoom != null && !min_zoom.isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.