]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/browse/start.rjs
Destroy OL objects which use the dataLayer before we destroy the layer
[rails.git] / app / views / browse / start.rjs
index f38b1dc80937cb0c9f6355236fd87a2b50b01e49..8c8d622606c71910156540a8c01cd1f1de3c5afc 100644 (file)
@@ -50,11 +50,6 @@ page << <<EOJ
     if (browseActive) {
       browseActive = false;
 
-      if (browseDataLayer) {
-        browseDataLayer.destroy();
-        browseDataLayer = null; 
-      } 
-
       if (browseSelectControl) {   
         browseSelectControl.destroy();  
         browseSelectControl = null;
@@ -70,6 +65,11 @@ page << <<EOJ
         browseActiveFeature = null; 
       }
 
+      if (browseDataLayer) {
+        browseDataLayer.destroy();
+        browseDataLayer = null; 
+      } 
+
       map.dataLayer.setVisibility(false);
       map.events.unregister("moveend", map, showData);
     }