How to I auto locate the user to current location? (ArcGIS Android SDK 100.0.0)?

1554
1
01-12-2017 08:17 PM
pradeepkumar3
New Contributor

Hello,

In my android application I am trying to auto locate the user to the current location. I was using beta version of SDK previously and everything was working fine. Following was the code that I had written, with beta SDK, which worked fine for me, but for SDK 100.0.0 it is not working anymore.

private LocationDisplay mLocationDisplay;
mLocationDisplay = mapView.getLocationDisplay();
mLocationDisplay.setAutoPanMode(LocationDisplay.AutoPanMode.DEFAULT);
if (!mLocationDisplay.isStarted()) {
mLocationDisplay.startAsync();
}

But this code is not working anymore when I use SDK 100.0.0.  There is no value LocationDisplay.AutoPanMode.DEFAULT in the SDK 100.000. Could someone please help me understand how do I rewrite the code, based on SDK 100.0.0 to locate the user to he current location?. Please note that I am display the Map object inside a fragment.

Tags (1)
0 Kudos
1 Reply
ShellyGill1
Esri Contributor

Hi Pradeep,

This is a good question. Some of the members of the enum were renamed at one of the beta releases, in order to be a better description of the behaviour. You can use RECENTER (see LocationDisplay.AutoPanMode| arcgis-android ). in order to recenter the map as the device location moves, or OFF to leave the map extent unaffected as location changes, in addition to the two modes suitable for moving devices - NAVIGATION and COMPASS_NAVIGATION.

Hope this helps,

Shelly

0 Kudos