Closed DmitrikSerhiy closed 3 months ago
@jfversluis do you know what the state of maps is in .NET MAUI? This package was only intended to be a stop gap until .NET MAUI supported maps on Windows. I thought the team had announced supporting it at some point however, I see the docs still states that it isn't supported https://learn.microsoft.com/dotnet/maui/user-interface/controls/map?view=net-maui-8.0
We're waiting until the WinUI team finished their work on 1.5 and then we can hook it up for .NET MAUI.
Work is being tracked here: https://github.com/dotnet/maui/issues/20356
@bijington It's clear the map from MAUI is not supported for Windows. This issue is regarding the map from CommunityToolkit.Maui.Maps package. The map itself works. Webview contains a map from Bing. But It seems it does not support rendering map elements on it. Am I right?
I am unable to verify the issue right now as my Windows setup is a complete mess. I was mostly trying to see if this was something we could pass over to the .NET MAUI team but I guess we cannot.
From looking at the code this was indeed never implemented on our side for Windows.
Depending on how easy/hard it is to do we should consider if it's worth it seeing that this should be supported by .NET MAUI directly in the foreseeable future.
@DmitrikSerhiy Try to add elements on Loaded, like this:
private readonly Circle _circle;
public CustomMap()
{
_circle = new Circle
{
// any properties
}
Loaded += OnLoaded;
}
private void OnLoaded(object? sender, EventArgs e)
{
MapElements.Add(_circle);
}
I've tried this approach. It has no difference.
I am setting the map in the OnAppering method of the page. Then I add map element to the collection in Loaded event. Map does not reflect MapElements collection. Debug shows that collection is populated. But it simply does not mean anything. Nothing renders in the map.
If that would be the case, then pins wouldn't work as well. But pins are rendered no matter when you add them to the Pins collection.
According to @jfversluis it's just not implemented for windows. And we have to wait for WinUI team Map control implementation and THEN wait a bit more for the MAUI team to implement appropriate Map handler and THEN wait just a little bit more for the CommunityToolkit.Maui.Maps package maintainers to hook it up and actually implement it.
The bottom line is don't expect it within this year (IMHO)
I can't afford to wait so long. I am switching to ArcGIS maps for MAUI.
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
The map never shows any map elements.
Expected Behavior
When MapElement is added to the MapElements collection, it should be rendered on the map.
Steps To Reproduce
Link to public reproduction project repository
https://github.com/CommunityToolkit/Maui/tree/main/samples/CommunityToolkit.Maui.Sample/Pages/Views/Maps
Environment
Anything else?
I have a strong feeling that it's not supported. I have yet to find a working example with a map having any element in your repository or any other.