X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/52e5fa6ad78f375cec5a207a123a4aa3939c8ddf..e660e609661edadc1ed5ad49d6e83e936b2f91cd:/app/views/site/index.html.erb diff --git a/app/views/site/index.html.erb b/app/views/site/index.html.erb index 43bafac40..884896109 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -18,7 +18,7 @@
@@ -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, - "

" + feature.attributes.id + "

", - null, true); + feature.popup = new OpenLayers.Popup.FramedCloud( + feature.attributes.id, location, null, + "

" + feature.attributes.id + "

", + null, true, function (e) { map.noteControl.unselect(feature) } + ); map.addPopup(feature.popup); // feature.popup.show();