Changeset 14442 in josm for trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java
- Timestamp:
- 2018-11-22T00:50:48+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java
r14397 r14442 232 232 /** 233 233 * Adds a WMS Layer with given title and URL 234 * @param title Name of the layer as it will sho pup in the layer manager234 * @param title Name of the layer as it will show up in the layer manager 235 235 * @param url URL to the WMS server 236 236 * @throws IllegalStateException if imagery time is neither HTML nor WMS … … 242 242 info = AddImageryLayerAction.getWMSLayerInfo(info); 243 243 } catch (IOException | WMSGetCapabilitiesException e) { 244 Logging.error(e); 245 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 246 e.getMessage(), tr("No valid WMS URL or id"), JOptionPane.ERROR_MESSAGE); 244 handleException(e); 247 245 return; 248 246 } 249 247 } 250 MainApplication.getLayerManager().addLayer(ImageryLayer.create(info)); 248 try { 249 MainApplication.getLayerManager().addLayer(ImageryLayer.create(info)); 250 } catch (IllegalArgumentException e) { 251 handleException(e); 252 } 253 } 254 255 private static void handleException(Exception e) { 256 Logging.error(e); 257 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 258 e.getMessage(), tr("No valid WMS URL or id"), JOptionPane.ERROR_MESSAGE); 251 259 } 252 260
Note:
See TracChangeset
for help on using the changeset viewer.