Changeset 13878 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r13872 r13878 432 432 // TODO should we handle also POST? 433 433 if ("GET".equalsIgnoreCase(mode) && getMapUrl != null && !"".equals(getMapUrl)) { 434 if (getMapUrl.endsWith("?")) { 435 this.getMapUrl = getMapUrl; 436 } else { 437 this.getMapUrl = getMapUrl + "?"; 434 try { 435 String query = (new URL(getMapUrl)).getQuery(); 436 if (query == null || query.isEmpty()) { 437 this.getMapUrl = getMapUrl + "?"; 438 } else { 439 this.getMapUrl = getMapUrl; 440 } 441 } catch (MalformedURLException e) { 442 throw new XMLStreamException(e); 438 443 } 439 444 } -
trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java
r13870 r13878 91 91 ); 92 92 WMSImagery wms = new WMSImagery(tileServer.url("any")); 93 assertEquals("http://wms.hgis.cartomatic.pl/topo/3857/m25k ", wms.buildRootUrl());93 assertEquals("http://wms.hgis.cartomatic.pl/topo/3857/m25k?", wms.buildRootUrl()); 94 94 assertEquals("wms.hgis.cartomatic.pl", wms.getLayers().get(0).getName()); 95 assertEquals("http://wms.hgis.cartomatic.pl/topo/3857/m25k FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&"95 assertEquals("http://wms.hgis.cartomatic.pl/topo/3857/m25k?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&" 96 96 + "LAYERS=wms.hgis.cartomatic.pl&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}", 97 97 wms.buildGetMapUrl(wms.getLayers(), (List<String>) null, true));
Note:
See TracChangeset
for help on using the changeset viewer.