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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 5 07:07:32 PDT 2014


Author: hwbllmnn
Date: 2014-08-05 07:07:32 -0700 (Tue, 05 Aug 2014)
New Revision: 9028

Modified:
   trunk/mapbender/http/plugins/mb_digitize_widget.php
Log:
activated export link, added delete button to edit dialog, removed add button from edit dialog


Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-08-05 13:50:13 UTC (rev 9027)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-08-05 14:07:32 UTC (rev 9028)
@@ -78,7 +78,8 @@
         '<span>my polygon</span><br></br>' +
         '<div class="digitize-image digitize-style"></div>' +
         '<div class="digitize-image digitize-attributes"></div>' +
-        '<div class="digitize-image digitize-add"></div>' +
+        // '<div class="digitize-image digitize-add"></div>' +
+        '<div class="digitize-image digitize-remove"></div>' +
         '<div class="digitize-image digitize-pencil"></div>' +
         '<fieldset class="fieldset-auto-width digitize-hidden">' +
         '<div class="digitize-image digitize-move"></div>' +
@@ -133,7 +134,7 @@
     var geomMenu = '<ul class="digitize-contextmenu">' +
         '<li><div class="digitize-image digitize-pencil"></div>Edit</li>' +
         '<li><div class="digitize-image digitize-zoomto"></div>Zoom to</li>' +
-        '<li><div class="digitize-image digitize-add"></div>New</li>' +
+        // '<li><div class="digitize-image digitize-add"></div>New</li>' +
         '<li><div class="digitize-image digitize-export"></div>Export</li>' +
         '<li><div class="digitize-image digitize-remove"></div>Delete</li>' +
         '<li><div class="digitize-image digitize-style"></div>Styling</li>' +
@@ -590,9 +591,27 @@
             editDialog.find('span').text(feature.properties.title);
             editDialog.dialog('open');
             editDialog.find('.digitize-attributes').bind('click', editAttributes(feature, kml, url));
+            editDialog.find('.digitize-export').bind('click', function() {
+                exportItem(feature);
+            });
             editDialog.find('.digitize-pencil').bind('click', function() {
                 $(this).next().toggleClass('digitize-hidden');
             });
+            editDialog.find('.digitize-remove').bind('click', function() {
+                if(confirm('Do you really want to delete this feature? If you have no other copy all information will be lost. There is no backup option!')) {
+                    var kml = $('#mapframe1').data('kml');
+                    var url = $link.parent().parent().attr('title');
+                    var ids = [];
+                    var i = 0;
+                    $.each($link.siblings(), function(k, v) {
+                        ids.push($(v).attr('idx'));
+                        $(v).attr('idx', i++);
+                    });
+                    $link.remove();
+                    kml.reorderFeatures(url, ids);
+                    editDialog.dialog('close');
+                }
+            });
 
             status = 'edit-' + feature.geometry.type.toLowerCase();
             if(status === 'edit-linestring') {



More information about the Mapbender_commits mailing list