This is a migrated thread and some comments may be shown as answers.

Rectangle selection on Visualization Layer

3 Answers 70 Views
Map
This is a migrated thread and some comments may be shown as answers.
Pavel
Top achievements
Rank 1
Pavel asked on 25 Oct 2019, 08:54 AM
Hello. When i using rectangle selection via lshift key and select the objects, and i already have selected objects, layer unselect previous objects. How i can add objects in to selected objects collection via rectangle selection?

3 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 30 Oct 2019, 08:05 AM

Hello Pavel,

Your scenario sounds like multiple selection mode. The selection functionality of the VisualizationLayer mimics the extended selection mode. In a few words using rectangle selection will select only the items inside the rectangle and unselect the ones out of it.

What comes up to my mind is to use custom code to achieve this. I will use the VisualizationLayerItemsSelection SDK example, for example. Inside the LayerSelectionChanged event handler, I am removing the logic for setting the IsSelected property to false. This way creating the rectangle will select all items inside and don't unselect the others. A question here arises, how to unselect an item then. You could do this using an attached property. You can subscribe to the MouseDown event of the MapPinPoint.

For your convenience, I have modified the SDK example to demonstrate this. You can additionally extend this approach, so it covers all your cases.

Regards,
Dinko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Pavel
Top achievements
Rank 1
answered on 30 Oct 2019, 09:08 AM
Thanks for the answer, but i'm using the PathData class (MapShapeData) for items, and IsSelected is have only get option.
0
Dinko | Tech Support Engineer
Telerik team
answered on 04 Nov 2019, 07:55 AM

Hello Pavel,

You are right the IsSelected property has only a getter. I have searched for a possible solution but wasn't able to find a suitable one to fit in your case. I am afraid I can suggest a workaround for this particular case when using Map Shape Data objects.

Regards,
Dinko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Map
Asked by
Pavel
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Pavel
Top achievements
Rank 1
Share this question
or