[Mapbender-commits] r8853 - in trunk/mapbender: http/plugins lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue May 13 02:38:04 PDT 2014
Author: hwbllmnn
Date: 2014-05-13 02:38:04 -0700 (Tue, 13 May 2014)
New Revision: 8853
Modified:
trunk/mapbender/http/plugins/mb_digitize_widget.php
trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
Log:
allow adding of attributes when saving new features
Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-05-13 09:13:45 UTC (rev 8852)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-05-13 09:38:04 UTC (rev 8853)
@@ -329,7 +329,15 @@
var digit = o.$target.data('mb_digitize');
var pts = digit._digitizePoints;
+ attributesDialog.html(editAttributesHtml);
attributesDialog.dialog('open');
+ attributesDialog.find('.digitize-add').bind('click', function() {
+ var newRow = $('<tr><td><input type="text"></input></td><td><input type="text"></input></td></tr>');
+ attributesDialog.find('table').append(newRow);
+ newRow.find('input').first().bind('change', function() {
+ newRow.find('input').last().attr('name', $(this).val());
+ });
+ });
attributesDialog.find('.digitize-save').bind('click', function() {
kml.addGeometry(pts, digitizingFor, attributesDialog);
attributesDialog.dialog('close');
Modified: trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayKmlFeatures.js 2014-05-13 09:13:45 UTC (rev 8852)
+++ trunk/mapbender/lib/mb.ui.displayKmlFeatures.js 2014-05-13 09:38:04 UTC (rev 8853)
@@ -263,7 +263,10 @@
multi.e.setElement('title', 'title');
multi.e.setElement('name', 'name');
attributesDialog.find('table input').each(function() {
- multi.e.setElement($(this).attr('name'), $(this).val());
+ var name = $(this).attr('name');
+ if(name) {
+ multi.e.setElement($(this).attr('name'), $(this).val());
+ }
});
if(icon == "false" || icon === false){
More information about the Mapbender_commits
mailing list