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) {
43 fo.addVariable('lat',lat);
44 fo.addVariable('long',lon);
45 fo.addVariable('scale',sc);
46 fo.addVariable('token','<%= session[:token] %>');
50 doSWF(<%= lat %>,<%= lon %>,<%= zoom %>);
52 function setPosition(lat, lon, zoom) {
53 doSWF(lat, lon, zoom);
56 function resizeContent() {
57 var content = $("content");
58 var rightMargin = parseInt(getStyle(content, "right"));
59 var bottomMargin = parseInt(getStyle(content, "bottom"));
61 content.style.width = document.documentElement.clientWidth - content.offsetLeft - rightMargin;
62 content.style.height = document.documentElement.clientHeight - content.offsetTop - bottomMargin;
65 function resizeMap() {
66 var search_results_width = $("search_results").offsetWidth;
68 if (search_results_width > 0) {
69 search_results_width = search_results_width + 5
72 $("map").style.left = (search_results_width) + "px";
73 $("map").style.width = ($("content").offsetWidth - search_results_width) + "px";
74 $("map").style.height = ($("content").offsetHeight - 2) + "px";
77 function handleResize() {
78 if (brokenContentSize) {
85 window.onresize = handleResize;
86 window.onload = handleResize;