嗯,我想要一個漂亮的彈出框,但我也希望矢量可選。 如果我跳過懸停部分,它的作用像魅力,但其他:/有沒有我錯過了什麼?懸停處於活動狀態時無法選擇矢量
vectors.removeAllFeatures();
var geojson_format = new OpenLayers.Format.GeoJSON();
vectors.addFeatures(geojson_format.read(data));
var selectCtrl = new OpenLayers.Control.SelectFeature(vectors,
{
clickout: true
});
map.addControl(selectCtrl);
selectCtrl.activate();
vectors.events.on({
"featureselected": featureSelected
});
var hover = new OpenLayers.Control.SelectFeature(vectors,{
hover: true,
highlightOnly: true,
eventListeners: {
featurehighlighted: featureHover,
featureunhighlighted: featureUnHover
}
});
map.addControl(hover);
hover.activate();