Register application listener after the control's

This commit is contained in:
ahocevar
2012-10-12 13:41:54 +02:00
parent 0b3f582e10
commit cf3ea0c7db

View File

@@ -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.";