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
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.
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
Thank you for the helpful resources Abdul Razzaq
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 .