[OpenLayers-Users] Accessing individual map layer

Jorge Gaspar Sanz Salinas jsanz at osgeo.org
Sun Nov 13 14:24:25 EST 2011


On 12 November 2011 15:47, allan oware <lumtegis at gmail.com> wrote:
> Hi all,
> I defined a wfs layer and added it on an existing OpenLayers.Map.
> map.addLayer(wfslayer);
> But when I try to access the layer and call a function, I get a 'cannot read
> property of undefined' error.
> map.wfslayer.display();
> Is this the proper way to access layer and call its properties/functions ?
>

See the methods "getLayersBy" of the map class at

http://dev.openlayers.org/releases/OpenLayers-2.11/doc/apidocs/files/OpenLayers/Map-js.html


-- 
Jorge Sanz
http://es.osgeo.org


More information about the Users mailing list