microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.33k stars 676 forks source link

Question: When is MapControl coming to WinUI 3.x? #3024

Closed robloo closed 10 months ago

robloo commented 4 years ago

I have an app that depends on MapControl which isn't currently supported by WinUI 3.0. When might I expect that to be added?

WinUI 3.0 Preview 2 lists MapControl as a missing platform feature with no timeline given. https://docs.microsoft.com/en-us/windows/apps/winui/winui3/#missing-platform-features

I don't even need all the advanced functionality -- just something that shows a 2D map and allows pins to be added.

robloo commented 4 years ago

Adding @YuliKl who seems to be assigned MapControl-related issues.

robloo commented 4 years ago

@YuliKl Any news on this?

robloo commented 4 years ago

@YuliKl @StephenLPeters Any updates on this? This is going to end up being a show stopper for me using winUI 3. It's pretty important this gets on a roadmap so plans can be made one way or another.

StephenLPeters commented 4 years ago

@Austin-Lamb or @MikeHillberg ?

robloo commented 3 years ago

On the latest roadmap this is considered a stretch goal even after 3.0 release. I'm guessing that means this control might not get updated for years -- if ever. What is the alternative? I could use Bing maps hosted in WebView2 if only it was possible to put pins on the map. Bing doesn't support that though. Can we get that team involved and come up with something at least in the interim?

p2pbsh commented 3 years ago

Bump on this one. The MapControl is pretty much the centrepiece of my UWP app, seeing it listed as stretch goal of 3.x is slightly ominous in regards of me being able to adopt WinUI. Could someone please elaborate with some more concrete info on the plans for MapControl please?

ryandemopoulos commented 3 years ago

Hey @robloo, we don't have a specific timeframe for a Map control, but I suspect it will be a while. We tried to indicate this in our public feature roadmap (see the last row in the table at the bottom of the page). I could see us adding it in a 3.x point release after 3.0 ships, but I doubt it would be 3.1 or 3.2, which very likely will be focused on other things like Acrylic, XAML Islands, more WPF parity functionality, tooling innovation, and broadening the set of Windows devices we run on.

While that's definitely no the answer you're looking for, WinUI 2 will continue to be maintained and invested-in so using a system XAML/WinUI 2-powered stack would provide that for you. Or, since WinUI 3 will offer a lot of hosting flexibility given it's coming interoperability with HWNDs, perhaps there could be other 3rd party options to power a map experience. Not sure if those alternatives could work for you until we get to a MapControl.

robloo commented 3 years ago

@ryandemopoulos Thanks for your response. I do realize it was added to the roadmap some months ago and the latest comments reflect that. You are correct that that's not the answer I was hoping for but it was basically what I was expecting at this point. You have got to understand how difficult of a place you are putting UWP developers in. I'm now locked out of .net 5, c#9 and WinUI3 for 1-2 years without major rewrites to the app. UWP developers, who invested in Microsofts latest technology, are getting burned in several ways here.

I guess you have made your WinUI decisions knowing full well it would have some negative impact to those heavily invested in UWP. You made that decision based on UWP usage numbers most likely. Still, I think something should have been done to keep UWP developers from being impacted in this way. They are really the most loyal developers - or those most heavily invested in the tech becoming WinUI3 at this point.

Reguardless, I have no choice but to pursue rewrites for the MapControl and other missing functionality in WinUI3. I appreciate at least being able to firmly plan on that now.

Its also great you are focusing on closing the feature gap with WPF. Wish it was done 2-3 years ago but better late than never.

Keep up the good work with WinUI3. Its unfortunate I'm in the position I am but overall it will be beneficial to Windows. Hoping a lot of the decisions you are making are also to update the shell and Microsoft's legacy apps.

mdtauk commented 3 years ago

You do have to wonder if it would not be better, easier, and more futureproof, to perhaps transition away from a MapControl, and instead offer a WebView/WebView2 implementation, so future updates can come online. And who knows, maybe even enable Apple Maps and Google Maps support at some point by having a ServiceProvider API

p2pbsh commented 3 years ago

@ryandemopoulos Thanks for the update. Much like @robloo it's a frustrating time to be a UWP developer, seeing the platform placed on the back burner having committed to it. What I would personally like to see if feasible would be an update of the roadmap that offers clear milestones with migration paths for UWP developers. For example:

I'm not particularly bothered by MS deciding to pull the plug on UWP which appears to be the case, makes sense in a lot of ways, just want to be confident the pathway exists to move my work to a WinUI based framework and have an approximate idea of timescales so I can plan ahead accordingly. I'd argue that a complete 'escape route' for UWP devs should really be in place by the time .NET6 drops.

leoniDEV commented 3 years ago

@mdtauk But for example with MapControl you can leverage offline maps!

robloo commented 3 years ago

@mdtauk I looked into using a map within webview already. The issue is the APIs dont support really anything. MapControl has a lot of advanced functionality to draw on the map. I only need push pin support in my case; however, I can't even place multiple pins with any online maps provider and control the zoom level. Best I can do with tricks is to place a single pin. No offline support is unfortunate as well but would be tolerable if anything else worked.

MapControls are expensive to implement primarily due to the data. Even using OpenStreetMaps you have to pay for rendered tile server data. Otherwise, adding this functionality, and storage capacity to your company's existing servers is not cheap.

robloo commented 3 years ago

It anyone knows of some fancy math or techniques that could be used to calculate the geographical position coordinates of the pixels in a Google or Bing maps there are some ideas. It might be possible to write a new control using a layered technique and manually drawing on top of a webview2 containing the map on the bottom layer. Keeping things positional synronized during movement would also be difficult though. Recalculation when the underlying map changed projection modes would be nearly impossible I suspect.

mdtauk commented 3 years ago

It anyone knows of some fancy math or techniques that could be used to calculate the geographical position coordinates of the pixels in a Google or Bing maps there are some ideas. It might be possible to write a new control using a layered technique and manually drawing on top of a webview2 containing the map on the bottom layer. Keeping things positional synronized during movement would also be difficult though. Recalculation when the underlying map changed projection modes would be nearly impossible I suspect.

If Microsoft were to go the wrapped WebView approach with a future Map Control - it would need to have Offline data support, as well as supporting the drawing of polygons on-top of the map layers. It would also need to be hardware accelerated.

Chromium can do all this, using PWA tech AFAIK.

robloo commented 3 years ago

The link below seems to be the best control available for replacement. However, I don't think it's simple to use without a paid map provider. It does support some offline tile data formats though.

https://github.com/Mapsui/Mapsui https://mapsui.com/documentation/getting-started-wpf.html (UWP is the same)

Mogikan commented 3 years ago

I haven't thought WinUI 3.0 could be incompatible with existing UWP app. Please provide controls which were available in UWP. It is a bad tone to decide to throw away controls! This is a really a blocker problem for me to start migration to the new platform.

wjax commented 3 years ago

I have tumbled here because I wanted to evaluate porting my WPF app to WinUI. I wanted to use the great Map Control from UWP... Seems there is no chance and I will keep using my old but bullet proof WPF Win32 apps.

venklar commented 3 years ago

I second all of the above: Map Control is required ASAP! I work on GIS and for me the lack of a Map control is a blocker to addapting WinUI 3.

Not sure but I think using Uno Platform it's possible to use both WinUI and UWP Map Control?... Still not prod ready though :(

@ryandemopoulos is there a way for devs to vote on roadmap features? Thanks

nesherhh commented 2 years ago

I have ported XAML Islands to .NET 5. It is possible to use MapControl in .NET 5/6. https://github.com/nesherhh/XamlIslandsNET5

wjax commented 2 years ago

Thanks Daniel.

Super great :) I will take a look

El mié, 20 oct 2021 a las 8:53, Daniels Danilins @.***>) escribió:

I have ported XAML Islands to .NET 5. It is possible to use MapControl in .NET 5/6. https://github.com/nesherhh/XamlIslandsNET5

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/microsoft-ui-xaml/issues/3024#issuecomment-947380127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLVHSXYF36GRNXCIQN5ZTUHZROTANCNFSM4PQ734YA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

robloo commented 2 years ago

@nesherhh Very interesting and a good solution. This might be a great idea to unblock some WinUI 3 ports.

Mogikan commented 2 years ago

Hi, I see that MapControl disappeared from Roadmap. What does it mean? Is it supported in WinUI 3.0 or it will never be implemented? https://github.com/microsoft/microsoft-ui-xaml/blob/main/docs/roadmap.md

DaveAurionix commented 2 years ago

Placing the emphasis a little differently here - the existing UWP MapControl is great. Native mapping performance on Windows devices, with multiple input devices supported, powerful customisations, lines, shapes, pins and completely customisable styling. Offline maps support. It fills a niche. Yes, it has a couple of bugs here and there (like disappearing labels). I'd absolutely love to see this ported to WinUI3 (to unblock an app I work on from moving to WinUI3), and maybe have a couple of the bugs fixed too. I'd really prefer not to go this far, but if anyone at Microsoft does want to employ a software engineer to help get the job done from the UWP source code, DM me! As an end-user of the UWP MapControl, I understand the end goal of the WinUI3 port too. I'd love to see a WinUI3 port done by Microsoft, but failing that I'd love to help get it done myself!

JORGEGO commented 1 year ago

It is unheard of how the community of developers and companies that opted for UWP for Xamarin Forms and have applications developed with use of map control can be left without a solution and now there is no clear solution, nor plan to offer the MAUI team a map control to integrate it into MAUI, it is incredible and at the same time worrying, the question is: what do we do?!!!!!!!

robloo commented 1 year ago

It isn't unheard of. Microsoft has done the same type of thing (clear loss of features and functionality) going from WPF to UWP. In this case there is even less of a concern because there were far fewer UWP apps.

https://github.com/microsoft/microsoft-ui-xaml/issues/3639

p2pbsh commented 1 year ago

In the end I swapped out for MAPSUI. Worked well for me, may work for you:

https://github.com/Mapsui/Mapsui

JORGEGO commented 1 year ago

In the end I swapped out for MAPSUI. Worked well for me, may work for you:

https://github.com/Mapsui/Mapsui

I will test, who is supporting this control?

p2pbsh commented 1 year ago

I will test, who is supporting this control?

It's a community project, but actively maintained, the main guys working on it are pretty on it.

To be fair, the old MS UWP control has some terrible performance issues and would cause random crashes to desktop, which were never fixed. I've found mapsui to be very solid, also far more powerful it terms of functionality once you get your head round how it all bolts together.

JORGEGO commented 1 year ago

I am considering using this component, I find it very interesting, I have been testing it and it has a very good performance. I have tried it on Windows, I have to try it on Android and iOS, the question is about Android and iOS does it use the capabilities of Android and iOS, read for these two platforms does it act as Map MAUI control? The next question is, now it is in preview and there is no cost, is there any kind of licensing planned in the future?

robloo commented 1 year ago

On my end MapsUI was used as well (as indicated above). That's possible now that it is MIT licenced. It works with Avalonia now as well which is being moved to away from WinUI.

p2pbsh commented 1 year ago

I am considering using this component, I find it very interesting, I have been testing it and it has a very good performance. I have tried it on Windows, I have to try it on Android and iOS, the question is about Android and iOS does it use the capabilities of Android and iOS, read for these two platforms does it act as Map MAUI control? The next question is, now it is in preview and there is no cost, is there any kind of licensing planned in the future?

As robloo says, current beta moves everything to MIT, so project trajectory is away from licensing requirements rather than towards them.

Not sure exactly what you mean by device capabilities, but I just finished porting an app to MAUI using device geolocation and compass to indicate users position and direction on map and all working nicely on Android and iOS.

mfeingol commented 1 year ago

So is it fair to say at this point that WinUI will not get a native MapControl for the foreseeable future?

p2pbsh commented 1 year ago

They discussed it in the last WinUI community call, sounded like they still want to do it, but I wouldn't expect seeing it anytime soon.

TFreudi1 commented 1 year ago

The missing map control in WinUI3 blocks me from porting Xamarin App's to NET. MAUI !

Panda-Sharp commented 1 year ago

The missing map control in WinUI3 blocks me from porting Xamarin App's to NET. MAUI !

this...and Ink Canvas Control for us

robloo commented 1 year ago

This is still valid for a lot of people. Windows Community toolkit had to end up wrapping a web control. And we also have Mapsui. But the WinUI team needs to make a decision and report finally if this control will ever come.

mfeingol commented 1 year ago

This is still valid for a lot of people. Windows Community toolkit had to end up wrapping a web control. And we also have Mapsui. But the WinUI team needs to make a decision and report finally if this control will ever come.

Agreed. MapsUI is missing functionality like 3D rendering that make up key use cases in our UWP apps. It's frustrating to not have any signs of life on this topic.

Panda-Sharp commented 1 year ago

This is still valid for a lot of people. Windows Community toolkit had to end up wrapping a web control. And we also have Mapsui. But the WinUI team needs to make a decision and report finally if this control will ever come.

Agreed. MapsUI is missing functionality like 3D rendering that make up key use cases in our UWP apps. It's frustrating to not have any signs of life on this topic.

It's frustrating the sign of life of winui in general 😓

bricelam commented 1 year ago

https://github.com/microsoft/microsoft-ui-xaml/issues/6293#issuecomment-1659818942 gave me a bit of hope. I don't pretend to know how this control would actually be implemented, but hosting the UWP map control inside a XAML island was how they had it working in WinForms and WPF for .NET Core 3. Sadly, .NET Core 3 is out of support and XAML islands stopped working in the next version of .NET.

rmarinho commented 1 year ago

So on MAUI we added to the toolkit a WinUI Map that is a wrapper on a WebPage with bing maps. So if anyone wants to grab some inspiration how to map from c# to javascript and back .. for some basic stuff.

https://github.com/CommunityToolkit/Maui/blob/main/src/CommunityToolkit.Maui.Maps/Handler/Map/MapHandler.Windows.cs

duncanmacmichael commented 10 months ago

Closing this question as the Maps Control is on track to be delivered in the WinAppSDK 1.5, per the currently posted roadmap:

https://github.com/microsoft/WindowsAppSDK/blob/main/docs/roadmap.md

For any questions about the new maps control or suggestions when it arrives, please feel free to open a new issue. Thanks!

robloo commented 10 months ago

I'm surprised this is coming, even if much later than it was needed. Great work on this!

hez2010 commented 8 months ago

Closing this question as the Maps Control is on track to be delivered in the WinAppSDK 1.5, per the currently posted roadmap:

microsoft/WindowsAppSDK@main/docs/roadmap.md

For any questions about the new maps control or suggestions when it arrives, please feel free to open a new issue. Thanks!

@duncanmacmichael Please don't ship the WebView based MapControl, what we expect is a native MapControl just like the one in UWP. And we expect the MapControl to work even if there's no Internet access so that we can still use the offline map data which has been downloaded in advance. Otherwise I can't figure out any reason for not using the native MapControl through UWP XAML Island. The WebView based MapControl is completely useless, we can already do this by using the WebView directly and it's not even necessary to be a control.

moshegutman commented 8 months ago

Please don't ship a non-native control. The Azure Maps base map doesn't come close to the Bing Maps base map. Also, for those of us using the UWP control under a Bing Maps Enterprise Agreement, I don't see how this new control could possibly fulfill the contractual obligations of that agreement.

mfeingol commented 8 months ago

@hez2010: two question:

  1. Why do we think it won't be a native MapControl?
  2. How exactly would one use the UWP MapControl in a WinUI app? Last I checked that project doesn't work beyond .NET 5...
tipa commented 8 months ago
  1. Why do we think it won't be a native MapControl?

https://github.com/microsoft/microsoft-ui-xaml/blob/winui3/release/1.5-stable/controls/dev/MapControl/MapControl.xaml

I agree that a WebView map control just won't do it. I haven't tested it myself but I have a very, very strong feeling that it will be lacking a lot of features compared to the UWP MapControl (e.g. binding a collection that renders XAML on the map) and also performance will be subpar

mfeingol commented 8 months ago

Thanks, @tipa. Looking at the IDL, the API looks extremely basic:

https://github.com/microsoft/microsoft-ui-xaml/blob/winui3/release/1.5-stable/controls/dev/MapControl/MapControl.idl

A deal-breaker for me would be the inability to render MapTileSources. This doesn't bode well...

nesherhh commented 8 months ago

I need pitch, heading and offline functionality. Also traffic and itenary overlays.

Web control can do only 45 or 90 degrees rotation and no offline mode.

I don't understand why they don't build native control. They do have source code for UWP version. How complicated could it be to migrate it to WinUI?

mfeingol commented 8 months ago

Well, I poked around 1.5.240205001-preview1 for a few minutes. It's worse than I expected.

I was unable to get MapControl working beyond a blue Azure screen, despite trying several different Azure/Bing Maps API keys. So I can't comment on how things look or what sorts of controls are in the HTML/JS.

API surface area-wise, it's a complete disaster. I'm not even sure how the Maui folks will implement their relatively limited surface area.

MapTileSource is gone, so no custom tiles are possible.

MapStyle is gone. No way to programmatically select map type.

There's a MapLayer property that does something, but it's unclear how to use it. There's a MapElementsLayer subclass of MapLayer which appears to hold MapElements instead of the usual MapElements property, so at least you can do that.

But MapPolyline and MapPolygon are gone. MapIcon is still alive but has no Title, Image, ZIndex, NormalizedAnchorPoint or anything hinting at customization.

The Children property is also gone, so no XAML elements can be used. Unsurprisingly.

MapRouteView is gone.

CenterChanged and ZoomLevelChanged are gone. MapElementPointerEntered and MapElementPointerExited are gone. FindMapElementsAtOffset, GetVisibleRegion and TrySetViewBoundsAsync are all gone. Good luck actually using this MapControl for anything sophisticated.

Lastly, ColorScheme and MapProjection are gone. ZoomInteractionMode, TiltInteractionMode, PanInteractionMode and RotateInteractionMode are also gone.

And this is just the surface area my app uses. At current course and speed, WinUI is no longer a viable platform for me and I will need to look at third party offerings.

tipa commented 8 months ago

@mfeingol Thanks for testing & reporting. What a joke... I won't even care creating feature requests for these missing (and essential) features, Microsoft obviously has no interest in providing a usable mapping control