Use featureOverlay in select interaction

This commit is contained in:
Éric Lemoine
2014-02-04 16:43:26 +01:00
parent ff11ed2e1e
commit 356f86d8f7
4 changed files with 9 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ var vector = new ol.layer.Vector({
}); });
var select = new ol.interaction.Select({ var select = new ol.interaction.Select({
featuresOverlay: new ol.FeatureOverlay({ featureOverlay: new ol.FeatureOverlay({
styleFunction: function(feature, layer) { styleFunction: function(feature, layer) {
return selectedStyle; return selectedStyle;
} }

View File

@@ -417,7 +417,7 @@
* features should be selected. * features should be selected.
* @property {Array.<ol.layer.Layer>|undefined} layers Layers. Zero or more * @property {Array.<ol.layer.Layer>|undefined} layers Layers. Zero or more
* layers from which features should be selected. * layers from which features should be selected.
* @property {ol.FeatureOverlay} featuresOverlay Features overlay. * @property {ol.FeatureOverlay} featureOverlay Feature overlay.
*/ */
/** /**

View File

@@ -1,3 +1,3 @@
@exportSymbol ol.interaction.Select @exportSymbol ol.interaction.Select
@exportProperty ol.interaction.Select.prototype.getFeaturesOverlay @exportProperty ol.interaction.Select.prototype.getFeatureOverlay
@exportProperty ol.interaction.Select.prototype.setMap @exportProperty ol.interaction.Select.prototype.setMap

View File

@@ -71,18 +71,18 @@ ol.interaction.Select = function(opt_options) {
* @private * @private
* @type {ol.FeatureOverlay} * @type {ol.FeatureOverlay}
*/ */
this.featuresOverlay_ = options.featuresOverlay; this.featureOverlay_ = options.featureOverlay;
}; };
goog.inherits(ol.interaction.Select, ol.interaction.Interaction); goog.inherits(ol.interaction.Select, ol.interaction.Interaction);
/** /**
* @return {ol.FeatureOverlay} Features overlay. * @return {ol.FeatureOverlay} Feature overlay.
* @todo stability experimental * @todo stability experimental
*/ */
ol.interaction.Select.prototype.getFeaturesOverlay = function() { ol.interaction.Select.prototype.getFeatureOverlay = function() {
return this.featuresOverlay_; return this.featureOverlay_;
}; };
@@ -96,7 +96,7 @@ ol.interaction.Select.prototype.handleMapBrowserEvent =
} }
var add = this.addCondition_(mapBrowserEvent); var add = this.addCondition_(mapBrowserEvent);
var map = mapBrowserEvent.map; var map = mapBrowserEvent.map;
var features = this.featuresOverlay_.getFeatures(); var features = this.featureOverlay_.getFeatures();
map.withFrozenRendering( map.withFrozenRendering(
/** /**
* @this {ol.interaction.Select} * @this {ol.interaction.Select}
@@ -150,5 +150,5 @@ ol.interaction.Select.prototype.handleMapBrowserEvent =
*/ */
ol.interaction.Select.prototype.setMap = function(map) { ol.interaction.Select.prototype.setMap = function(map) {
goog.base(this, 'setMap', map); goog.base(this, 'setMap', map);
this.featuresOverlay_.setMap(map); this.featureOverlay_.setMap(map);
}; };