Hello,
this work forAndroid, but how do i put the windows only map
·CommunityToolkit.Maui.Maps· is a supplement to using the Map control on the Windows platform. Therefore, on Windows, you do not need to distinguish it from other platforms, the application will automatically switch the API used by the map. The reason why your map cannot be displayed as expected on Windows is due to the referenced namespace.
When using this package, you do not need to reference the map control in xaml with xmlns:maps="http://schemas.microsoft.com/dotnet/2021/maui/maps"
, but you need to use xmlns:maps="clr-namespace:Microsoft.Maui.Controls.Maps;assembly=Microsoft.Maui.Controls.Maps"
.
After declaring the namespace in the above way, you can directly use <maps:Map x:Name="map" />
, and Maui will automatically switch to Bing maps when running on Windows.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.