<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>
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);
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();