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.
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.
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.
> Yes, the
I'm not following. The event arguments carries all that information (see the Position property): Location Class
I'm no expert in backgrounding for apps. Again the platform documentation is likely a lot better in this regard, as it's not really an esri-runtime specific thing. They should all have examples of how to continue getting location updates while backgrounded - once enabled, our LocationDataSource should continue to work and report updates (as it's just a thin wrapper around the native built-in location APIs).