[Mapbender-commits] r8822 - in trunk/mapbender: http/plugins lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed May 7 04:22:49 PDT 2014


Author: hwbllmnn
Date: 2014-05-07 04:22:49 -0700 (Wed, 07 May 2014)
New Revision: 8822

Modified:
   trunk/mapbender/http/plugins/kmlTree.js
   trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
Log:
only allow editing of one layer


Modified: trunk/mapbender/http/plugins/kmlTree.js
===================================================================
--- trunk/mapbender/http/plugins/kmlTree.js	2014-05-07 11:06:01 UTC (rev 8821)
+++ trunk/mapbender/http/plugins/kmlTree.js	2014-05-07 11:22:49 UTC (rev 8822)
@@ -57,9 +57,6 @@
     });
     $KMLfolder.find("a").after($addButton);
 
-
-
-
     o.$target.bind('kml:loaded',function(e,obj){
         //console.log(obj);
         var checked = obj.display ? 'checked="checked"':'';
@@ -162,7 +159,10 @@
         }
 
         $('button.digitize-layer', $kmlEntry).bind('click', function() {
-            $(this).toggleClass('active');
+            var active = $(this).toggleClass('active').hasClass('active');
+            if(active) {
+                $(this).parent().siblings().find('button.digitize-layer').removeClass('active');
+            }
         });
 
         $('#kmlTree > li > ul').sortable({

Modified: trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-05-07 11:06:01 UTC (rev 8821)
+++ trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-05-07 11:22:49 UTC (rev 8822)
@@ -176,6 +176,28 @@
             alert(message);
         });
 
+        var kmls = mb_getWmcExtensionData('KMLS');
+        // try{
+        if(kmls) {
+            kmls = JSON.parse(kmls);
+            this._kmls = kmls;
+            for(var k in kmls) {
+                kmls[k].loadedOnStartup = true;
+                self._convertFromJson(kmls[k]);
+                self.element.trigger('kml:loaded',kmls[k]);
+            }
+        }
+        kmls = mb_getWmcExtensionData('ORIGINALKMLS');
+        if(kmls) {
+            this.originalKmls = kmls;
+        }
+        kmls = mb_getWmcExtensionData('KMLORDER');
+        if(kmls) {
+            this.kmlOrder = JSON.parse(kmls);
+        }
+        // }catch(e){
+        //     console.log(e)
+        // }
     },
     _init: function(){
         var self = this, o = this.options;
@@ -272,28 +294,6 @@
                      self.element.trigger('kml:error',"Problem talking to server: " + errorThrown);
                  }
                });
-        var kmls = mb_getWmcExtensionData('KMLS');
-        // try{
-        if(kmls) {
-            kmls = JSON.parse(kmls);
-            this._kmls = kmls;
-            for(var k in kmls) {
-                kmls[k].loadedOnStartup = true;
-                self._convertFromJson(kmls[k]);
-                self.element.trigger('kml:loaded',kmls[k]);
-            }
-        }
-        kmls = mb_getWmcExtensionData('ORIGINALKMLS');
-        if(kmls) {
-            this.originalKmls = kmls;
-        }
-        kmls = mb_getWmcExtensionData('KMLORDER');
-        if(kmls) {
-            this.kmlOrder = JSON.parse(kmls);
-        }
-        // }catch(e){
-        //     console.log(e)
-        // }
     },
 
     reload: function() {



More information about the Mapbender_commits mailing list