2 <p>The OpenStreetMap database is currently in read-only mode while
3 essential database maintenance work is carried out.
6 <% content_for :greeting do %>
7 <% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
8 <%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> |
12 <%= render :partial => 'search', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
14 <% session[:token] = @user.tokens.create.token unless session[:token] %>
16 <% if params['mlon'] and params['mlat'] %>
17 <% lon = params['mlon'] %>
18 <% lat = params['mlat'] %>
19 <% zoom = params['zoom'] || '12' %>
20 <% elsif @user and params['lon'].nil? and params['lat'].nil? %>
21 <% lon = @user.home_lon %>
22 <% lat = @user.home_lat %>
25 <% lon = params['lon'] || '-0.1' %>
26 <% lat = params['lat'] || '51.5' %>
27 <% zoom = params['zoom'] || '12' %>
30 <div id="map">You need a Flash player to use Potlatch, the
31 OpenStreetMap Flash editor. You can <a href="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">download Flash Player from Adobe.com</a>.
33 <a href="http://wiki.openstreetmap.org/index.php/Editing">Several other options</a> are also available
34 for editing OpenStreetMap.
36 <script type="text/javascript" src="/javascripts/swfobject.js"></script>
37 <script type="text/javascript">
38 var brokenContentSize = $("content").offsetWidth == 0;
39 var fo = new SWFObject("/potlatch/potlatch.swf?d="+Math.round(Math.random()*1000), "potlatch", "700", "600", "6", "#FFFFFF");
41 function doSWF(lat,lon,sc) {
42 fo.addVariable('lat',lat);
43 fo.addVariable('long',lon);
44 fo.addVariable('scale',sc);
45 fo.addVariable('token','<%= session[:token] %>');
49 doSWF(<%= lat %>,<%= lon %>,<%= zoom %>);
51 function setPosition(lat, lon, zoom) {
52 doSWF(lat, lon, zoom);
55 function resizeContent() {
56 var content = $("content");
57 var rightMargin = parseInt(getStyle(content, "right"));
58 var bottomMargin = parseInt(getStyle(content, "bottom"));
60 content.style.width = document.documentElement.clientWidth - content.offsetLeft - rightMargin;
61 content.style.height = document.documentElement.clientHeight - content.offsetTop - bottomMargin;
64 function resizeMap() {
65 var search_results_width = $("search_results").offsetWidth;
67 if (search_results_width > 0) {
68 search_results_width = search_results_width + 5
71 $("map").style.left = (search_results_width) + "px";
72 $("map").style.width = ($("content").offsetWidth - search_results_width) + "px";
73 $("map").style.height = ($("content").offsetHeight - 2) + "px";
76 function handleResize() {
77 if (brokenContentSize) {
84 window.onresize = handleResize;
85 window.onload = handleResize;