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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon May 12 06:52:47 PDT 2014


Author: hwbllmnn
Date: 2014-05-12 06:52:47 -0700 (Mon, 12 May 2014)
New Revision: 8848

Modified:
   trunk/mapbender/http/plugins/mb_digitize_widget.php
   trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
Log:
save features with attributes using attribute dialog


Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-05-12 13:40:58 UTC (rev 8847)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-05-12 13:52:47 UTC (rev 8848)
@@ -98,7 +98,8 @@
     var editAttributesHtml = '<div title="Feature attributes">' +
         '<div class="digitize-image digitize-style"></div>' +
         '<div class="digitize-image digitize-polygon"></div><br></br>' +
-        '<table><tr><th>Name</th><th>Titel</th></tr>' +
+        '<table><tr><td>Name</td><td><input type="text" name="name" value="Titel"></input></td></tr>' +
+        '<tr><td>Description</td><td><input type="text" name="description" value="Beschreibung CDATA"></input></td></tr>' +
         '</table><br></br>' +
         '<div class="digitize-image digitize-add"></div>' +
         '<div class="digitize-image digitize-save"></div>' +
@@ -282,12 +283,19 @@
     var finishDigitize = function () {
         inProgress = false;
         that.deactivate();
-        // TODO experimental
+        status = 'none';
+
         var kml = $('#mapframe1').data('kml');
         if(kml) {
             var digit = o.$target.data('mb_digitize');
             var pts = digit._digitizePoints;
-            kml.addGeometry(pts, digitizingFor);
+
+            attributesDialog.dialog('open');
+            attributesDialog.find('.digitize-save').bind('click', function() {
+                kml.addGeometry(pts, digitizingFor, attributesDialog);
+                attributesDialog.dialog('close');
+                attributesDialog.find('.digitize-save').unbind('click');
+            });
         }
     };
 

Modified: trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-05-12 13:40:58 UTC (rev 8847)
+++ trunk/mapbender/lib/mb.ui.displayKmlFeatures.js	2014-05-12 13:52:47 UTC (rev 8848)
@@ -234,7 +234,7 @@
         this._kmls[url].data.features[idx].display = false;
     },
 
-    addGeometry: function(pts, url) {
+    addGeometry: function(pts, url, attributesDialog) {
         var $map = $(this.element).mapbender();
         var self = this;
         var tp = pts.closedPolygon ? geomType.polygon : (pts.closedLine ? geomType.line : geomType.point);
@@ -262,6 +262,9 @@
         var icon = multi.e.getElementValueByName("Mapbender:icon");
         multi.e.setElement('title', 'title');
         multi.e.setElement('name', 'name');
+        attributesDialog.find('table input').each(function() {
+            multi.e.setElement($(this).attr('name'), $(this).val());
+        });
 
         if(icon == "false" || icon === false){
             multi.e.setElement("Mapbender:iconOffsetX", -10);



More information about the Mapbender_commits mailing list