Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Commit

Permalink
Merge pull request geonetwork#4 from pgiraud/context_save_map_not_init
Browse files Browse the repository at this point in the history
Don't save a map if map is not already rendered
  • Loading branch information
fgravin committed Oct 31, 2014
2 parents b01fb62 + 8938198 commit 28689cb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 28689cb

Please sign in to comment.