- Timestamp:
- 2019-07-06T20:10:03+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
r14367 r15209 123 123 wmsUrl.setEnabled(enabled); 124 124 if (endpoint.isSelected() && !setDefaultLayers.isSelected() && wms != null) { 125 name.setText(wms.buildRootUrl ());125 name.setText(wms.buildRootUrlWithoutCapabilities()); 126 126 } 127 127 onLayerSelectionChanged(); … … 161 161 ) 162 162 ); 163 name.setText(wms.buildRootUrl () + ": " + Utils.join(", ", tree.getSelectedLayers()));163 name.setText(wms.buildRootUrlWithoutCapabilities() + ": " + Utils.join(", ", tree.getSelectedLayers())); 164 164 } 165 165 showBounds.setEnabled(tree.getSelectedLayers().size() == 1); -
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r14411 r15209 45 45 public class WMSImagery { 46 46 47 private static final String CAPABILITIES_QUERY_STRING = "SERVICE=WMS&REQUEST=GetCapabilities"; 47 private static final String SERVICE_WMS = "SERVICE=WMS"; 48 private static final String REQUEST_GET_CAPABILITIES = "REQUEST=GetCapabilities"; 49 private static final String CAPABILITIES_QUERY_STRING = SERVICE_WMS + "&" + REQUEST_GET_CAPABILITIES; 48 50 49 51 /** … … 270 272 271 273 /** 274 * @return root URL of services without the GetCapabilities call 275 * @since 15209 276 */ 277 public String buildRootUrlWithoutCapabilities() { 278 return buildRootUrl() 279 .replace(CAPABILITIES_QUERY_STRING, "") 280 .replace(SERVICE_WMS, "") 281 .replace(REQUEST_GET_CAPABILITIES, "") 282 .replace("?&", "?"); 283 } 284 285 /** 272 286 * Returns URL for accessing GetMap service. String will contain following parameters: 273 287 * * {proj} - that needs to be replaced with projection (one of {@link #getServerProjections(List)}) … … 322 336 selectedLayers.size()); 323 337 324 return buildRootUrl() + "FORMAT=" + format + ((imageFormatHasTransparency(format) && transparent) ? "&TRANSPARENT=TRUE" : "") 325 + "&VERSION=" + this.version + "&SERVICE=WMS&REQUEST=GetMap&LAYERS=" 338 return buildRootUrlWithoutCapabilities() 339 + "FORMAT=" + format + ((imageFormatHasTransparency(format) && transparent) ? "&TRANSPARENT=TRUE" : "") 340 + "&VERSION=" + this.version + "&" + SERVICE_WMS + "&REQUEST=GetMap&LAYERS=" 326 341 + selectedLayers.stream().collect(Collectors.joining(",")) 327 342 + "&STYLES="
Note:
See TracChangeset
for help on using the changeset viewer.