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.
OpenLayers.
|
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.
|
|
Functions | |
OpenLayers.
|
Clears all tiles cached with OpenLayers.Control.CacheWrite from the cache. |
{OpenLayers.Events} Events instance for listeners and triggering control specific events.
To register events in the constructor, configure eventListeners.
control.events.register(type, obj, listener);
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. |
{Array(OpenLayers.Layer.Grid)}. Optional. If provided, caching will be enabled for these layers only, otherwise for all cacheable layers.
{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.
OpenLayers.Control.CacheWrite.clearCache = function()
Clears all tiles cached with OpenLayers.Control.CacheWrite from the cache.
Clears all tiles cached with OpenLayers.Control.CacheWrite from the cache.
OpenLayers.Control.CacheWrite.clearCache = function()