Register application listener after the control's
This commit is contained in:
@@ -8,13 +8,10 @@ function init() {
|
||||
div: "map",
|
||||
projection: "EPSG:900913",
|
||||
layers: [
|
||||
new OpenLayers.Layer.WMS("OSGeo", "http://vmap0.tiles.osgeo.org/wms/vmap0", {
|
||||
layers: "basic"
|
||||
}, {
|
||||
eventListeners: {
|
||||
tileloaded: updateStatus
|
||||
}
|
||||
})
|
||||
new OpenLayers.Layer.WMS(
|
||||
"OSGeo", "http://vmap0.tiles.osgeo.org/wms/vmap0",
|
||||
{layers: "basic"}
|
||||
)
|
||||
],
|
||||
center: [0, 0],
|
||||
zoom: 1
|
||||
@@ -38,6 +35,7 @@ function init() {
|
||||
};
|
||||
|
||||
// update the number of cached tiles and detect local storage support
|
||||
map.layers[0].events.on({'tileloaded': updateStatus});
|
||||
function updateStatus() {
|
||||
if (window.localStorage) {
|
||||
status.innerHTML = localStorage.length + " entries in cache.";
|
||||
|
||||
Reference in New Issue
Block a user