There were a couple of Issues that need to be tackled, before we use the ArcGIS Server's WMS service on top of OpenStreetMaps.
- We need to call the WMS service in OSM's projection, i.e. EPSG:3857
- We need to make sure that the WMS service is transparent. This was done by using layer options, where we requested images in png format, and with a transparent=true option.
I can use the following code to show he given WMS service on top of OSM layer:
<!DOCTYPE html>
<html>
<head>
<title>OpenLayers Map</title>
<link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="http://openlayers.org/dev/examples/style.css" type="text/css">
<script src="http://openlayers.org/dev/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
map = new OpenLayers.Map('map', {projection: new OpenLayers.Projection("EPSG:3857")});
layer = new OpenLayers.Layer.OSM( "Simple OSM Map");
map.addLayer(layer);
var wmsLayer = new OpenLayers.Layer.WMS( "ArcGIS WMS",
"http://www.webatlasde.de/ArcGIS/services/Maps4BW/MapServer/WMSServer",
{layers: 'Halbtonvariante', FORMAT:"image/png", transparent:"TRUE"},
{isBaseLayer: false});
map.addLayer(wmsLayer);
map.zoomToExtent([807292,6012131,1249140,6277886], true);
}
</script>
<style>
#map{
width:650px;
height:400px;
}
</style>
</head>
<body onload="init()">
<div id="map" ></div>
</body>
</html>
Your piece of code seems to be good in theory. As I used arcGIS/Leaflet in exactly the same way.
But the problem could come from missing spatial reference (or maybe incorrect format (image/png or image/jpeg).
For the spatial reference, here is how Leaflet works :
- Leaflet expects default spatial reference : EPSG:3857 / WGS84
- But you can change it by an other one with JS plugin like Proj4leaflet by Kartena.
It's really easy and helpful. Works like this (for EPSG:3006) :
You define your new crs
// SWEREF99 TM (EPSG:3006) with map's pixel origin at SWEREF99 TM coordinate (0, 0)
var crs = new L.Proj.CRS('EPSG:3006',
'+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
{
resolutions: [
8192, 4096, 2048, 1024, 512, 256, 128
],
origin: [0, 0]
})
And include it in your map :
var map = new L.Map('map', {
crs: crs
});
You can find Spatial References here.
Best Answer
It appears that the service doesn't allow GetCapabilities requests. So QGIS doesn't know how to construct a query
https://gisservices.information.qld.gov.au/arcgis/services/Imagery/QldBase_AllUsers/ImageServer/WMSServer?service=WMS&request=GetCapabilities&
Gives:
It appears that the URL has changed, the WMS is now at: