此查询将从三个下拉框和一个文本框中获取输入,它按预期工作正常。但我的要求是我需要使用另外三个下拉框和文本以便查询更深。所以,我需要保存第一个查询的结果和第二个查询。我该怎么做。帮助我。
That another three drop down box value is also obtained from the same variable's as 'operator','textvalue','querypass'.
function querymap()
{
var operator=document.getElementById('operatorstring').value.replace(/'/g, "\\'");
var textvalue=document.getElementById("text-value").value.replace(/'/g, "\\'");
var querypass=document.getElementById('query-pass').value.replace(/'/g, "\\'");
var searchStringe = document.getElementById('Search-stringe').value.replace(/'/g, "\\'");
var searchString = document.getElementById('search-string').value.replace(/'/g, "\\'");
{
layer.setQuery("SELECT 'geometry'," + querypass + " FROM " + tableid + " WHERE " + querypass + " " + operator + " '" + textvalue + "' AND VillageName = '"+ searchStringe+"'");
}
}
答案 0 :(得分:0)
您可以根据需要在查询中包含尽可能多的AND条件。没有理由不检查例如textvalue2,querypass2,searchString2等,并将它们添加到您的查询中。请参阅此setQuery() answer,它可能会给您一些想法。每次调用layer.setQuery()或layer.setOptions({query:...})时都需要设置所有搜索条件;