Hi all,
I'm still having troubles with my popups. I don't think I fully grasped
Eric's advice. The error I get in Safari's error console is the following
result of expression popup is not an object, referencing line 10 of my code
and line 803 of Openlayers.js (2.8). Any suggestions?
function onPopupClose(evt) {
selectControl.unselect(selectedFeature);
}
function onFeatureSelect(evt) {
selectedFeature = evt.feature;
popup = new OpenLayers.Popup.FramedCloud("chicken",
feature.geometry.getBounds().getCenterLonLat(),
null,
"<div style='font-size:.8em'>Site_ID: "
+ feature.attributes.title +"<hr />Locality: " +
feature.attributes.title+"<br/>Description: " +feature.attributes+"<br/>
Feature ID: "+feature.id+"<br/>Feature Type:"+feature.attributes.NEWSITE_
+"</div>",
null, true, onPopupClose);
feature.popup = popup;
map.addPopup(popup);
}
function onFeatureUnselect(feature) {
map.removePopup(feature.popup);
feature.popup.destroy();
feature.popup = null;
}
...
sites.events.on({
'featureselected': onFeatureSelect,
'featureunselected': onFeatureUnselect
});
selectControl = new OpenLayers.Control.SelectFeature(sites,
{clickout: true,
toggle: false,
hover: false,
}
);
map.addControl(selectControl);
selectControl.activate();
--
Nicholas Efremov-Kendall
Fulbright Student 2009-2010, Ukraine
[email protected]
c/o Halyna Yerko
Balzaka 92a, Kv 27
02232
Kyiv, Ukraine
(mob) +380963576524
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users