Ignore:
Timestamp:
2015-02-15T19:55:12+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #11076 - robustness to unsupported WMS rectifier imagery types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java

    r8061 r8068  
    187187                // Just set the URL and hope everything works out
    188188                if(s.wmsUrl.isEmpty()) {
    189                     addWMSLayer(s.name + " (" + text + ")", text);
    190                     break outer;
     189                    try {
     190                        addWMSLayer(s.name + " (" + text + ")", text);
     191                        break outer;
     192                    } catch (IllegalStateException ex) {
     193                        Main.error(ex.getMessage());
     194                    }
    191195                }
    192196
     
    226230     * @param title Name of the layer as it will shop up in the layer manager
    227231     * @param url URL to the WMS server
     232     * @throws IllegalStateException if imagery time is neither HTML nor WMS
     233     * @see WMSLayer#checkGrabberType
    228234     */
    229235    private void addWMSLayer(String title, String url) {
    230         Main.main.addLayer(new WMSLayer(new ImageryInfo(title, url)));
     236        WMSLayer layer = new WMSLayer(new ImageryInfo(title, url));
     237        layer.checkGrabberType();
     238        Main.main.addLayer(layer);
    231239    }
    232240
Note: See TracChangeset for help on using the changeset viewer.