Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/web/www/routino/search.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1001 - (show annotations) (download)
Tue Jun 5 08:17:57 2012 UTC (12 years, 9 months ago) by amb
File size: 1448 byte(s)
Add a button to replace the lat/long text entry with a location search entry.
Use Nominatim service via CGI to get first search result and fill in coords.

1 #!/usr/bin/perl
2 #
3 # Routino search results retrieval CGI
4 #
5 # Part of the Routino routing software.
6 #
7 # This file Copyright 2012 Andrew M. Bishop
8 #
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU Affero General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Affero General Public License for more details.
18 #
19 # You should have received a copy of the GNU Affero General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #
22
23 # Use the generic search script
24 require "search.pl";
25
26 # Use the perl CGI module
27 use CGI ':cgi';
28
29 # Create the query and get the parameters
30
31 $query=new CGI;
32
33 @rawparams=$query->param;
34
35 # Convert the CGI parameters
36
37 foreach $key (@rawparams)
38 {
39 $value=$query->param($key);
40
41 $cgiparams{$key}=$value;
42 }
43
44 # Parse the parameters
45
46 $marker=$cgiparams{"marker"};
47 $search=$cgiparams{"search"};
48
49 # Run the search
50
51 ($search_time,$search_lat,$search_lon,$search_message)=RunSearch($search);
52
53 # Return the output
54
55 print header('text/plain');
56
57 print "$marker\n";
58 print "$search_time\n";
59 print "$search_lat $search_lon\n";
60 print "$search_message\n";

Properties

Name Value
svn:executable *