[OpenLayers-Users] Unselecting multiple features

Ivan Grcic igrcic at gmail.com
Tue Jul 28 10:11:18 EDT 2009


Hi Florian,

are you maybe using other SelectFeature  with highlightedOnly
property? Maybe its related to this issue that I opened yesterday:

http://trac.openlayers.org/ticket/2205

On Tue, Jul 28, 2009 at 3:23 PM, Florian
Diederichs<florian_diederichs at hotmail.com> wrote:
>
>
> Eric Lemoine-2-2 wrote:
>>
>>
>> Hi. I know what's going on: when selecting features by drawing a box
>> the feature handler does not participate in the selection so it never
>> triggers the clickout callback. I don't see any other way than faking
>> the feature handler, see the patch attached to this email.
>>
>> 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
>>
>> Index: lib/OpenLayers/Control/SelectFeature.js
>> ===================================================================
>> --- lib/OpenLayers/Control/SelectFeature.js   (revision 9573)
>> +++ lib/OpenLayers/Control/SelectFeature.js   (working copy)
>> @@ -540,6 +540,11 @@
>>                  }
>>              }
>>              this.multiple = prevMultiple;
>> +            // fake the feature handler to allow unselecting
>> +            // features on clickout
>> +            if(layer.selectedFeatures.length > 0) {
>> +                this.handlers.feature.lastFeature =
>> layer.selectedFeatures[0];
>> +            }
>>          }
>>      },
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>
> Hi, thanks a lot for the patch, unselecting now works all the time.
>
> However with my own application, there still remains the second problem,
> which i is my fault i guess, as i can't recreate it with the example
> application.
> Maybe someone has an idea what exactly might be the problem without reading
> my code which surely would be a pain for u ;)
>
> My second problem is: When i unselect multiple features, only one of them
> gets redrawn as unselected. The selectedfeatures-array of the layer is empty
> however.
>
> Thanks in advance
> Florian
>
> --
> View this message in context: http://n2.nabble.com/Unselecting-multiple-features-tp3332986p3342589.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
>



-- 
Ivan Grcic



More information about the Users mailing list