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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jul 2 07:53:47 PDT 2014


Author: hwbllmnn
Date: 2014-07-02 07:53:47 -0700 (Wed, 02 Jul 2014)
New Revision: 8980

Modified:
   trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
Log:
added bulk deletion for selected features


Modified: trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-07-02 14:50:24 UTC (rev 8979)
+++ trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-07-02 14:53:47 UTC (rev 8980)
@@ -291,6 +291,26 @@
                     });
                     dlg.dialog('close');
                 });
+                dlg.find('.digitize-remove').bind('click', function() {
+                    if(confirm('Do you really want to remove all these objects?')) {
+                        var urls = [];
+                        $.each(self.selectedFeatures, function(_, v) {
+                            if($.inArray(v.url, urls) == -1) {
+                                urls.push(v.url);
+                            }
+                            $('#kmlTree li[title="' + v.url + '"] li[idx="' + v.id + '"]').remove();
+                        });
+                        $.each(urls, function(_, url) {
+                            var ids = [];
+                            $('#kmlTree li[title="' + url + '"] li[idx]').each(function() {
+                                ids.push($(this).attr('idx'));
+                            });
+                            self.reorderFeatures(url, ids);
+                        });
+
+                        dlg.dialog('close');
+                    }
+                });
             }
         }
     },



More information about the Mapbender_commits mailing list