0

I added a WMS layer

var wmslayer = new OpenLayers.Layer.WMS("Cities",{http://someip.com/ArcGIS/services/BurkeMcDowell2013_06_26FORGOPI/MapServer/WMSServer?request=GetCapabilities&service=WMS", { transparent: true },{isBaseLayer: false});}

And the URL which OpenLayers generated and call is:

{someip.com/ArcGIS/services/BurkeMcDowell2013_06_26FORGOPI/MapServer/WMSServer?request=GetCapabilities&service=WMS&SRS=EPSG%3A900913&TRANSPARENT=TRUE&VERSION=1.1.1&STYLES=&FORMAT=image%2Fpng&BBOX=-10018754.17,2504688.5425,-7514065.6275,5009377.085&WIDTH=256&HEIGHT=256}

But it's not returning images but a message in console:

Resource interpreted as Image but transferred with MIME type application/vnd.ogc.wms_xml: http://someip.com/ArcGIS/services/BurkeMcDowell2013_06_26FORGOPI/MapSe
X=-10018754.17,009377.085,-7514065.6275,7514065.6275&WIDTH=256&HEIGHT=256". OpenLayers.js:460)
OpenLayers.Tile.Image.OpenLayers.Class.setImgSrc OpenLayers.js:460
OpenLayers.Tile.Image.OpenLayers.Class.initImage OpenLayers.js:460
OpenLayers.Tile.Image.OpenLayers.Class.renderTile OpenLayers.js:456
OpenLayers.Tile.Image.OpenLayers.Class.draw OpenLayers.js:456
OpenLayers.Layer.Grid.OpenLayers.Class.initGriddedTiles 
OpenLayers.js:480
OpenLayers.Layer.Grid.OpenLayers.Class.moveTo OpenLayers.js:469
OpenLayers.Layer.OpenLayers.Class.redraw OpenLayers.js:265
OpenLayers.Layer.HTTPRequest.OpenLayers.Class.redraw 
OpenLayers.js:451
OpenLayers.Map.OpenLayers.Class.addLayer OpenLayers.js:230
Objs.adddlayer CreateMapMediator.js:1531
f.event.dispatch jquery-1.7.2.min.js:3
h.handle.i

Can anyone help me solve it? (I added someip.com coz I can't add a numeric IP there)

2
  • Which is the response returned from server? (not the console message) – EricSonaron Jun 28 '13 at 18:19
  • Get response from server as XML(its not added in the question). I think we get the correct response. but the its not showing in the map – Mufeed K Kasim Jun 28 '13 at 18:29
1

The answer is in the question! The request you included in your question is a GetCapabilities request. This returns an XML response detailing which layers and coordinate systems are available in your service. A WMS client would use this information to then construct a GetMap request, providing arguments including layer IDs (or names), a bounding box, optional styling information etc.

I suggest you look for an introduction to the basic concepts of WMS online (and I don't mean the OGC spec). You would also benefit from looking at the request structure in one of the OpenLayers WMS demo applications.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.