[OpenLayers-Users] Control.SelectFeature issue on FF (but not on Chrome)

Andreas Hocevar ahocevar at opengeo.org
Mon May 24 05:01:58 EDT 2010


Oh, and I was the reviewer. Great!

Well in that case, the solution to the OP's problem is to reconfigure the control with the new set of layers after adding/removing layers, instead of creating a new control with a new layer.

Regards,
Andreas.

On May 24, 2010, at 07:21 , Bart van den Eijnden wrote:

> We added this in 2.9.1 right?
> 
> http://trac.openlayers.org/ticket/2340
> 
> Best regards,
> Bart
> 
> On May 24, 2010, at 1:53 AM, Andreas Hocevar wrote:
> 
>> I think the proper way to solve this would be a setLayers method for the SelectFeature control.
>> 
>> Regards,
>> Andreas.
>> 
>> On May 21, 2010, at 12:33 , Alessandro Pasotti wrote:
>> 
>>> In data venerdì 21 maggio 2010 12:19:37, Frederic Junod ha scritto:
>>> : > Hello,
>>>> 
>>>> On Fri, May 21, 2010 at 12:08 PM, Alessandro Pasotti <ale.pas at tiscali.it> 
>>> wrote:
>>>>> Hello,
>>>>> 
>>>>> I've discovered a strange behaviour (bug?) with FF and select control.
>>>>> 
>>>>> Basically, it happens when you already have an active  control
>>>>> Control.SelectFeature attached to a layer and you add a new layer with
>>>>> its own Control.SelectFeature, on FF the control attached to the first
>>>>> layer will cease to react to click events.
>>>>> 
>>>>> See a live example here (test it on FF and Chrome):
>>>>> 
>>>>> http://www.parconord.milano.it/ol_ko.html
>>>>> 
>>>>> I don't need a workaround (I've already found one), but I would be happy
>>>>> to understand why it happens.
>>>>> 
>>>>> 
>>>>> Tested on:
>>>>> FF 3.6.3 Linux
>>>>> Chromium
>>>>> 5.0.389.0 (45661) Ubuntu
>>> 
>>> 
>>>> Same behavior here.
>>>> But it works when the 2 vector layers are passed to the SelectFeature
>>>> control: new OpenLayers.Control.SelectFeature([vectorLayer, vectorLayer2],
>>>> { clickout: true, hover: false });
>>>> 
>>>> Is that what you used ?
>>>> 
>>>> fredj
>>>> 
>>> 
>>> Hi,
>>> 
>>> Yes, it works if you pass both layers simultanously to the control init, but 
>>> in my project the layers were added dynamically so that was not the ideal 
>>> solution. 
>>> 
>>> The workaround is to scan existing layers and pass them all every time you add 
>>> a new control.
>>> 
>>> But the question remains: why does it work fine on Chrome and fail on FF ?
>>> 
>>> Is this a bug in ol, in FF or is it just Chrome that has an odd behaviour ?
>>> 
>>> 
>>> 
>>> -- 
>>> Alessandro Pasotti
>>> itOpen - "Open Solutions for the Net Age"
>>> w3:  www.itopen.it
>>> Linux User# 167502
>>> _______________________________________________
>>> 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
>> 
> 



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list