From 893819818390bd7880d35a397dd28af666fe46e7 Mon Sep 17 00:00:00 2001 From: Pierre GIRAUD Date: Fri, 31 Oct 2014 12:31:32 +0100 Subject: [PATCH] Don't save a map if map is not already rendered --- .../catalog/components/viewer/owscontext/OwsContextService.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js b/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js index d35c9317dd3..8a5a0579104 100644 --- a/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js +++ b/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js @@ -215,6 +215,10 @@ * Saves the map context to local storage */ this.saveToLocalStorage = function(map) { + if (map.getSize()[0] == 0 || map.getSize()[1] == 0){ + // don't save a map which has not been rendered yet + return; + } var xml = this.writeContext(map); var xmlString = (new XMLSerializer()).serializeToString(xml); window.localStorage.setItem("owsContext", xmlString);