[OpenLayers-Users] Add popup to GML with marker!

Eric Lemoine eric.c2c at gmail.com
Wed Dec 12 02:52:04 EST 2007


On Dec 12, 2007 8:37 AM, Walter Lorenzetti <lorenzetti at faunalia.it> wrote:
> Eric Lemoine ha scritto:
> >>
> >>  but sorry is possible to do that for "onClick" event?
> >>
> >
> > I don't understand. Using the select feature control you should be
> > able to select features by clicking on them. Don't you see your
> > OpenLayers.Console.log message displayed when you click on features?
> >
> > --
> > Eric
> >
> >
> Hi Eric,

Hi

> sure with select feature control I can select, so when I do it
> on my ma the feature graphic icon change to blue circle like a default
> point vector layer select.
>
> So if is not possible onClick control event do you know how I can change
> the graphic vector point layer select?

You can pass a selectStyle option to the select feature control to
specify how to style selected features. Alternatively, you can
override the select() method to implement your own behavior on feature
click. Something like this:

new OpenLayers.Control.SelectFeature(gml, {select: function(feature) {
OpenLayers.Console.log('do my own business here'); }});

Note that there's no garantee that doing this will work accross all OL
versions as the select() method in SelectFeature isn't marked as
APIMethod and may therefore change name in the future.

Hope this helps,

--
Eric



More information about the Users mailing list