# OpenLayers.Control.CacheRead

A control for using image tiles cached with OpenLayers.Control.CacheWrite from the browser’s local storage.

#### Inherits from

- OpenLayers.Control

Summary

OpenLayers.Control.CacheRead | A control for using image tiles cached with OpenLayers.Control.CacheWrite from the browser’s local storage.
Properties |
fetchEvent | {String} The layer event to listen to for replacing remote resource tile URLs with cached data URIs.
layers | {Array(OpenLayers.Layer.Grid)}.
autoActivate | {Boolean} Activate the control when it is added to a map.
Constructor |
OpenLayers.Control.CacheRead |

### Properties

### fetchEvent

{String} The layer event to listen to for replacing remote resource tile URLs with cached data URIs. Supported values are “tileerror” (try remote first, fall back to cached) and “tileloadstart” (try cache first, fall back to remote). Default is “tileloadstart”.

Note that “tileerror” will not work for CORS enabled images OpenLayers.Tile.Image.crossOriginKeyword in OpenLayers.Layer.Grid.tileOptions.

### layers

{Array(OpenLayers.Layer.Grid)}. Optional. If provided, only these layers will receive tiles from the cache.

### autoActivate

{Boolean} Activate the control when it is added to a map. Default is true.

### Constructor

### OpenLayers.Control.CacheRead

#### Parameters

options | {Object} Object with API properties for this control

A control for caching image tiles in the browser’s local storage.
Controls affect the display or behavior of the map.
The value of the crossorigin keyword to use when loading images.
{Object} optional configuration options for OpenLayers.Tile instances created by this Layer, if supported by the tile class.
Close