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

Style selected shape

2 Answers 65 Views
Map
This is a migrated thread and some comments may be shown as answers.
mc
Top achievements
Rank 1
mc asked on 02 Aug 2019, 08:35 AM

Hi Progress,

I have a read-only RadMap (ie no selection changing by mouse/touch) where the selected shape is chosen following selection of an item in a ListView.  I have configured a MapShapeStyleSelector as per the instructions in [ShapeStyleSelector](https://docs.telerik.com/devtools/universal-windows-platform/controls/radmap/styling/shapestyling#shapestyleselector).

I originally coded the app using a main Page for the ListView and a separate Page for the map: when the user changed the selection in the Main Page and navigated back to the Page with the map, the newly selected shape was Styled according to the MapShapeLayer's ShapeStyleSelector.

I have since changed to use only one Page, and the ListView is now contained in a RadSideDrawer on the page.  The map correctly styles the shape when it is first chosen.  However, when the user opens the side-drawer and selects a different item, while the map still correctly updates ZoomLevel and Center to show the newly selected shape, it doesn't call SelectStyleCore in the MapShapeStyleSelector to style it.

How do I call a MapShapeLayer's SelectStyleCore when the user changes the selection in a ListView in the Page's side-drawer?

 

2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 07 Aug 2019, 08:39 AM
Hello mc alex,

Thank you for describing in details the scenario you have.

I am not familiar with the exact implementation, still, I would suggest you try to reset the ShapeStyleSelector the Map is using - just preserve it in a temporary variable, set it to null and then re-assign it - this will force the SelectStyleCore method and the new styles would be applied.

If this does not help, please send me more details on the implementation (some code snippets would be useful), so I could research for a different approach.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
mc
Top achievements
Rank 1
answered on 12 Aug 2019, 06:40 AM

Hi Yana,

Your suggestion worked. :-)   I have set the ListView to recreate the ShapeLayer's ShapeStyleSelector on its SelectionChanged event.   I was trying to engineer a pure mvvm solution, but I'm guessing this isn't possible.   

Many thanks

mcalex

Tags
Map
Asked by
mc
Top achievements
Rank 1
Answers by
Yana
Telerik team
mc
Top achievements
Rank 1
Share this question
or