Making the app responsive to location change

3806
3
03-14-2015 02:12 AM
HaniDraidi
Occasional Contributor II

I am developing an app that finds my location using location services, when my location is defined, it is represented on the map by point. How can I make the map responsive to the change in my location, such that the map extent keeps my location in the center of the map, and when I rotate the device (change the device’s orientation), the map is rotated as well.

Any help is appreciated,

Hani

0 Kudos
3 Replies
omega_cancer
Occasional Contributor II

such that the map extent keeps my location in the center of the map

I this LocationDisplayManager keeps track of this as you said your are using it already.

when I rotate the device (change the device’s orientation), the map is rotated as well

mMapView.setRotationAngle(); function accepts degree as double.

To get the degree consult following sources:

1.

magnetometer - Android Compass Bearing - Stack Overflow Read prashant​ answer.

2.

Mark Thorogood

at How to get Android compass reading? - Stack Overflow

3. Android Compass Code Example

4. https://www.codeofaninja.com/2013/08/android-compass-code-example.html

5. Coding for Android: Using orientation sensors: Simple Compass sample

Hope this will help

HaniDraidi
Occasional Contributor II

Thank you for the helpful resources Abdul Razzaq

0 Kudos
ShellyGill1
Esri Contributor

Sounds like you might want to use LocationDisplayManager.setAutoPanMode(AutoPanMode.COMPASS) - "Centers the map at the current location, rotates the map to align with the direction in which the device is currently, and shows the location symbol." - LocationDisplayManager.AutoPanMode | ArcGIS Android 10.2.5 API .

0 Kudos