[OpenLayers-Users] Problem with multiple SelectFeature controls

kencana bluesky_dyx at hotmail.com
Wed Mar 11 21:17:41 EDT 2009


Hi André,

I am facing the same problem as yours. can I know how you make it
work?perhaps, can you share the code with me?
thank you

Regards,
Kencana 


Andre Pereira de Matos wrote:
> 
> We have implemented another solution for this problem...
> 
> We made a control that throws events (click, mouseover, mouseout) for a
> specific group of features, and we don't mind if the features are in
> different layers or not.
> 
> It just works... If anyone want the code I can share it...
> 
> I sent a mail to openlayers dev to contribut with it, and I am still
> waiting for any replay.
> 
> Regards,
> André Matos
> http://maps.sapo.pt
> 
> 
> -----Original Message-----
> From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
> On Behalf Of Bill Thoen
> Sent: quarta-feira, 14 de Janeiro de 2009 16:43
> To: Joao Campos Duarte (PRIMEIT)
> Cc: users at openlayers.org
> Subject: Re: [OpenLayers-Users] Problem with multiple SelectFeature
> controls
> 
>  From the responses I'm getting in the "[OpenLayers-Users] Switching
> Layers Assigned to a SelectFeature Control" thread and some Googling it
> appears that handling multiple vector layers simultaneously in
> OpenLayers is not well supported. In fact, it basically won't work. Only
> one layer of features can be selectable at a time.
> 
> What I'm trying is to create only one SelectFeature control, but then
> allow the user to pick which layer they want to be "active". After they
> choose, I destroy the current SelectFeature control and replace it with
> a new SelectFeature control that uses the new layer. It's not elegant,
> but it seems to work.
> 
> 
> 
> 
> Joao Duarte wrote:
>>
>> Hi,
>>
>> I've added several GML layers to the map. Each layer contains data
>> from a KML file. The layers are all displayed well, the problem is
>> when I add the SelectFeature control. I tried adding one control to
>> each layer but this has the problem of only the last added layer gets
>> its control working properly.
>>
>> The problem seems to be caused by the Feature handler. If you have
>> many Feature handlers, only the one assigned to the top layer will work.
>>
>> Any suggestions on how I can have multiple SelectFeature controls,
>> each one associated with a different layer, all working?
>>
>> Best regards,
>>
>> João Duarte
>>
>> http://maps.sapo.pt
>>
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Problem-with-multiple-SelectFeature-controls-tp2156949p2464955.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list