elpiojo
(elpiojo_)
49
ok werde ich mal probieren, aber muss ich hier
nicht options.events.on schreiben?
ok hab mittlerweile herausgefunden das ich es so schreiben sollte
new OpenLayers.Control.SelectFeature([pois, offen]);
ohne dem options aber jetzt stellt sich mir die frage wie ich das an den handler weitergeben
habs mitterlweile gelöst
meine lösung schaut jetzt wie folgt aus:
function onPopupClose(evt) {
selectControl.unselect(selectedFeature);
}
function onFeatureSelect(feature) {
selectedFeature = feature;
var tags = feature.attributes;
var infoHtml = "<table>";
for (var key in tags) {
infoHtml += "<tr><td>" + tags[key] + "</td></tr>";
}
infoHtml += "</table>";
popup = new OpenLayers.Popup.FramedCloud("chicken",
feature.geometry.getBounds().getCenterLonLat(),
null,
infoHtml,
null, true, onPopupClose);
feature.popup = popup;
map.addPopup(popup);
}
function onFeatureUnselect(feature) {
map.removePopup(feature.popup);
feature.popup.destroy();
feature.popup = null;
}
var options = { hover: false, onSelect: onFeatureSelect, onUnselect: onFeatureUnselect };
selectControl = new OpenLayers.Control.SelectFeature([pois,offen], options);
map.addControl(selectControl);
ich danke euch für die hilfe!