diff --git a/lib/OpenLayers/Control/CacheRead.js b/lib/OpenLayers/Control/CacheRead.js index 554a6aee3c..6f44c7bbab 100644 --- a/lib/OpenLayers/Control/CacheRead.js +++ b/lib/OpenLayers/Control/CacheRead.js @@ -113,10 +113,9 @@ OpenLayers.Control.CacheRead = OpenLayers.Class(OpenLayers.Control, { var tile = evt.tile, dataURI = window.localStorage.getItem("olCache_" + tile.url); if (dataURI) { + tile.url = dataURI; if (evt.type === "tileerror") { tile.setImgSrc(dataURI); - } else { - tile.url = dataURI; } } }