Dynamic layers and lazy selection layer creation

With this change, the user provides a filter function instead of
an array of layers. Selection layers are created lazily, and
addition/removal of layers is not handled by the control to give
the user more options, as suggested by @elemoine.
This commit is contained in:
ahocevar
2013-08-22 19:29:08 +02:00
parent a417b75c1f
commit c6e61e2d23
4 changed files with 54 additions and 89 deletions

View File

@@ -205,7 +205,8 @@
* @typedef {Object} ol.control.SelectOptions
* @property {string|undefined} className CSS class name. Default is 'ol-select'.
* @property {Element|undefined} element Element.
* @property {Array.<ol.layer.Layer>} layers Layers to select features on.
* @property {undefined|function(ol.layer.Layer):boolean} layerFilter Filter
* function to restrict selection to a subset of layers.
* @property {ol.Map|undefined} map Map.
* @property {Element|undefined} target Target.
*/