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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jul 1 07:35:14 PDT 2014


Author: hwbllmnn
Date: 2014-07-01 07:35:14 -0700 (Tue, 01 Jul 2014)
New Revision: 8965

Modified:
   trunk/mapbender/http/plugins/kmlTree.js
   trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
Log:
re-added selecting of features, single item for now


Modified: trunk/mapbender/http/plugins/kmlTree.js
===================================================================
--- trunk/mapbender/http/plugins/kmlTree.js	2014-07-01 14:30:33 UTC (rev 8964)
+++ trunk/mapbender/http/plugins/kmlTree.js	2014-07-01 14:35:14 UTC (rev 8965)
@@ -192,7 +192,7 @@
     selectButton.bind('click', function() {
         var kml = $('#mapframe1').data('kml');
         if(kml.getQueriedLayer) {
-            kml.setQueriedLayer = false;
+            kml.setQueriedLayer(false);
         } else {
             kml.setQueriedLayer(true);
         }

Modified: trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-07-01 14:30:33 UTC (rev 8964)
+++ trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-07-01 14:35:14 UTC (rev 8965)
@@ -60,10 +60,9 @@
             var clickPoint =  map.convertPixelToReal(new Point(pos.x,pos.y));
             var wgspt = Proj4js.transform(self.targetProj, self.wgs84, {x: clickPoint.x, y: clickPoint.y});
             var res = map.getScale() / mb_resolution / 100;
-            var itm = self._kmls[self.queriedLayer];
-            if(!itm) return;
 
-            var matched = [];
+            if(!self.queriedLayer) return;
+
             var matchedIds = [];
 
             $.each(self._kmls, function(_, itm) {
@@ -75,21 +74,19 @@
                         var maxx = minx + 40 * res;
                         var maxy = miny + 40 * res;
                         if(minx < clickPoint.x && maxx > clickPoint.x && miny < clickPoint.y && maxy > clickPoint.y) {
-                            matched.push(v);
-                            matchedIds.push(k);
+                            matchedIds.push({url: itm.url, id: k});
                         }
                     } else {
                         var box = self.getBbox(v);
                         if(box[0] < wgspt.x && box[2] > wgspt.x && box[1] < wgspt.y && box[3] > wgspt.y) {
-                            matched.push(v);
-                            matchedIds.push(k);
+                            matchedIds.push({url: itm.url, id: k});
                         }
                     }
                 });
             });
 
             if(matchedIds.length > 0) {
-                $('li[title="' + self.queriedLayer + '"] li[idx="' + matchedIds[0] + '"]').click();
+                $('li[title="' + matchedIds[0].url + '"] li[idx="' + matchedIds[0].id + '"]').click();
             }
         });
         self.element.bind('kml:loaded',function(event,obj){



More information about the Mapbender_commits mailing list