Have a problem: when i activated that control:
function onPopupClose(evt) {
selectControl.unselect(selectedFeature);
}
function onFeatureSelect(feature) {
selectedFeature = feature;
id = feature.id;
var lonlat = map.getLonLatFromPixel(map.getControlsByClass("OpenLayers.Control.MousePosition")[0].lastXy);
popup = new OpenLayers.Popup.FramedCloud("chicken",
lonlat,
null,
"<div style='font-size:.8em'>" +CableLineText_arr[id] +"</div>",
null, true, onPopupClose);
feature.popup = popup;
map.addPopup(popup);
}
function onFeatureUnselect(feature) {
map.removePopup(feature.popup);
feature.popup.destroy();
feature.popup = null;
}
...
selectControl = new OpenLayers.Control.SelectFeature(lineLayer,
{onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});
drawControls = {
select: selectControl
};
for(var key in drawControls) {
map.addControl(drawControls[key]);
var control = drawControls[key];
control.activate();
}
and when I click on the marker (poi), then the pop-up window does not appear, when i click on the line (feature) - popup window is displayed. If i disable this control, the pop-up window for the line (feature) does not appear, but if i click on the marker (poi) - a popup window is displayed.
How do I fix this problem?
Link on the map: http://softez.pp.ua/fiberms/fiberms/map.php (for test: check radio button "select polygon on click" and try to click on the line, and then - on the marker, after check radio button "navigate" and try to click on the line, and then - on the marker).
Thanks!