OpenLayers.Map object exposes a method call getLayersByClass. How do I use this method to retrieve all of the Vector layers from the map?
I tried map.getLayersByClass("Vector") but this returned an empty array.
openlayers-2vector
OpenLayers.Map object exposes a method call getLayersByClass. How do I use this method to retrieve all of the Vector layers from the map?
I tried map.getLayersByClass("Vector") but this returned an empty array.
Best Answer
The class should be
OpenLayers.Layer.Vector
notVector
. So your code should be: