From: Steve Coast Date: Sat, 7 Apr 2007 10:24:49 +0000 (+0000) Subject: move to rails 1.2.3 and make the map use all the window space X-Git-Tag: live~8573 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/4f826acfca0ede6b7d4868e8bb45a608c44582ce?hp=9b424b8614e875734bcc429db88506fb2b6039dd move to rails 1.2.3 and make the map use all the window space --- diff --git a/app/views/layouts/site.rhtml b/app/views/layouts/site.rhtml index 249db6576..1154237cb 100644 --- a/app/views/layouts/site.rhtml +++ b/app/views/layouts/site.rhtml @@ -10,92 +10,83 @@ + <% if params[:controller] == 'site' and params[:action] == 'index' %> +
+ <% end %>
-<% if flash[:notice] %> -
<%= flash[:notice] %>
-<% end %> + <% if flash[:notice] %> +
<%= flash[:notice] %>
+ <% end %> - <%= yield %> + <%= yield %> -
+ - - <% if @user %> + + <% if @user %> Welcome, <%= @user.display_name %> | <%= link_to 'logout', {:controller => 'user', :action => 'logout'}, {:id => 'loginanchor'}%> - <% else %> + <% else %> <%= link_to 'log in', {:controller => 'user', :action => 'login'}, {:id => 'loginanchor'}%> | <%= link_to 'sign up', {:controller => 'user', :action => 'new'}, {:id => 'registeranchor'} %> - <% end %> - - -
-
    - <% viewclass = '' - editclass = '' - traceclass = '' - viewclass = 'active' if params['controller'] == 'site' and params['action'] == 'index' - editclass = 'active' if params['controller'] == 'site' and params['action'] == 'edit' - traceclass = 'active' if params['controller'] == 'trace' - %> -
  • <%= link_to 'View', {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => 'view maps', :class => viewclass } %>
  • -
  • <%= link_to 'Edit', {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => 'edit maps', :class => editclass } %>
  • -
  • <%= link_to 'GPS traces', {:controller => 'trace', :action => 'list'}, {:id => 'traceanchor', :title => 'manage traces', :class => traceclass } %>
  • -
-
+ <% end %> +
-
- - - <% unless @user %> -
- OpenStreetMap is a free editable map of the whole world. It is made by people like you. -

- OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth. -

- OpenStreetMap's hosting is kindly supported by the UCL VR Centre and bytemark. +

+
    + <% viewclass = '' + editclass = '' + traceclass = '' + viewclass = 'active' if params['controller'] == 'site' and params['action'] == 'index' + editclass = 'active' if params['controller'] == 'site' and params['action'] == 'edit' + traceclass = 'active' if params['controller'] == 'trace' + %> +
  • <%= link_to 'View', {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => 'view maps', :class => viewclass } %>
  • +
  • <%= link_to 'Edit', {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => 'edit maps', :class => editclass } %>
  • +
  • <%= link_to 'GPS traces', {:controller => 'trace', :action => 'list'}, {:id => 'traceanchor', :title => 'manage traces', :class => traceclass } %>
  • +
- <% end %> -
- Help & Wiki
- News blog
- Shop
-
+
- - - -
- -
- <%= yield :optionals %> - - - + +
+ + diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index e83261a2b..670f10a20 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -5,11 +5,11 @@
-
+ <% lon = params['lon'] || '-0.1' %> <% lat = params['lat'] || '51.5' %> -<% zoom = params['zoom'] || '5' %> +<% zoom = params['zoom'] || '4' %> - - - + map.events.register("moveend", map, function() { + var lonlat = map.getCenter(); - <% unless @user %> -
-
We're trialing the adverts below to support the project. Login and they go away. -
- <% end %> + var lon_deg = (lonlat.lon / 20037508.34) * 180; + var lat_deg = (lonlat.lat / 20037508.34) * 180; + var PI = 3.14159265358979323846; + lat_deg = 180/PI * (2 * Math.atan(Math.exp(lat_deg * PI / 180)) - PI / 2); + var zoom = map.getZoom(); + updatelinks(lon_deg,lat_deg,zoom); + }); + } +init(); +// --> + diff --git a/config/environment.rb b/config/environment.rb index 84394f2ac..b55fbe441 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -5,7 +5,7 @@ # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '1.2.2' +RAILS_GEM_VERSION = '1.2.3' # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') diff --git a/public/stylesheets/site.css b/public/stylesheets/site.css index 2c7e454db..e18b182b9 100644 --- a/public/stylesheets/site.css +++ b/public/stylesheets/site.css @@ -146,11 +146,11 @@ body { #content { - width: 700px; + /* width: 700px; */ padding: 0; /*padding-left: 1em;*/ margin: 0; - position: absolute; + position: absolute; left: 192px; top: 35px; background: none; @@ -166,7 +166,6 @@ body { text-align: center; } - #mapImage { position: absolute; left: 0px; @@ -175,9 +174,9 @@ body { top: 0px; left: 14px; } + #mapEpilog { font-size: x-small; - } #keyvalue {