[Mapbender-commits] r8831 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu May 8 07:31:32 PDT 2014


Author: hwbllmnn
Date: 2014-05-08 07:31:32 -0700 (Thu, 08 May 2014)
New Revision: 8831

Modified:
   trunk/mapbender/http/plugins/kmlTree.js
   trunk/mapbender/http/plugins/mb_digitize_widget.php
Log:
implemented digitized features zoomto


Modified: trunk/mapbender/http/plugins/kmlTree.js
===================================================================
--- trunk/mapbender/http/plugins/kmlTree.js	2014-05-08 14:13:01 UTC (rev 8830)
+++ trunk/mapbender/http/plugins/kmlTree.js	2014-05-08 14:31:32 UTC (rev 8831)
@@ -61,7 +61,6 @@
         //console.log(obj);
         var checked = obj.display ? 'checked="checked"':'';
 
-
         title = obj.url;
         if(obj.refreshing) {
             $KMLfolder.find('ul li[title="' + title + '"]').remove();
@@ -80,7 +79,6 @@
                                                                               bbox[0] = bbox[0].minus(buffer);
                                                                               bbox[1] = bbox[1].plus(buffer);
 
-
                                                                               map.calculateExtent(
                                                                                   new Mapbender.Extent(bbox[0], bbox[1])
                                                                               );

Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-05-08 14:13:01 UTC (rev 8830)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-05-08 14:31:32 UTC (rev 8831)
@@ -170,23 +170,33 @@
         $('#mapframe1').bind('kml:loaded', function(evt, item) {
             var url = item.url;
             $('li[title="' + url + '"] > a').live('contextmenu', function() {
+                var $link = $(this);
                 var menu = $(folderMenu);
                 $(document.body).append(menu);
-                var pos = $(this).offset();
+                var pos = $link.offset();
                 menu.css({position: 'absolute', top: pos.top, left: pos.left}).menu()
                     .children().addClass('ui-menu-item')
                     .hover(function() {$(this).addClass('ui-state-hover'); },
                           function() {$(this).removeClass('ui-state-hover'); });
+                menu.children('li:has(.digitize-zoomto)').bind('click', function() {
+                    $link.click();
+                    menu.menu('destroy').remove();
+                });
                 return false;
             });
             $('li[title="' + url + '"] > ul > li').live('contextmenu', function() {
+                var $link = $(this);
                 var menu = $(geomMenu);
                 $(document.body).append(menu);
-                var pos = $(this).offset();
+                var pos = $link.offset();
                 menu.css({position: 'absolute', top: pos.top, left: pos.left}).menu()
                     .children().addClass('ui-menu-item')
                     .hover(function() {$(this).addClass('ui-state-hover'); },
                           function() {$(this).removeClass('ui-state-hover'); });
+                menu.children('li:has(.digitize-zoomto)').bind('click', function() {
+                    $link.click();
+                    menu.menu('destroy').remove();
+                });
                 return false;
             });
         });



More information about the Mapbender_commits mailing list