diff --git a/js/src/table/select.js b/js/src/table/select.js index 0dc0946ce4..f9bcd786ed 100644 --- a/js/src/table/select.js +++ b/js/src/table/select.js @@ -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');