summaryrefslogtreecommitdiff
path: root/gui.js
diff options
context:
space:
mode:
Diffstat (limited to 'gui.js')
-rw-r--r--gui.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/gui.js b/gui.js
index 875a3d2..a914f08 100644
--- a/gui.js
+++ b/gui.js
@@ -212,9 +212,6 @@ IDE_Morph.prototype.init = function (isAutoFill) {
this.globalVariables = new VariableFrame();
- // recreate all Sprite markers (Snap-YOW)
- window.spriteGroup = L.layerGroup().addTo(window.map);
-
this.currentSprite = new SpriteMorph(this.globalVariables);
this.sprites = new List([this.currentSprite]);
this.currentCategory = 'map';
@@ -2803,7 +2800,9 @@ IDE_Morph.prototype.newProject = function () {
this.globalVariables = new VariableFrame();
// recreate all Sprite markers (Snap-YOW)
- window.map.removeLayer(window.spriteGroup);
+ if (window.map.hasLayer(window.spriteGroup)) {
+ window.map.removeLayer(window.spriteGroup);
+ }
window.spriteGroup = L.layerGroup().addTo(window.map);
this.currentSprite = new SpriteMorph(this.globalVariables);