dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.05k stars 1.73k forks source link

Get Userlocation from map control #14700

Open TFreudi1 opened 1 year ago

TFreudi1 commented 1 year ago

Description

It would be nice to get the geo-userlocation, which is shown on the map if it is enebaled with IsShowingUser.

Public API Changes

Microsoft.Maui.Controls.Maps map;
map.IsShowingUser = true;
Location loc = map.GetCurrentUserLocation()

Intended Use-Case

Get the current Position without own Location logic and code.

drasticactions commented 1 year ago

Like this?

https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/device/geolocation?view=net-maui-7.0&tabs=windows#get-the-current-location

TFreudi1 commented 1 year ago

I know you will say it is technically the same, or it is impossible, but it give me different results. I do that and the "OwnPos" which is shown by the map is sometime different (and more accurate) than that what I get from Geolocation with accuracy BEST.

geoloc_from_map
TFreudi1 commented 1 year ago

In Android the GoogleMap has a member function getMyLocation(), which is depreceated but still works in a current project. If I use that I don't need all that code arround detecting the geolocation myself. In the screen shot above there is a "New Object here" Button (you don't see it, it is below the map) , if the user click's it currently I get the position from Geolocation, but he said that this is sometimes not the position that google maps shows him on screen. To find the error I additionaly paint a circle with the position from Geolocation and we saw that is sometime different and mostly not that accurate as the "own position" from the google map.

ghost commented 11 months ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.