# OpenLayers ArcGIS Cache Example (MapServer Access)

arcgis, arcgiscache, cache, tms

Demonstrates the basic initialization of the ArcGIS Cache layer using a prebuilt configuration, and standard tile access.

This example demonstrates using the ArcGISCache layer for accessing ESRI's ArcGIS Server (AGS) Map Cache tiles through an AGS MapServer. Toggle the visibility of the AGS layer to demonstrate how the two maps are lined up correctly.

## Notes on this layer

A few attempts have been made at this kind of layer before. See here and here. A problem the users encounter is that the tiles seem to "jump around". This is due to the fact that the max extent for the cached layer actually changes at each zoom level due to the way these caches are constructed. We have attempted to use the resolutions, tile size, and tile origin from the cache meta data to make the appropriate changes to the max extent of the tile to compensate for this behavior.

You will need to know:

- Max Extent: The max extent of the layer
- Resolutions: An array of resolutions, one for each zoom level
- Tile Origin: The location of the tile origin for the cache in the upper left.
- Tile Size: The size of each tile in the cache. Commonly 256 x 256

It's important that you set the correct values in your layer, and these values will differ from layer to layer. You can find these values for your layer in a metadata page in ArcGIS Server. (ie. http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer)

- Max Extent: Full Extent
- Resolutions: Tile Info -> Levels of Detail -> Resolution
- Tile Origin: Origin -> X,Y
- Tile Size: Tile Info -> Height,Width

## Other Examples

This is one of three examples for this layer. You can also configure this layer to use prebuilt tiles in a file store (not a live server). It is also possible to let this layer 'auto-configure' itself using the capabilities json object from the server itself when using a live ArcGIS server.