Merge branch '2.12' of git://github.com/openlayers/openlayers

This commit is contained in:
Tim Schaub
2012-04-04 14:50:53 -10:00
6 changed files with 13 additions and 11 deletions

View File

@@ -173,11 +173,13 @@ OpenLayers.Control.CacheWrite = OpenLayers.Class(OpenLayers.Control, {
try {
var canvasContext = tile.getCanvasContext();
if (canvasContext) {
var urlMap = OpenLayers.Control.CacheWrite.urlMap;
var url = urlMap[tile.url] || tile.url;
window.localStorage.setItem(
"olCache_" + OpenLayers.Control.CacheWrite.urlMap[tile.url],
"olCache_" + url,
canvasContext.canvas.toDataURL(this.imageFormat)
);
delete OpenLayers.Control.CacheWrite.urlMap[tile.url];
delete urlMap[tile.url];
}
} catch(e) {
// local storage full or CORS violation