Skip to content
This repository
Browse code

Avoid undefined url.

  • Loading branch information...
commit 2582e762b7142f9cd92706e1a67676878c6dbe84 1 parent 5c597de
Tim Schaub tschaub authored

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. +4 2 lib/OpenLayers/Control/CacheWrite.js
6 lib/OpenLayers/Control/CacheWrite.js
@@ -173,11 +173,13 @@ OpenLayers.Control.CacheWrite = OpenLayers.Class(OpenLayers.Control, {
173 173 try {
174 174 var canvasContext = tile.getCanvasContext();
175 175 if (canvasContext) {
  176 + var urlMap = OpenLayers.Control.CacheWrite.urlMap;
  177 + var url = urlMap[tile.url] || tile.url;
176 178 window.localStorage.setItem(
177   - "olCache_" + OpenLayers.Control.CacheWrite.urlMap[tile.url],
  179 + "olCache_" + url,
178 180 canvasContext.canvas.toDataURL(this.imageFormat)
179 181 );
180   - delete OpenLayers.Control.CacheWrite.urlMap[tile.url];
  182 + delete urlMap[tile.url];
181 183 }
182 184 } catch(e) {
183 185 // local storage full or CORS violation

0 comments on commit 2582e76

Please sign in to comment.
Something went wrong with that request. Please try again.