[OpenLayers-Users] get markers from layers?

Franz Buchinger fbuchinger at gmail.com
Fri Aug 13 08:51:54 EDT 2010


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_N_X at 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 at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100813/fd3f9d6a/attachment.html


More information about the Users mailing list