aboutsummaryrefslogtreecommitdiffstats
path: root/isuifang_solr/solr/conf/velocity/querySpatial.vm
blob: 3b57de4f2ec47dec0a5f395e4cdc67dec19b8683 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#set($queryOpts = $params.get("queryOpts"))
#if($queryOpts == "spatial")
<div>
        #set($loc = $request.params.get('pt'))
        #set($dist = $request.params.get('d', "10"))
        <label #annTitle("Add the &pt parameter")>Location Filter:
          <select id="pt" name="pt">
            <option value="none"
            #if($loc == '')selected="true"#end>No Filter</option>
            <option value="45.17614,-93.87341"
            #if($loc == '45.17614,-93.87341')selected="true"#end>Buffalo, MN</option>
            <option value="37.7752,-100.0232"
            #if($loc == '37.7752,-100.0232')selected="true"#end>Dodge City, KS</option>
            <option value="35.0752,-97.032"
            #if($loc == '35.0752,-97.032')selected="true"#end>Oklahoma City, OK</option>
            <option value="37.7752,-122.4232"
            #if($loc == '37.7752,-122.4232')selected="true"#end>San Francisco CA</option>
          </select>
  </label>
  <span #annTitle("Add the &d parameter")>Distance (KM): <input id="d" name="d" type="text" size="6"
                                                                value="#if($dist != '')${dist}#{else}10#end"/></span>
<input type="hidden" name="sfield" value="store"/>
<input type="hidden" id="spatialFQ" name="fq" value=""/>
<input type="hidden" name="queryOpts" value="spatial"/>        
</div>
<script type="text/javascript">
  $('#query-form').submit(function() {
    if ($("#pt").val() != "none") {
      $("#spatialFQ").val("{!bbox}");
    }
    $fqs = $("#allFQs").val();
    $fqs = $fqs.replace("{!bbox}", "");
    if ($fqs == ''){
      $("#allFQs").remove();
    }
    $("#allFQs").val($fqs);
    return true;
    });
</script>
#end