[Mapbender-commits] r8825 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed May 7 07:58:28 PDT 2014


Author: hwbllmnn
Date: 2014-05-07 07:58:28 -0700 (Wed, 07 May 2014)
New Revision: 8825

Modified:
   trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
Log:
fixed a couple of unnecessary map reloads


Modified: trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-05-07 13:53:20 UTC (rev 8824)
+++ trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-05-07 14:58:28 UTC (rev 8825)
@@ -221,7 +221,6 @@
         for(var i in itm.highlightArray){
             itm.highlightArray[i].hide();
         }
-        $map.setMapRequest();
 
         var h = new Highlight([self.element.attr('id')], "mapframe1_" + parseInt(Math.random()*100000,10),{
             "position":"absolute",
@@ -252,6 +251,7 @@
         itm.data.features.push(JSON.parse(multi.toString()));
         this._convertFromJson(itm);
         this.element.trigger('kml:loaded',{type:"geojson",data:itm.data,url:itm.url,display: itm.display, refreshing: true});
+        $map.setMapRequest();
     },
 
     _load : function(url){
@@ -304,6 +304,7 @@
         $.each(self.kmlOrder, function(k, url) {
             var o = self._kmls[url];
             if(!o) return;
+            // TODO prevent map reload at this point
             $('li[title="' + url + '"] > button[name="remove"]').click();
             $.ajax({ url: self._endpointURL + '?targetEPSG= ' + epsg,
                      data: self.originalKmls[url],
@@ -340,6 +341,8 @@
         });
         itm.data.features = list;
         this._convertFromJson(itm);
+        var $map = $(this.element).mapbender();
+        $map.setMapRequest();
     },
 
     show : function(url){
@@ -388,7 +391,6 @@
             if(h) h();
         }
 
-
         mapitem.geomArray = new GeometryArray();
         mapitem.highlightArray = [];
         mapitem.geomArray.importGeoJSON(geojson);
@@ -450,7 +452,6 @@
                 new Mapbender.Extent(bbox[0], bbox[1])
             );
         }
-        $map.setMapRequest();
     },
 
     _display : function(mapitem){



More information about the Mapbender_commits mailing list