Changeset 5458 in josm
- Timestamp:
- 2012-08-19T02:54:58+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r5091 r5458 56 56 } 57 57 } 58 59 protected boolean isLayerAlreadyPresent() { 60 if (Main.map != null && Main.map.mapView != null) { 61 for (ImageryLayer layer : Main.map.mapView.getLayersOfType(ImageryLayer.class)) { 62 if (info.equals(layer.getInfo())) { 63 return true; 64 } 65 } 66 } 67 return false; 68 } 58 69 59 70 @Override 60 71 protected void updateEnabledState() { 61 // never enable blacklisted entries. 62 if (info.isBlacklisted() ) {72 // never enable blacklisted entries. Do not add same imagery layer twice (fix #2519) 73 if (info.isBlacklisted() || isLayerAlreadyPresent()) { 63 74 setEnabled(false); 64 75 } else if (info.getImageryType() == ImageryType.TMS || info.getImageryType() == ImageryType.BING || info.getImageryType() == ImageryType.SCANEX) {
Note:
See TracChangeset
for help on using the changeset viewer.