Changeset 11168 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r11167 r11168 30 30 import org.openstreetmap.josm.gui.ExtendedDialog; 31 31 import org.openstreetmap.josm.gui.layer.imagery.TileSourceDisplaySettings; 32 import org.openstreetmap.josm.tools.CheckParameterUtil; 32 33 33 34 /** … … 61 62 public WMSLayer(ImageryInfo info) { 62 63 super(info); 64 CheckParameterUtil.ensureThat(info.getImageryType() == ImageryType.WMS, "ImageryType is WMS"); 65 CheckParameterUtil.ensureParameterNotNull(info.getUrl(), "info.url"); 66 TemplatedWMSTileSource.checkUrl(info.getUrl()); 63 67 this.supportedProjections = new TreeSet<>(info.getServerProjections()); 64 68 } … … 82 86 @Override 83 87 protected AbstractWMSTileSource getTileSource() { 84 if (info.getImageryType() == ImageryType.WMS && info.getUrl() != null) { 85 TemplatedWMSTileSource.checkUrl(info.getUrl()); 86 AbstractWMSTileSource tileSource = new TemplatedWMSTileSource(info); 87 info.setAttribution(tileSource); 88 return tileSource; 89 } 90 return null; 88 AbstractWMSTileSource tileSource = new TemplatedWMSTileSource(info); 89 info.setAttribution(tileSource); 90 return tileSource; 91 91 } 92 92 -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
r10436 r11168 38 38 } 39 39 } 40 41 /** 42 * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/13828">Bug #13828</a>. 43 */ 44 @Test(expected = IllegalArgumentException.class) 45 public void testTicket13828() { 46 new WMSLayer(new ImageryInfo("TMS", "http://203.159.29.217/try2/{z}/{x}/{y}.png")); 47 } 40 48 }
Note:
See TracChangeset
for help on using the changeset viewer.