AGSGPSAutoPanModeCompassNavigation on Landscape mode

740
2
Jump to solution
02-18-2013 11:59 PM
TangWorawitphinyo
New Contributor II
Hi there,

I am currently using ArcGIS for iOS v2.3.2. (no time to update to the new version yet..).
I ran into a problem when I set my map's GPS navigation mode to AGSGPSAutoPanModeCompassNavigation
in which the map was supposed to rotates to face the direction the user is facing.

This work fine when the app is in the portrait mode. But in the landscape mode, I found out that the rotation angle
of the map comparing to the actual direction the user is facing, is off by +/- 90 degree! 😞

I need help friends..is there a way to fix this? I tried to set the map angle to be +/- 90 degree before I start the navigation
mode in landscape, but that did not work since the the map would just rotates itself back to the angle it's think is 'correct'..

Please help me!
0 Kudos
1 Solution

Accepted Solutions
AaronConnolly
Occasional Contributor
Hi Tang,

It's possible that you're not passing the new orientation to the AGSGPS object (or in 10.1.1 the AGSLocationDisplay). According to the GPS facade notes in the Overview section, if you're going to support device rotation it's important to update this object with the current orientation, presumably to resolve the problem you've encountered:

http://resources.arcgis.com/en/help/runtime-ios-sdk/concepts/index.html#/Displaying_location_on_the_...

According to the docs the AGSLocationDisplay class has an "interfaceOrientation" property that can be set. I believe the AGSGPS class has the same.  The property description reads:

"You must set this if you are using the compass navigation mode and your application user interface orientation is not portrait. This is used for offsetting the compass heading based on the user interface orientation."

http://resources.arcgis.com/en/help/runtime-ios-sdk/apiref/index.htm

Hope that helps!

- Aaron

View solution in original post

0 Kudos
2 Replies
AaronConnolly
Occasional Contributor
Hi Tang,

It's possible that you're not passing the new orientation to the AGSGPS object (or in 10.1.1 the AGSLocationDisplay). According to the GPS facade notes in the Overview section, if you're going to support device rotation it's important to update this object with the current orientation, presumably to resolve the problem you've encountered:

http://resources.arcgis.com/en/help/runtime-ios-sdk/concepts/index.html#/Displaying_location_on_the_...

According to the docs the AGSLocationDisplay class has an "interfaceOrientation" property that can be set. I believe the AGSGPS class has the same.  The property description reads:

"You must set this if you are using the compass navigation mode and your application user interface orientation is not portrait. This is used for offsetting the compass heading based on the user interface orientation."

http://resources.arcgis.com/en/help/runtime-ios-sdk/apiref/index.htm

Hope that helps!

- Aaron
0 Kudos
TangWorawitphinyo
New Contributor II
Hi Tang,

It's possible that you're not passing the new orientation to the AGSGPS object (or in 10.1.1 the AGSLocationDisplay). According to the GPS facade notes in the Overview section, if you're going to support device rotation it's important to update this object with the current orientation, presumably to resolve the problem you've encountered:

http://resources.arcgis.com/en/help/runtime-ios-sdk/concepts/index.html#/Displaying_location_on_the_...

According to the docs the AGSLocationDisplay class has an "interfaceOrientation" property that can be set. I believe the AGSGPS class has the same.  The property description reads:

"You must set this if you are using the compass navigation mode and your application user interface orientation is not portrait. This is used for offsetting the compass heading based on the user interface orientation."

http://resources.arcgis.com/en/help/runtime-ios-sdk/apiref/index.htm

Hope that helps!

- Aaron


Yeah! It's working correctly now. Thank you so much for the help, Aaron!

You were right. I didn't update the current screen orientation to the AGSGPS object, so the rotation was off by 90 degree.

Thank again,
Tang
0 Kudos