]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.html.erb
Merge branch 'master' into openstreetbugs
[rails.git] / app / views / site / index.html.erb
index 43bafac40f09ee652be0fdf1aacad91e8e9dc560..88489610994ac6c5934a60264729d0554105119c 100644 (file)
@@ -18,7 +18,7 @@
 
 <div id="map">
   <div id="permalink">
-    <a href="/" id="permalinkanchor" class="geolink llz layers object"><%= t 'site.index.permalink' %></a><br/>
+    <a href="/" id="permalinkanchor" class="geolink llz layers object"><%= t 'site.index.permalink' %></a>
     <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a>
     <a href="#" id="createnoteanchor">Report a problem</a>     
   </div>
@@ -190,10 +190,10 @@ end
       map.noteLayer.events.register("featureunselected", map, noteUnselected);
       map.addLayer(map.noteLayer);
 
-      var noteControl = new OpenLayers.Control.SelectFeature(map.noteLayer, {
+      map.noteControl = new OpenLayers.Control.SelectFeature(map.noteLayer, {
           autoActivate: true
       });
-      map.addControl(noteControl);
+      map.addControl(map.noteControl);
 
       <% if params[:notes] == "yes" -%>
       map.noteLayer.setVisibility(true);
@@ -339,10 +339,11 @@ end
     var feature = o.feature;
     var location = feature.geometry.getBounds().getCenterLonLat();
 
-    feature.popup = new OpenLayers.Popup.FramedCloud(feature.attributes.id,
-                                                     location, null,
-                                                     "<p>" + feature.attributes.id + "</p>",
-                                                     null, true);
+    feature.popup = new OpenLayers.Popup.FramedCloud(
+      feature.attributes.id, location, null,
+      "<p>" + feature.attributes.id + "</p>",
+      null, true, function (e) { map.noteControl.unselect(feature) }
+    );
 
     map.addPopup(feature.popup);
 //    feature.popup.show();