A control for using image tiles cached with ALKMaps.Control.CacheWrite from the browser’s local storage.
ALKMaps. | A control for using image tiles cached with ALKMaps.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(ALKMaps.Layer.Grid)}. |
autoActivate | {Boolean} Activate the control when it is added to a map. |
Constructor | |
ALKMaps. | |
Functions | |
setMap | Set the map property for the control. |
addLayer | Adds a layer to the control. |
removeLayer | Removes a layer from the control. |
fetch | Listener to the fetchEvent event. |
destroy | The destroy method is used to perform any clean up before the control is dereferenced. |
{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 ALKMaps.Tile.Image.crossOriginKeyword in ALKMaps.Layer.Grid.tileOptions.
{Array(ALKMaps.Layer.Grid)}. Optional. If provided, only these layers will receive tiles from the cache.
addLayer: function( evt )
Adds a layer to the control. Once added, tiles requested for this layer will be cached.
evt | {Object} Object with a layer property referencing an ALKMaps.Layer instance |
removeLayer: function( evt )
Removes a layer from the control. Once removed, tiles requested for this layer will no longer be cached.
evt | {Object} Object with a layer property referencing an ALKMaps.Layer instance |
fetch: function( evt )
Listener to the fetchEvent event. Replaces a tile’s url with a data URI from the cache.
evt | {Object} Event object with a tile property. |
Set the map property for the control.
setMap: function( map )
Adds a layer to the control.
addLayer: function( evt )
Removes a layer from the control.
removeLayer: function( evt )
Listener to the fetchEvent event.
fetch: function( evt )
The destroy method is used to perform any clean up before the control is dereferenced.
destroy: function()