Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Maps to handler architecture #3933

Closed
hartez opened this issue Jan 4, 2022 · 19 comments · Fixed by #7886
Closed

Move Maps to handler architecture #3933

hartez opened this issue Jan 4, 2022 · 19 comments · Fixed by #7886

Comments

@hartez
Copy link
Contributor

hartez commented Jan 4, 2022

API changes:

  • Remove Microsoft.Maui.Controls.Maps.Position and use Microsoft.Maui.Devices.Sensors.Location
  • Remove Microsoft.Maui.Controls.Maps.Geocoder and use Microsoft.Maui.Devices.Sensors.Geocoding
  • Change Microsoft.Maui.Controls.Maps.Position on Pin to Microsoft.Maui.Devices.Sensors.Location
  • Change Microsoft.Maui.Controls.Maps.Position on MapClickedEventArgs to Microsoft.Maui.Devices.Sensors.Location
  • Change Microsoft.Maui.Controls.Maps.Position Center on MapSpan to Microsoft.Maui.Devices.Sensors.Location
  • Change Microsoft.Maui.Controls.Maps.Position Geopath on Polyline to Microsoft.Maui.Devices.Sensors.Location
  • Change Microsoft.Maui.Controls.Maps.Position Geopath on Polygon to Microsoft.Maui.Devices.Sensors.Location
  • Remove or make internal Microsoft.Maui.Controls.Maps.GeographyUtils
@jsuarezruiz jsuarezruiz self-assigned this Jan 10, 2022
@jsuarezruiz
Copy link
Contributor

Should it remain a separate library or be part of Core?

@hartez
Copy link
Contributor Author

hartez commented Jan 11, 2022

@Redth Any thoughts on this? I assumed it would still be a separate library.

@Redth
Copy link
Member

Redth commented Jan 11, 2022

Separate library.

@Eilon Eilon added legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor area-controls-map Map / Maps labels Feb 11, 2022
@jfversluis jfversluis added this to the .NET 7 milestone Mar 30, 2022
@DavidBerschauer
Copy link

How high are the chances to see this coming in 2022?

@bricelam
Copy link
Contributor

Note that a Windows handler implementation will probably want to wait for microsoft/microsoft-ui-xaml#3024

@hartez
Copy link
Contributor Author

hartez commented Apr 28, 2022

I think @rachelkang has some plans for this.

@TFreudi1
Copy link

TFreudi1 commented May 9, 2022

I'm also very intrested in the MAP Control or a way to use the native Control like Xamarin do.

@davidortinau
Copy link
Contributor

@TFreudi1 see https://www.cayas.de/blog/dotnet-maui-custom-map-handler

@TFreudi1
Copy link

TFreudi1 commented Jun 8, 2022

I got it to compile, but look there at the screenshot on the blog-page. The android simulator page in the background is empty. Samething is happen to mee, no map in Android. I double checked that I use the right Google-Maps API key. I don't get usefull messages in logcat. I added GPS permissions and try a lot of things the last weeks. It don't looks like an option to get maps in MAUI (Android)

@rmarinho
Copy link
Member

rmarinho commented Jun 30, 2022

These are the changes proposed of changes from Xamarin.Forms to Maui

  • Remove Microsoft.Maui.Controls.Maps.Position and use Microsoft.Maui.Devices.Sensors.Location
  • Remove Microsoft.Maui.Controls.Maps.Geocoder and use Microsoft.Maui.Devices.Sensors.Geocoding
  • Change Microsoft.Maui.Controls.Maps.Position on Pin to Microsoft.Maui.Devices.Sensors.Location
  • Change Microsoft.Maui.Controls.Maps.Position on MapClickedEventArgs to Microsoft.Maui.Devices.Sensors.Location
  • Change Microsoft.Maui.Controls.Maps.Position Center on MapSpan to Microsoft.Maui.Devices.Sensors.Location
  • Change Microsoft.Maui.Controls.Maps.Position Geopath on Polyline to Microsoft.Maui.Devices.Sensors.Location
  • Change Microsoft.Maui.Controls.Maps.Position Geopath on Polygon to Microsoft.Maui.Devices.Sensors.Location
  • Remove or make internal Microsoft.Maui.Controls.Maps.GeographyUtils

For discussion is if Pin and Placemark have something to be shared or not.
Should the name of the properties like Postion on Pin should change to Location since the type changed?

@TFreudi1
Copy link

@davidortinau
@hartez
I got the sample from the cayas page to work now. It is missing _mapView.OnResume(); in the Android platform code. See
https://stackoverflow.com/questions/70976168/how-to-display-google-maps-on-net-maui/72379499?noredirect=1#comment128848674_72379499

@TFreudi1
Copy link

@rmarinho I would change position to location on Pin, but this is my personal opinion. And also you will get a "thumbs up" for the other textual changes, that make more sense in my eyes. I know that some people that need to port from Xamarin will say ... Puh more things to change, more time ... , but for me, who have also have to port some solutions it is better to get an compiler error there and forces me to check if MAUI maybe have an easier solution for that code part.

@Redth Redth added the delighter label Aug 2, 2022
@Redth Redth modified the milestones: .NET 7, 7.0-rc1 Aug 2, 2022
@ryanaw83
Copy link

ryanaw83 commented Aug 3, 2022

When is this planned to be released?

@rmarinho
Copy link
Member

@ryanaw83 on .net7

@Rabosa616
Copy link

@rmarinho will be available for Android, iOS, Mac & Windows or only for mobile devices?

@danbridgellc
Copy link

All these Handler solutions do not address Windows - it just works for Android/iOS/Mac. Does anyone have a solution that includes Windows?

@bricelam
Copy link
Contributor

For Windows support, please upvote microsoft/microsoft-ui-xaml#3024 so they can prioritize appropriately.

@BillyMartin1964
Copy link

Current build displays and shows Location correctly, but has two major bugs:

When adding Map Pins, I get

System.MissingMethodException: 'Method not found: bool Microsoft.Maui.Devices.Sensors.Location.op_Inequality(Microsoft.Maui.Devices.Sensors.Location,Microsoft.Maui.Devices.Sensors.Location)'

When tracking user with polyline, I get this

image

@ghost
Copy link

ghost commented Sep 17, 2022

Hello lovely human, thank you for your comment on this issue. Because this issue has been closed for a period of time, please strongly consider opening a new issue linking to this issue instead to ensure better visibility of your comment. Thank you!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 17, 2022
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.