Merge pull request #1992 from fredj/select-layer-option
Remove layer option from ol.interaction.Select
This commit is contained in:
@@ -1726,9 +1726,7 @@ olx.interaction.PinchZoomOptions.prototype.duration;
|
||||
/**
|
||||
* @typedef {{addCondition: (ol.events.ConditionType|undefined),
|
||||
* condition: (ol.events.ConditionType|undefined),
|
||||
* layerFilter: (function(ol.layer.Layer): boolean|undefined),
|
||||
* layer: (ol.layer.Layer|undefined),
|
||||
* layers: (Array.<ol.layer.Layer>|undefined),
|
||||
* layers: (Array.<ol.layer.Layer>|function(ol.layer.Layer): boolean|undefined),
|
||||
* style: (ol.style.Style|Array.<ol.style.Style>|ol.feature.StyleFunction|undefined),
|
||||
* removeCondition: (ol.events.ConditionType|undefined),
|
||||
* toggleCondition: (ol.events.ConditionType|undefined)}}
|
||||
@@ -1756,22 +1754,12 @@ olx.interaction.SelectOptions.prototype.condition;
|
||||
|
||||
|
||||
/**
|
||||
* Filter function to restrict selection to a subset of layers.
|
||||
* @type {function(ol.layer.Layer): boolean|undefined}
|
||||
*/
|
||||
olx.interaction.SelectOptions.prototype.layerFilter;
|
||||
|
||||
|
||||
/**
|
||||
* Layer. The single layer from which features should be selected.
|
||||
* @type {ol.layer.Layer|undefined}
|
||||
*/
|
||||
olx.interaction.SelectOptions.prototype.layer;
|
||||
|
||||
|
||||
/**
|
||||
* Layers. Zero or more layers from which features should be selected.
|
||||
* @type {Array.<ol.layer.Layer>|undefined}
|
||||
* A list of layers from which features should be
|
||||
* selected. Alternatively, a filter function can be provided. The
|
||||
* function will be called for each layer in the map and should return
|
||||
* `true` for layers that you want to be selectable. If the option is
|
||||
* absent, all visible layers will be considered selectable.
|
||||
* @type {Array.<ol.layer.Layer>|function(ol.layer.Layer): boolean|undefined}
|
||||
*/
|
||||
olx.interaction.SelectOptions.prototype.layers;
|
||||
|
||||
|
||||
@@ -55,28 +55,20 @@ ol.interaction.Select = function(opt_options) {
|
||||
options.toggleCondition : ol.events.condition.shiftKeyOnly;
|
||||
|
||||
var layerFilter;
|
||||
if (goog.isDef(options.layerFilter)) {
|
||||
layerFilter = options.layerFilter;
|
||||
} else if (goog.isDef(options.layer)) {
|
||||
var layer = options.layer;
|
||||
layerFilter =
|
||||
/**
|
||||
* @param {ol.layer.Layer} l Layer.
|
||||
* @return {boolean} Include.
|
||||
*/
|
||||
function(l) {
|
||||
return l === layer;
|
||||
};
|
||||
} else if (goog.isDef(options.layers)) {
|
||||
var layers = options.layers;
|
||||
layerFilter =
|
||||
/**
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {boolean} Include.
|
||||
*/
|
||||
function(layer) {
|
||||
return goog.array.contains(layers, layer);
|
||||
};
|
||||
if (goog.isDef(options.layers)) {
|
||||
if (goog.isFunction(options.layers)) {
|
||||
layerFilter = options.layers;
|
||||
} else {
|
||||
var layers = options.layers;
|
||||
layerFilter =
|
||||
/**
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {boolean} Include.
|
||||
*/
|
||||
function(layer) {
|
||||
return goog.array.contains(layers, layer);
|
||||
};
|
||||
}
|
||||
} else {
|
||||
layerFilter = goog.functions.TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user