I would like to iterate through all of the added layers in an ol.Map
instance and only select the vector layers. So far I could get the individual layers with the a
property of the resulting object of map.getLayers()
. As you can see on the image below, a
is an array and contains an object related to the corresponding layer.
The layers in the array are described with a letter (T for tile, V for vector). My question is, how to extract that information for my script to process?
I have read a related post with an answer using a .CLASS_NAME
property, but the OpenLayers 3 ol.layer
object doesn't have such attribute.
Any other approach to get the layer type or proven fact, that one can't get this property after the layer objects are constructed is considered as a correct answer.