好吧,当一个悬停时我想要一个漂亮的弹出窗口,但我也希望矢量可选。如果我跳过悬停部分,它就像魅力一样,但是:/我错过了什么吗?
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();