[OpenLayers-Users] select feature control not working

Imran Rajjad rajjad at gmail.com
Thu Jun 3 07:46:26 EDT 2010


thanks for your reply

I`m using the one that comes with geoserver 1.7.7 . not too sure about
the version. But the select and highlight works. When I tried the code
on my page.. only the highlight control was working with a highlight
color different from the one in example. Later through console i
deactivated the highlight control and then activated the select
control .. then the select control started working .. the events are
also getting triggered.i was hoping to get to the attributes of the
feature clicked at.

On Thu, Jun 3, 2010 at 4:31 PM, Eric Lemoine
<eric.lemoine at camptocamp.com> wrote:
> On Thu, Jun 3, 2010 at 12:01 PM, Imran Rajjad <rajjad at gmail.com> wrote:
>> I`m trying to run a function on clicking and highlighting of a vector
>> layer. the events do not seem to trigger..
>>
>> what am i doing wrong here?
>>
>> my code
>>
>>
>>
>> var report = function(e) { // it will be called when event is trigered
>> from eventListeners
>>                console.log(e.type, e.feature.id);
>>                //alert(e.feature.id);
>>
>>            };
>>
>>            var highlightCtrl = new
>> OpenLayers.Control.SelectFeature(vector_layer, {
>>                hover: true,
>>                highlightOnly: true,
>>                renderIntent: "highlight",
>>                eventListeners: {
>>                    beforefeaturehighlighted: report,
>>                    featurehighlighted: report,
>>                    featureunhighlighted: report
>>                }
>>            });
>>
>>            var selectCtrl = new OpenLayers.Control.SelectFeature(vector_layer,
>>                {clickout: true}
>>            );
>>
>>            map.addControl(highlightCtrl); // add high lighting
>>            map.addControl(selectCtrl); // add selection
>>
>>            highlightCtrl.activate();
>>            selectCtrl.activate();
>
>
> What OpenLayers version do you use? Does the highlight-feature.html
> example of your OpenLayers distribution work?
>
> Cheers,
>
> --
> Eric Lemoine
>
> Camptocamp France SAS
> Savoie Technolac, BP 352
> 73377 Le Bourget du Lac, Cedex
>
> Tel : 00 33 4 79 44 44 96
> Mail : eric.lemoine at camptocamp.com
> http://www.camptocamp.com
>



-- 
I.R



More information about the Users mailing list