require 'net/http'
require 'rexml/document'
- before_filter :authorize_web
- before_filter :require_user
-
def search
res_hash = {}
@postcode_arr = []
@res_ary = []
- if params[:query][:postcode] != ""
+ if params[:query][:postcode]
postcode = params[:query][:postcode]
if postcode.match(/(^\d{5}$)|(^\d{5}-\d{4}$)/)
#its a zip code - do something
end
end
end
- redirect_to :controller => 'geocoder', :action => 'results'
+ redirect_to :controller => 'geocoder', :action => 'results', :params => @res_ary
end
end
def result
-
+ @res = :params[@res_ary]
end
end
<%= submit_tag 'Search' %>
<%= end_form_tag %>
<div id="postcode-helper">
-eg SW15 6JH
+eg: SW15 6JH
</div>
<div id="placename-helper">
-Essen
+eg:Essen
</div>
</div>
-
-
-
<% lon = params['lon'] || '-0.1' %>
<% lat = params['lat'] || '51.5' %>
<% zoom = params['zoom'] || '4' %>
# geocoder
map.connect 'geocoder/search/', :controller => 'geocoder', :action => 'search'
+ map.connect 'geocoder/results/', :controller => 'geocoder', :action => 'results'
# fall through
- map.connect ':controller/:id/:action'
+ map.connect ':controller/:id/:action'
map.connect ':controller/:action'
end
\r
\r
#content {\r
- /* width: 700px; */\r
+ /* width: 700px; */\r
padding: 0;\r
/*padding-left: 1em;*/\r
margin: 0;\r
}\r
\r
#placename-helper{\r
- font-size: 10px;\r
+ font-size: 9px;\r
position:relative; bottom:36px; left: 470px;\r
color: gray;\r
}\r
\r
#postcode-helper{\r
- font-size: 10px;\r
- position:relative; bottom:16px; left: 180px;\r
+ font-size: 9px;\r
+ position:relative; bottom:17px; left: 180px;\r
color: gray;\r
}\r
\r
+\r
+\r
.gpxsummary {\r
font-size: 12px;\r
color: gray;\r
}\r
\r
input {\r
- border: 1px solid black;\r
+ border: 1px solid black;\r
}\r