Re: [OpenLayers-Users] Unselecting multiple features

2009-07-28 Thread Ivan Grcic
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 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.lemo...@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@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@openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Ivan Grcic
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Unselecting multiple features

2009-07-28 Thread Florian Diederichs


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.lemo...@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@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@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Unselecting multiple features

2009-07-28 Thread Eric Lemoine
On Tue, Jul 28, 2009 at 9:05 AM, Eric
Lemoine wrote:
> On Mon, Jul 27, 2009 at 12:02 PM, Florian
> Diederichs wrote:
>>
>> Hi all,
>>
>> I have encountered a problem with the SelectFeature-Control. I wonder if
>> anybody has a workaround/patch, knows anything, or is seeing something I am
>> not. Any help would be very much appreciated.
>>
>> The problems arises every time I use this function:
>>
>> select: new OpenLayers.Control.SelectFeature(
>>                        kunden,
>>                        {
>>                                onSelect: onFeatureSelect,
>>                                onUnselect: onFeatureUnselect,
>>                                clickout: true, toggle: true,
>>                                multiple: true, hover: false,
>>                                box: true,
>>                                toggleKey: "ctrlKey",
>>                                multipleKey: "shiftKey"
>>                        }
>>                )
>>
>>
>> It can also be found at http://openlayers.org/dev/examples/ - Open Layers
>> Select Feature Example.
>>
>>
>> When you first draw some points and then select the control allowing you to
>> select multiple features with a box, unselecting by clicking out isn't
>> working. (With "click out to unselect features" = true of course). Only when
>> you click on one of the features, the others get unselected. After that,
>> unselecting by clicking out works sort of.
>>
>> Because then, when you unselect by clicking out, only the feature that got
>> selected last is rendered as unselected, the others remain in their
>> graphical state of being selected. Although they aren't selected, at least
>> they are not in the selectedfeatures array of the layer.
>>
>> I wonder if anybody has a workaround/patch, knows anything, or if i'm just
>> doing something wrong. Help would be very much appreciated.
>
> 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.

I created a ticket for this.





-- 
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.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Unselecting multiple features

2009-07-28 Thread Eric Lemoine
On Mon, Jul 27, 2009 at 12:02 PM, Florian
Diederichs wrote:
>
> Hi all,
>
> I have encountered a problem with the SelectFeature-Control. I wonder if
> anybody has a workaround/patch, knows anything, or is seeing something I am
> not. Any help would be very much appreciated.
>
> The problems arises every time I use this function:
>
> select: new OpenLayers.Control.SelectFeature(
>                        kunden,
>                        {
>                                onSelect: onFeatureSelect,
>                                onUnselect: onFeatureUnselect,
>                                clickout: true, toggle: true,
>                                multiple: true, hover: false,
>                                box: true,
>                                toggleKey: "ctrlKey",
>                                multipleKey: "shiftKey"
>                        }
>                )
>
>
> It can also be found at http://openlayers.org/dev/examples/ - Open Layers
> Select Feature Example.
>
>
> When you first draw some points and then select the control allowing you to
> select multiple features with a box, unselecting by clicking out isn't
> working. (With "click out to unselect features" = true of course). Only when
> you click on one of the features, the others get unselected. After that,
> unselecting by clicking out works sort of.
>
> Because then, when you unselect by clicking out, only the feature that got
> selected last is rendered as unselected, the others remain in their
> graphical state of being selected. Although they aren't selected, at least
> they are not in the selectedfeatures array of the layer.
>
> I wonder if anybody has a workaround/patch, knows anything, or if i'm just
> doing something wrong. Help would be very much appreciated.

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.lemo...@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@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] Unselecting multiple features

2009-07-27 Thread Florian Diederichs

Hi all,

I have encountered a problem with the SelectFeature-Control. I wonder if
anybody has a workaround/patch, knows anything, or is seeing something I am
not. Any help would be very much appreciated.
 
The problems arises every time I use this function:

select: new OpenLayers.Control.SelectFeature(
kunden,
{
onSelect: onFeatureSelect, 
onUnselect: onFeatureUnselect,
clickout: true, toggle: true,
multiple: true, hover: false,
box: true,
toggleKey: "ctrlKey", 
multipleKey: "shiftKey" 
}
)


It can also be found at http://openlayers.org/dev/examples/ - Open Layers
Select Feature Example.


When you first draw some points and then select the control allowing you to
select multiple features with a box, unselecting by clicking out isn't
working. (With "click out to unselect features" = true of course). Only when
you click on one of the features, the others get unselected. After that,
unselecting by clicking out works sort of.

Because then, when you unselect by clicking out, only the feature that got
selected last is rendered as unselected, the others remain in their
graphical state of being selected. Although they aren't selected, at least
they are not in the selectedfeatures array of the layer.

I wonder if anybody has a workaround/patch, knows anything, or if i'm just
doing something wrong. Help would be very much appreciated.


Thanks in advance
Florian
-- 
View this message in context: 
http://n2.nabble.com/Unselecting-multiple-features-tp3332986p3332986.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users