Openlayers 3: Select a feature programmatically

前端 未结 3 1155
梦毁少年i
梦毁少年i 2021-02-05 11:59

I am trying to upgrade my system from Openlayers 2 to Openlayers 3 and I have having one particular issue that I cannot seem to figure out.

My application has a grid and

3条回答
  •  死守一世寂寞
    2021-02-05 12:15

    To do this you need to do the following:

    mySelectControl.getFeatures().clear() -> removes the selected items
    
    mySelectControl.getFeatures().push(featureToSelect) -> selects the applied feature
    

提交回复
热议问题