- $("minlon").value = extent.left;
- $("minlat").value = extent.bottom;
- $("maxlon").value = extent.right;
- $("maxlat").value = extent.top;
- <% end %>
+ <% if params[:action] == 'index' -%>
+ var extent = unproj(map.getExtent());
+
+ $("#sidebar_content").load("<%= url_for :controller => :geocoder, :action => :search %>", {
+ query: $("#query").val(),
+ minlon: extent.left,
+ minlat: extent.bottom,
+ maxlon: extent.right,
+ maxlat: extent.top
+ }, openSidebar);
+ <% else -%>
+ $("#sidebar_content").load("<%= url_for :controller => :geocoder, :action => :search %>", {
+ query: $("#query").val()
+ }, openSidebar);
+ <% end -%>