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