-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
t/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
I get that the Map control is not supported on windows so as a workaround I use a WebView. The map is part of a more complex page but the important bit of XAML looks like:
xmlns:maps="http://schemas.microsoft.com/dotnet/2021/maui/maps"
...
<maps:Map IsEnabled="{OnPlatform false, iOS=true, Android=true}"/>Trouble is, this fails at runtime, either it throws HandlerNotFoundException because UseMauiMaps was not called or the call on UseMauiMaps fails with a "Map not supported on Windows" message.
I have a workaround, so this is a low priority issue for me.
Steps to Reproduce
- Create a default MAUI app
2 Insert the Map control NuGet (Microsoft.Maui.Controls.Maps, I used 10.0.50)
3 Either insertUseMauiMaps()as recommended, or don't, both ways will fail.
Link to public reproduction project repository
https://github.com/david-maw/MauiMap.git
Version with bug
10.0.50
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
No response
Affected platforms
Windows
Affected platform versions
Windows 11
Did you find any workaround?
Yes, I moved the control creation out of XAML and into conditional code so it does not get created on Windows. I also guarded the UseMauiMaps invocation with if !WINDOWS.
Relevant log output
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
t/bugSomething isn't workingSomething isn't working