[OpenLayers-Users] Clicking a marker on a marker layer and then calling some code

Robert Hicks robhyx at gmail.com
Fri Jan 8 10:53:20 EST 2010


Thanks for the response! Is marker in the first line their a
OpenLayers.Layer.Markers object or an OpenLayers.Marker?

2010/1/8 Yury Luneff <bitterman at ya.ru>

> marker.events.register("click", this, function(e) {
>        alert(this).
>    });
>
> "click" is the event,
> "this" is context passed to event handler so one could determine which
> marker was clicked using "this" in event handler function.
>
> > Hey all, I was wondering if there were any examples available or if
> > someone could tell me how I would register a mouse event with a
> > bunch of markers in a marker layer. Basically I am going to have a
> > map with several points and depending on what point they click a new
> > page is going to open. For example there are going to be points for
> > each county in a given state and when a user clicks on a given
> > county, the counties web page will load in a new window. I know how
> > to do all of that except for registering different event handlers
> > for each marker. Any ideas/suggestions?
>
> > Thanks!
>
>
>
>
> --
> С уважением,
>  Yury                          mailto:bitterman at ya.ru
>
>


-- 
web http://www.hyxspace.com
aim hyx1138
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100108/e9103398/attachment.html


More information about the Users mailing list