setMapExtent(bbox);
addBoxToMap(bbox);
- $("loading").innerHTML = "";
+ $("loading").style.display = "none";
+
+ $$("#browse_map .geolink").each(function (link) {
+ link.style.display = "inline";
+ });
- $("area_larger_map").href = '/?minlon='+minlon+'&minlat='+minlat+'&maxlon='+maxlon+'&maxlat='+maxlat+'&box=yes';
- $("area_larger_map").innerHTML = "<%= t 'browse.map.larger.area' %>";
+ $("remote_area_edit").observe("click", function (event) {
+ remoteEditHandler(event, bbox);
+ });
+
+ <% if preferred_editor == "remote" %>
+ $("area_edit").observe("click", function (event) {
+ remoteEditHandler(event, bbox);
+ });
+ <% end %>
+
+ updatelinks(centre.lon, centre.lat, 16, null, minlon, minlat, maxlon, maxlat)
+ <% elsif map.instance_of? Note %>
+ var centre = new OpenLayers.LonLat(<%= map.lon %>, <%= map.lat %>);
+
+ setMapCenter(centre, 16);
+ addMarkerToMap(centre);
+
- $("loading").innerHTML = "";
++ $("loading").style.display = "none";
+
- $("area_larger_map").href = '/?mlon=<%= map.lon %>&mlat=<%=map.lat %>';
- $("area_larger_map").innerHTML = "<%= t 'browse.map.larger.area' %>";
++ updatelinks(centre.lon, centre.lat, 16, null, null, null, null, null)
<% else %>
var obj_type = "<%= map.class.name.downcase %>";
var obj_id = <%= map.id %>;
</noscript>
<div id="map">
+ <div id="permalink">
+ <a href="/" id="permalinkanchor" class="geolink llz layers object"><%= t 'site.index.permalink' %></a><br/>
+ <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a>
++ <a href="#" id="reportbuganchor">Report a problem</a>
+ </div>
</div>
<iframe id="linkloader" style="display: none">
<%= javascript_include_tag '/openlayers/OpenLayers.js' %>
<%= javascript_include_tag '/openlayers/OpenStreetMap.js' %>
+<%= javascript_include_tag 'openstreetbugs.js' %>
<%= javascript_include_tag 'map.js' %>
- <script type="text/javascript" defer="defer">
- <!--
- var brokenContentSize = $("content").offsetWidth == 0;
+ <%= render :partial => 'resize' %>
+
+ <script type="text/javascript">
var marker;
var map;
<% end %>
}
- mapInit();
+ function addBug() {
+ map.osbControl.activate();
+ map.osbControl.addTemporaryMarker(map.getCenter());
+ }
+
+ function allowBugReports() {
+ if (map.getZoom() > 11) {
+ $("reportbuganchor").style.visibility = "visible";
+ } else {
+ $("reportbuganchor").style.visibility = "hidden";
+ }
+ }
+
+ document.observe("dom:loaded", mapInit);
+ document.observe("dom:loaded", installEditHandler);
+ document.observe("dom:loaded", handleResize);
+
+ Event.observe(window, "resize", function() {
+ var centre = map.getCenter();
+ var zoom = map.getZoom();
- Event.observe(window, "load", installEditHandler);
- Event.observe(window, "load", handleResize);
- Event.observe(window, "resize", handleResize);
+ handleResize();
+
+ map.setCenter(centre, zoom);
+ });
<% if params['action'] == 'export' %>
<%= remote_function :url => { :controller => 'export', :action => 'start' } %>