]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/layouts/_head.html.erb
Move param-based map configuration to client
[rails.git] / app / views / layouts / _head.html.erb
index 993544baed158495fac4c2ba05702f8d64e1d9d5..91a862f0ab730a32fdff276e72d6e5657029aa9b 100644 (file)
     I18n.defaultLocale = "<%= I18n.default_locale %>";
     I18n.locale = "<%= I18n.locale %>";
     I18n.fallbacks = true;
+
+    <% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
+    OSM.home = <%= { :lat => @user.home_lat, :lon => @user.home_lon }.to_json.html_safe %>;
+    <% end %>
+
+    <% if session[:location] %>
+    OSM.location = <%= session[:location].to_json.html_safe %>;
+    <% end %>
   </script>
   <title><%= t 'layouts.project_name.title' %><%= ' | '+ @title if @title %></title>
 </head>