[OpenLayers-Users] activate closebox on popup
Shadin
w_ward_W at hotmail.com
Tue Dec 13 21:43:07 EST 2011
*Hello list
is there any way to activate the close box on the popup ?*
http://osgeo-org.1803224.n2.nabble.com/file/n7092206/3-events.png
*
here is the code :*
layer.events.on({
"featureselected": onFeatureSelect,
"featureunselected": onFeatureUnselect
});
var content = "< h2>"+feature.attributes.name + "</ h2>" ;
if (content.search("<script") != -1) {
content = "Content contained Javascript! Escaped
content below.<br>" + content.replace(/</g, "<");
}
var popup = new OpenLayers.Popup.FramedCloud("chicken",
feature.geometry.getBounds().getCenterLonLat(),
new OpenLayers.Size(100,100),
content,
null, true, onPopupClose);
feature.popup = popup;
map.addPopup(popup);
}
function onFeatureUnselect(event) {
var feature = event.feature;
if(feature.popup) {
map.removePopup(feature.popup);
feature.popup.destroy();
delete feature.popup;
}}
function onPopupClose(evt) {
select.unselectAll();}
function onFeatureSelect(event) {
var feature = event.feature;
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/activate-closebox-on-popup-tp7092206p7092206.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list