I have a local ArcGIS server 9.3.1. I've enabled WMS and caching (tiling). I want to show the tiles using OpenLayers, since ArcMap can't open its own REST services ;(
Using OpenLayers this works great, except the tiles are in bad quality. The aerial photo base layer (jpeg) is very pixelated and the overlay is also bad, png8.
When I look in the tiling folder on the server I see the images are OK, so something goes wrong when OpenLayers opens them.
Here's my code:
var mapOptions = {
projection: new OpenLayers.Projection('EPSG:28992'),
resolutions: [3440.64, 1720.32, 860.16, 430.08, 215.04, 107.52, 53.76, 26.88, 13.44, 6.72, 3.36, 1.68, 0.84, 0.42, 0.21, 0.105, 0.0525],
div: "map",
maxExtent: new OpenLayers.Bounds(634.5732789819,306592.8911594,1762242.253279,2068200.5711594),
units: "m",
numZoomLevels: 17,
tileSize: new OpenLayers.Size(512,512),
controls: []};
var map = new OpenLayers.Map('map', mapOptions);
var aerial= new OpenLayers.Layer.ArcGIS93Rest("aerial",
"http://myServer/arcgis/rest/services/myMap/MapServer/export",
{layers: "show:0",
type: "jpg",
useScales: true,
useAGS: true,
transparent: false
},
{ tileSize: new OpenLayers.Size(512,512),
buffer: 2,
visibility: false,
isBaseLayer: true,
transitionEffect: 'resize'
}
);
var tiled = new OpenLayers.Layer.ArcGIS93Rest(Tiled",
"http://myServer/arcgis/rest/services/MyMap/MapServer/export",
{layers: "show:56",
type: "png8",
useScales: true,
useAGS: true,
transparent: true
},
{ tileSize: new OpenLayers.Size(512,512),
buffer: 0,
visibility: false,
isBaseLayer: false,
transitionEffect: 'resize'
}
);
The bounds and resolution come from the layers. Does anybody have a suggestion how to show the tiled WMS layer from ArcGIS in OpenLayers?
Thanks.