jjzjj

selectSrc

全部标签

javascript - Openlayers 3 : how to select a feature programmatically using ol. 交互。选择?

我正在使用OpenLayersv3.6(这很重要,因为我发现的大多数解决方案都可能适用于OpenLayers2)。我有一个表格,当我在该表格中选择一行时,我想突出显示/选择OpenLayersmap上的相应要素。所有要素都是位于同一矢量图层(ol.layer.Vector)中的简单多边形(ol.geom.Polygon)。我像这样设置选择交互://thereisalotofothercodehere...addSelectListener:function(){this.SelectInteraction=newol.interaction.Select({condition:ol.e