From cf3ea0c7db02a0b4a94827f73f4c055564b3eea4 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Fri, 12 Oct 2012 13:41:54 +0200 Subject: [PATCH] Register application listener after the control's --- examples/cache-write.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/cache-write.js b/examples/cache-write.js index 8f4ec9e081..e9db31a326 100644 --- a/examples/cache-write.js +++ b/examples/cache-write.js @@ -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.";