Guangyun
Guangyun

Reputation: 1

Hide selected Features

in ol3, after executing

layer.setVisible(false);

selected Features are still visible. I wanne all features of a layer to be completely hidden after I set the layer to be invisible. How to solve the problem ?

Thanks,

Upvotes: 0

Views: 445

Answers (1)

Jonatas Walker
Jonatas Walker

Reputation: 14150

First, clear the selection:

var select = new ol.interaction.Select();
var collection = select.getFeatures();
collection.clear();

or

select.getFeatures().clear();

Upvotes: 1

Related Questions