I am considering to implement our project with WinUI 3 related map controller.
I wat to confirm that WinUI 3 map controller support to draw map arrow with direction on the map?
I need to display arrows on the map.
Thanks
1 Answer, 1 is accepted
0
Martin Ivanov
Telerik team
answered on 06 Sep 2023, 07:14 AM
Hello Sungil,
RadMap doesn't have a built-in arrow, but you can implement one with some custom code. Basically, you can use VisualizationLayer with one FrameworkElement (the arrow visual) in its Items collection.
<telerikDataViz:RadMap><telerikDataViz:RadMap.Provider><telerikMap:EmptyProvider /></telerikDataViz:RadMap.Provider><telerikMap:VisualizationLayer><!-- Currently this path won't visualize anything. You should sets a geometry via its Data property --><Pathx:Name="arrow" Fill="Red"Width="10"Height="10"telerikMap:MapLayer.Location="10, 10"/></telerikMap:VisualizationLayer></telerikDataViz:RadMap>
Then, you can update the arrow location to move it along the map.
MapLayer.SetLocation(this.arrow, new Location(10, 10));
To update the direction of the arrow, you can pre-calculate the geometry of the Path or apply a rotate transformation.
If you prefer you can use another control for the arrow (like an image or custom shape).