diff --git a/js/src/gis_data_editor.js b/js/src/gis_data_editor.js index fad50b4306..df4cdd2852 100644 --- a/js/src/gis_data_editor.js +++ b/js/src/gis_data_editor.js @@ -375,7 +375,7 @@ AJAX.registerOnload('gis_data_editor.js', function () { var noOfGeoms = parseInt($noOfGeomsInput.val(), 10); var html1 = Messages.strGeometry + ' ' + (noOfGeoms + 1) + ':
'; - var $geomType = $('select[name=\'gis_data[' + (noOfGeoms - 1) + '][gis_type]\']').clone(); + var $geomType = $('#gis_type_template').contents().filter('select').clone(); $geomType.attr('name', 'gis_data[' + noOfGeoms + '][gis_type]').val('POINT'); var html2 = '
' + Messages.strPoint + ' :' + '' + @@ -384,9 +384,7 @@ AJAX.registerOnload('gis_data_editor.js', function () { '' + '

'; - $a.before(html1); - $geomType.insertBefore($a); - $a.before(html2); + $a.before(html1, $geomType, html2); $noOfGeomsInput.val(noOfGeoms + 1); }); }); diff --git a/templates/gis_data_editor_form.twig b/templates/gis_data_editor_form.twig index eb8f94120b..3a5dc02cda 100644 --- a/templates/gis_data_editor_form.twig +++ b/templates/gis_data_editor_form.twig @@ -46,6 +46,14 @@ {% endif %} + + {% for a in 0..geom_count - 1 %} {% if gis_data[a] is not null %} {% if geom_type == 'GEOMETRYCOLLECTION' %}