Hello Team,
I have a requirement to show a real-time user location trail on the ArcGIS map, and was referring to Show location history | ArcGIS for Developers to show the user's real-time location. Referring to the link I am trying to use SystemLocationDataSource but I can't access it in Esri.ArcGISRunTime.Location. I am using Esri.ArcGISRunTime.Xamarin.Forms(100.7.0) version, and also tried with version 100.6.0 and 100.7.0 but the same issue persists. I checked Assembly Browser, and can't find this class inside Esri.ArcGISRunTime.Location in my project but when I access it through the ArcGIS git project(arcgis-runtime-samples-dotnet/src/Forms at master · Esri/arcgis-runtime-samples-dotnet · GitHub ) it is available(Attaching assembly info of both the projects).
I really can't figure out what am I missing here. Any Help will be appreciated.
Thanks,
Kavita
Hello Morten,
1. Yes, the LocationChanged event is giving the location every time it changes, but I need latitude, longitude coordinates of every location point that I get from the LocationChanged event for another use case. So, how can I achieve that?
2. I checked it on IOS by switching off the internet and was getting location coordinates, will also check on Android and Windows.
3. I have done the backgrounding configuration for all IOS, Android, and Windows platforms and also I am able to get location points with another Xamarin service when the app is in the background but when I checked LocationDataSource I found that when the app is in background LocationChanged is not getting called, and when the app comes in the foreground again LocationChanged starts getting called. Does any other configuration need to be done for this to work in the background? Or it actually doesn't support backgrounding?
1. I'm not sure what you're asking? You mentioned the LocationChanged event, and that's what you'd use to get the location every time it's updated. The location is on the event arguments.
2. LocationDataSource doesn't use the map - it uses the built-in location service - if that can get a location, so can we (I think in flight mode for instance the GPS chip is off too). So it depends on the device.
3. Running applications in the background is a very platform specific question. I'd suggest you look at Android, iOS and Windows documentation regarding configuring you app to continue getting location updates while in the background.
Thank you so much for your reply. I am able to get location coordinates with the workaround you suggested in the above link. I have few more queries based on this same real-time user location tracking:
1. I need to get the latitude, longitude coordinates from the MapPoint that I am getting from the LocationChanged event of LocationDataSource. Do you have any idea how can I achieve this?
2. Does this real-time tracking with LocationDataSource work with offline maps as well?
3. Does this real-time tracking with LocationDataSource work when the application is in the background?
As mentioned above, I am referring the ArcGIS Show location history | ArcGIS for Developers for real-time user location trail and I have initialized my LocationDataSource with below code as suggested by you:
LocationDataSource_locationDataSource = (LocationDataSource)Activator.CreateInstance(locDStype);MyMapView.LocationDisplay.DataSource = _locationDataSource;
Can you please help me with these queries.
Thanks in advance.
See my response here: https://community.esri.com/message/933576-re-how-do-i-get-a-reference-to-systemlocationdatasource-in-net-standard-librar…
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.