You can only retrieve/append markers from/to a markers layer:
http://dev.openlayers.org/apidocs/files/OpenLayers/Layer/Markers-js.html

To retrieve an array of the markers layers in your map use
Map.getLayersByClass("OpenLayers.Layer.Markers"). Make sure that you
previously attached a markers layer to your map.

Franz


2010/8/11 ulao <s_k_u_...@yahoo.com>

>
> I need to devise a way to get an array of markers from a layer...
>
> I see this in the docs OpenLayers. Layer. Markers but under the Layer class
> there is no Marker array ?
>
> for example I tried this
>
> var test = Map.layers
> alert ( test.markers ) // undefined
> alert ( test.Markers ) // undefined
>
> I would also need a way to get features.
>
> Is this the way its intended to work? If so why do i get undefined.
>
> Do I need to reference the [OpenLayers. Layer. Marker]  itself? Can I not
> get to the markers from map?
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/get-markers-from-layers-tp5413201p5413201.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users@openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to