Add getOverlay method to access sketch and selection layers
This commit is contained in:
@@ -255,11 +255,13 @@ class Select extends Interaction {
|
||||
*/
|
||||
this.featureLayerAssociation_ = {};
|
||||
|
||||
const features = this.featureOverlay_.getSource().getFeaturesCollection();
|
||||
listen(features, CollectionEventType.ADD,
|
||||
this.addFeature_, this);
|
||||
listen(features, CollectionEventType.REMOVE,
|
||||
this.removeFeature_, this);
|
||||
if (this.featureOverlay_) {
|
||||
const features = this.featureOverlay_.getSource().getFeaturesCollection();
|
||||
listen(features, CollectionEventType.ADD,
|
||||
this.addFeature_, this);
|
||||
listen(features, CollectionEventType.REMOVE,
|
||||
this.removeFeature_, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -307,6 +309,15 @@ class Select extends Interaction {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the overlay layer that this interaction renders selected features to.
|
||||
* @return {module:ol/layer/Vector} Overlay layer.
|
||||
* @api
|
||||
*/
|
||||
getOverlay() {
|
||||
return this.featureOverlay_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hit-detection tolerance. Pixels inside the radius around the given position
|
||||
* will be checked for features. This only works for the canvas renderer and
|
||||
|
||||
Reference in New Issue
Block a user