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 <% if params['mlon'] and params['mlat'] %>
9 <% lon = params['mlon'] %>
10 <% lat = params['mlat'] %>
11 <% zoom = params['zoom'] || '12' %>
12 <% elsif @user and params['lon'].nil? and params['lat'].nil? %>
13 <% lon = @user.home_lon %>
14 <% lat = @user.home_lat %>
17 <% lon = params['lon'] || '-0.1' %>
18 <% lat = params['lat'] || '51.5' %>
19 <% zoom = params['zoom'] || '12' %>
22 <div id="map">You need a Flash player to use Potlatch, the
23 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>.
25 <a href="http://wiki.openstreetmap.org/index.php/Editing">Several other options</a> are also available
26 for editing OpenStreetMap.
28 <script type="text/javascript" src="/javascripts/swfobject.js"></script>
29 <script type="text/javascript">
30 var brokenContentSize = $("content").offsetWidth == 0;
31 var fo = new SWFObject("/potlatch/potlatch.swf?d="+Math.round(Math.random()*1000), "potlatch", "700", "600", "6", "#FFFFFF");
33 function doSWF(lat,lon,sc) {
34 fo.addVariable('lat',lat);
35 fo.addVariable('long',lon);
36 fo.addVariable('scale',sc);
37 fo.addVariable('token','<%= @user.token %>');
41 doSWF(<%= lat %>,<%= lon %>,<%= zoom %>);
43 function setPosition(lat, lon, zoom) {
44 doSWF(lat, lon, zoom);
47 function resizeContent() {
48 var content = $("content");
49 var rightMargin = parseInt(getStyle(content, "right"));
50 var bottomMargin = parseInt(getStyle(content, "bottom"));
52 content.style.width = document.documentElement.clientWidth - content.offsetLeft - rightMargin;
53 content.style.height = document.documentElement.clientHeight - content.offsetTop - bottomMargin;
56 function resizeMap() {
57 var search_results_width = $("search_results").offsetWidth;
59 if (search_results_width > 0) {
60 search_results_width = search_results_width + 5
63 $("map").style.left = (search_results_width) + "px";
64 $("map").style.width = ($("content").offsetWidth - search_results_width) + "px";
65 $("map").style.height = ($("content").offsetHeight - 2) + "px";
68 function handleResize() {
69 if (brokenContentSize) {
76 window.onresize = handleResize;
77 window.onload = handleResize;