Allow switching geometry type when editing in search views

Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
This commit is contained in:
Maximilian Krög 2023-09-14 23:10:56 +02:00
parent 4bd6a2dd52
commit 3504afe84c
No known key found for this signature in database
GPG Key ID: 3C00897BB53AAB9C

View File

@ -182,7 +182,7 @@ AJAX.registerOnload('table/select.js', function () {
});
// Following section is related to the 'function based search' for geometry data types.
// Initially hide all the open_gis_editor spans
// Initially hide all the open_search_gis_editor spans
$('span.open_search_gis_editor').hide();
$('select.geom_func').on('change', function () {
@ -251,13 +251,15 @@ AJAX.registerOnload('table/select.js', function () {
var field = 'Parameter';
// Column type
var geomFunc = $span.parents('tr').find('.geom_func').val();
var type;
if (geomFunc === 'Envelope') {
type = 'polygon';
} else if (geomFunc === 'ExteriorRing') {
type = 'linestring';
} else {
type = 'point';
var type = 'GEOMETRY';
if (!value) {
if (geomFunc === 'Envelope') {
value = 'POLYGON()';
} else if (geomFunc === 'ExteriorRing') {
value = 'LINESTRING()';
} else {
value = 'POINT()';
}
}
// Names of input field and null checkbox
var inputName = $span.parent('td').children('input[type=\'text\']').attr('name');