OpenLayers. Control. CacheWrite

A control for caching image tiles in the browser’s local storage.  The OpenLayers.Control.CacheRead control is used to fetch and use the cached tile images.

Note: Before using this control on any layer that is not your own, make sure that the terms of service of the tile provider allow local storage of tiles.

Inherits from

Summary
OpenLayers. Control. CacheWrite A control for caching image tiles in the browser’s local storage.
Properties
events {OpenLayers.Events} Events instance for listeners and triggering control specific events.
eventListeners {Object} Object with event listeners, keyed by event name.
layers {Array(OpenLayers.Layer.Grid)}.
imageFormat {String} The image format used for caching.
Constructor
OpenLayers. Control. CacheWrite
Functions
OpenLayers. Control. CacheWrite. clearCache Clears all tiles cached with OpenLayers.Control.CacheWrite from the cache.

Properties

events

{OpenLayers.Events} Events instance for listeners and triggering control specific events.

To register events in the constructor, configure eventListeners.

Register a listener for a particular event with the following syntax

control.events.register(type, obj, listener);

Supported event types (in addition to those from OpenLayers.Control.events)

cachefull Triggered when the cache is full.  Listeners receive an object with a tile property as first argument.  The tile references the tile that couldn’t be cached.

eventListeners

{Object} Object with event listeners, keyed by event name.  An optional scope property defines the scope that listeners will be executed in.

layers

{Array(OpenLayers.Layer.Grid)}.  Optional.  If provided, caching will be enabled for these layers only, otherwise for all cacheable layers.

imageFormat

{String} The image format used for caching.  The default is “image/png”.  Supported formats depend on the user agent.  If an unsupported imageFormat is provided, “image/png” will be used.  For aerial imagery, “image/jpeg” is recommended.

Constructor

OpenLayers. Control. CacheWrite

Parameters

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

Functions

OpenLayers. Control. CacheWrite. clearCache

OpenLayers.Control.CacheWrite.clearCache = function()

Clears all tiles cached with OpenLayers.Control.CacheWrite from the cache.

OpenLayers.Control.CacheWrite.clearCache = function()
Clears all tiles cached with OpenLayers.Control.CacheWrite from the cache.
A control for using image tiles cached with OpenLayers.Control.CacheWrite from the browser’s local storage.
Controls affect the display or behavior of the map.
{Object} Object with event listeners, keyed by event name.
{OpenLayers.Events} Events instance for listeners and triggering control specific events.
{String} The image format used for caching.
Close