[OpenLayers-Users] displaying Features

Eric Lemoine Eric.Lemoine at camptocamp.com
Wed Mar 7 09:23:10 EST 2007


On 3/7/07, Eric Lemoine <Eric.Lemoine at camptocamp.com> wrote:
> On 3/6/07, Keith <kweber at archetypecorp.com> wrote:
> >
> >
> >
> >
> > I've been playing around with the feature object, but I can't get the marker
> > attribute to display on the map.
> >
> >
> >
> > I suspect that this is because I don't know the correct method for adding a
> > feature to a layer.  This seems like a trivial problem, but I haven't found
> > a function that straight up adds a feature to the layer.  I have included a
> > "dumbed-down" version of the code I'm working with below.
> >
> >
> >
> > I'm hoping to use the feature as the object in the event register call, so
> > that I can access its attributes doing the mousedown event.  I'd be very
> > appreciative if someone can clue me into how to accomplish this.
> >
> >
> >
> > Am I missing anything else?
>
> For markers, you must crea

[Hit the send button to fast]

For markers, you must use a layer of type OpenLayers.Layer.Markers.
Then you can add your markers using that layer's addMarker() method.

Hope this helps,


-- 
Eric



More information about the Users mailing list