2 <p>The OpenStreetMap database is currently in read-only mode while
3 essential database maintenance work is carried out.
6 <%= render :partial => 'search', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
8 <% session[:token] = @user.tokens.create.token unless session[:token] %>
10 <% if params['mlon'] and params['mlat'] %>
11 <% lon = params['mlon'] %>
12 <% lat = params['mlat'] %>
13 <% zoom = params['zoom'] || '12' %>
14 <% elsif @user and params['lon'].nil? and params['lat'].nil? %>
15 <% lon = @user.home_lon %>
16 <% lat = @user.home_lat %>
19 <% lon = params['lon'] || '-0.1' %>
20 <% lat = params['lat'] || '51.5' %>
21 <% zoom = params['zoom'] || '12' %>
24 <div id="map">You need a Flash player to use Potlatch, the
25 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>.
27 <a href="http://wiki.openstreetmap.org/index.php/Editing">Several other options</a> are also available
28 for editing OpenStreetMap.
30 <script type="text/javascript" src="/javascripts/swfobject.js"></script>
31 <script type="text/javascript">
32 var brokenContentSize = $("content").offsetWidth == 0;
33 var fo = new SWFObject("/potlatch/potlatch.swf?d="+Math.round(Math.random()*1000), "potlatch", "700", "600", "6", "#FFFFFF");
35 function doSWF(lat,lon,sc) {
36 fo.addVariable('lat',lat);
37 fo.addVariable('long',lon);
38 fo.addVariable('scale',sc);
39 fo.addVariable('token','<%= session[:token] %>');
43 doSWF(<%= lat %>,<%= lon %>,<%= zoom %>);
45 function setPosition(lat, lon, zoom) {
46 doSWF(lat, lon, zoom);
49 function resizeContent() {
50 var content = $("content");
51 var rightMargin = parseInt(getStyle(content, "right"));
52 var bottomMargin = parseInt(getStyle(content, "bottom"));
54 content.style.width = document.documentElement.clientWidth - content.offsetLeft - rightMargin;
55 content.style.height = document.documentElement.clientHeight - content.offsetTop - bottomMargin;
58 function resizeMap() {
59 var search_results_width = $("search_results").offsetWidth;
61 if (search_results_width > 0) {
62 search_results_width = search_results_width + 5
65 $("map").style.left = (search_results_width) + "px";
66 $("map").style.width = ($("content").offsetWidth - search_results_width) + "px";
67 $("map").style.height = ($("content").offsetHeight - 2) + "px";
70 function handleResize() {
71 if (brokenContentSize) {
78 window.onresize = handleResize;
79 window.onload = handleResize;