Map control in WinUI 3

1 Answer 124 Views
Map
sungil
Top achievements
Rank 1
sungil asked on 05 Sep 2023, 06:11 AM

Hello 

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

Sort by
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 -->
		<Path x: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).

I hope that helps.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Map
Asked by
sungil
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or