I am having some issues with getting an image/png format from an ArcGIS Server. The console returns:

Resource interpreted as Image but transferred with MIME type application/vnd.ogc.se_xml:     "http://meshekgis.com/ArcGIS/services/mustang/Mustang_Map/mapserver/WMSServe…3A900913&BBOX=15028131.255,-5009377.085,20037508.34,0&WIDTH=256&HEIGHT=256". 

Here is the JavaScript I am using:

var arcserver_wms =   "http://myserver.com/ArcGIS/services/mustang/Mustang_Map/mapserver/WMSServer";

var arcserver_wms = new OpenLayers.Layer.WMS("ArcServer WMS", arcserver_wms, 
                       FORMAT: "image/png-8"
                        isBaseLayer: false,
                        opacity: 0.5

You are getting an error message from the server back in XML. You can view the message by extracting a tile url being sent to the server. This is easy to do in IE - just right-click on the map and copy the image url. Otherwise use Firebug or the debug tools in Chrome to extract the URL. Then just paste it into the browser directly.

I'm not sure why you are using a WMS layer type for ArcGIS. Have you tried using the ArcGIS93Rest layer type? Here's an example showing Singapore:

var ags_map_service = new OpenLayers.Layer.ArcGIS93Rest(
                        LAYERS: 'all:0',
                        IMAGESR: '3414',
                        BBOXSR: '3414',
                        FORMAT: 'jpg',
                        TRANSPARENT: false
                        isBaseLayer: true,
                        'attribution': 'Provided by <a href="http://www.onemap.sg/">OneMap</a>',
                        units: 'm',
                        maxExtent: new OpenLayers.Bounds(0, 14482.03459, 54313.2955286349, 60381.0195956435)

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.