[OpenLayers-Users] Problem with multiple SelectFeature controls
kencana
bluesky_dyx at hotmail.com
Thu Mar 12 20:28:41 EDT 2009
Hi André,
Thanks for your prompt reply. will work on it and see how it goes. :)
Andre Pereira de Matos wrote:
>
> Sorry, Forgot the code. Here you are.
>
> -----Original Message-----
> From: Andre Pereira de Matos
> Sent: quinta-feira, 12 de Março de 2009 10:31
> To: 'kencana'; users at openlayers.org
> Subject: RE: [OpenLayers-Users] Problem with multiple SelectFeature
> controls
>
> Hi Kencana,
>
> Sure, I send you the code.
>
> I've made two controls and an handler. I've refactored SelectFeature (The
> openlayers control and named it as selectFeatureControl), DragFeature
> (Another openlayers control and named it as DragFeatureControl) and an
> handler, to virtualizes the layers.
>
> To use SelectFeatureControl is as simple as that:
>
> To receive events when a mouseover event occurs you have to register on
> the mouseover event:
>
> SelectFeatureControlInstance.registerEvent(feature, 'mouseover', this,
> function(str){ /*do something*/ }, ['foo'])
>
> To use DragFeatureControl:
>
> This control can make your feature draggable and can throw events like:
> dragstart, drag and dragend. To make a feature draggable you must add the
> feature to the control:
>
> DragFeatureContrlInstance.addFeature(feature)
>
> To receive events like drag, dragend and dragstart you must register a
> listener:
>
> DragFeatureControlInstance.registerEvent(feature, 'drag', this,
> function(str){/* do something */}, ['foo'])
>
>
> As in OpenLayers, to use this controls them must be added to the map.
>
> Best Regards,
> André Matos
>
> http://mapas.sapo.pt
>
>
>
> -----Original Message-----
> From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
> On Behalf Of kencana
> Sent: quinta-feira, 12 de Março de 2009 01:18
> To: users at openlayers.org
> Subject: Re: [OpenLayers-Users] Problem with multiple SelectFeature
> controls
>
>
> 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.
>
> _______________________________________________
> 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-tp2156949p2470949.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list