Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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.
The class should be OpenLayers.Layer.Vector not Vector. So your code should be:
Required, but never shown