Use featureOverlay in select interaction
This commit is contained in:
@@ -41,7 +41,7 @@ var vector = new ol.layer.Vector({
|
||||
});
|
||||
|
||||
var select = new ol.interaction.Select({
|
||||
featuresOverlay: new ol.FeatureOverlay({
|
||||
featureOverlay: new ol.FeatureOverlay({
|
||||
styleFunction: function(feature, layer) {
|
||||
return selectedStyle;
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@
|
||||
* features should be selected.
|
||||
* @property {Array.<ol.layer.Layer>|undefined} layers Layers. Zero or more
|
||||
* layers from which features should be selected.
|
||||
* @property {ol.FeatureOverlay} featuresOverlay Features overlay.
|
||||
* @property {ol.FeatureOverlay} featureOverlay Feature overlay.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
@exportSymbol ol.interaction.Select
|
||||
@exportProperty ol.interaction.Select.prototype.getFeaturesOverlay
|
||||
@exportProperty ol.interaction.Select.prototype.getFeatureOverlay
|
||||
@exportProperty ol.interaction.Select.prototype.setMap
|
||||
|
||||
@@ -71,18 +71,18 @@ ol.interaction.Select = function(opt_options) {
|
||||
* @private
|
||||
* @type {ol.FeatureOverlay}
|
||||
*/
|
||||
this.featuresOverlay_ = options.featuresOverlay;
|
||||
this.featureOverlay_ = options.featureOverlay;
|
||||
|
||||
};
|
||||
goog.inherits(ol.interaction.Select, ol.interaction.Interaction);
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.FeatureOverlay} Features overlay.
|
||||
* @return {ol.FeatureOverlay} Feature overlay.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.interaction.Select.prototype.getFeaturesOverlay = function() {
|
||||
return this.featuresOverlay_;
|
||||
ol.interaction.Select.prototype.getFeatureOverlay = function() {
|
||||
return this.featureOverlay_;
|
||||
};
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ ol.interaction.Select.prototype.handleMapBrowserEvent =
|
||||
}
|
||||
var add = this.addCondition_(mapBrowserEvent);
|
||||
var map = mapBrowserEvent.map;
|
||||
var features = this.featuresOverlay_.getFeatures();
|
||||
var features = this.featureOverlay_.getFeatures();
|
||||
map.withFrozenRendering(
|
||||
/**
|
||||
* @this {ol.interaction.Select}
|
||||
@@ -150,5 +150,5 @@ ol.interaction.Select.prototype.handleMapBrowserEvent =
|
||||
*/
|
||||
ol.interaction.Select.prototype.setMap = function(map) {
|
||||
goog.base(this, 'setMap', map);
|
||||
this.featuresOverlay_.setMap(map);
|
||||
this.featureOverlay_.setMap(map);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user