【OpenLayers笔记】Feature选中交互
map.addInteraction( new Select({ style: function (feature) { //可以返回单个Style也可以返回Array.<Style> return [ new Style({ //选中Feature之后描边线为白色 stroke: new Stroke({ color: "#FFF", width: 8 }), }), new Style({ //选中Feature之后实体线为绿色 stroke: new Stroke({ color: "#00FF00", width: 5 }), }), ]; }, }) );
效果: