0

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.

Paul Meems
  • 3,002
  • 4
  • 35
  • 66
  • Are you sure tiles from the server are 512x512 pixels? Pixelation of layer might mean that you're stretching the tile images. Also: you might stretch out tiles from wrong zoom level. – mrówa Apr 26 '13 at 13:20
  • I've deleted all images that were in the arcgiscache folder and restarted the ArcGIS server and now it is working OK. I'm not sure what I've changed but I was fiddling with the tile settings of the map service. In fact I couldn't change them so I needed to delete the map service and start over. So OpenLayers is working OK, it was ArcGIS Server that was acting weird ;) – Paul Meems May 02 '13 at 06:37

0 Answers0