Select to view content in your preferred language

AGSGPS Auto Pan Modes

1126
4
12-05-2012 08:43 AM
AaronConnolly
Regular Contributor
Hi,

I'm working with the GPS "facade" over Core Location in the ESRI SDK and I noticed something odd with the AGSGPSAutoPanModeCompassNavigation setting. You can create a simple app with a button that toggles between the different mode states and that is what I've done. I noticed that when transitioning from AGSGPSAutoPanModeCompassNavigation to AGSGPSAutoPanModeOff the map does not re-center on the user's location and worse the map remains rotated in the last direction/direction it was in prior to transitioning. Why does the map not auto-correct it's angle?

I know I can set the map rotationAngle property but it seems to me that the API should recognize this use case.

Finally, when manually setting the map rotationAngle in this case I can get the desired effect but my GPS location is often no longer centered. I'd rather not have to do a bunch of GIS math if possible to move the map to the correct spot when transitioning. Any ideas on what I might be doing wrong?

Thanks,
- Aaron
0 Kudos
4 Replies
NimeshJarecha
Esri Regular Contributor
We purposely (for a use case) do not re-center map on user's location and keep map rotated in the last direction while transitioning from AGSGPSAutoPanModeCompassNavigation to AGSGPSAutoPanModeOff.

I'm not sure whether you have noticed this but if you're in navigation mode (AGSGPSAutoPanModeCompassNavigation) and driving, now you want to see/check the map around current location and you try to touch/pan/zoom map then it automatically changes to the AGSGPSAutoPanModeOff. If at this time SDK re-center the map or auto-correct the angle then it'll will look really bad.

We're leaving this situation to handle to the develop so they can do as per desired and what is right for their apps to behave.

Hope this helps!

Regards,
Nimesh
0 Kudos
AaronConnolly
Regular Contributor
We purposely (for a use case) do not re-center map on user's location and keep map rotated in the last direction while transitioning from AGSGPSAutoPanModeCompassNavigation to AGSGPSAutoPanModeOff.

I'm not sure whether you have noticed this but if you're in navigation mode (AGSGPSAutoPanModeCompassNavigation) and driving, now you want to see/check the map around current location and you try to touch/pan/zoom map then it automatically changes to the AGSGPSAutoPanModeOff. If at this time SDK re-center the map or auto-correct the angle then it'll will look really bad.

We're leaving this situation to handle to the develop so they can do as per desired and what is right for their apps to behave.

Hope this helps!

Regards,
Nimesh


Hi Nimesh,

I think what would solve this issue is that if the map is not pointing NORTH after the transition from AGSGPSAutoPanModeCompassNavigation to AGSGPSAutoPanModeOff and then the user switches to AGSGPSAutoPanModeDefault, that the map should rotate back to north. What do you think about that?

Thanks,
- Aaron
0 Kudos
NimeshJarecha
Esri Regular Contributor
It's just one line of code for you and we're leaving that choice on the developers if they want to do it.

Regards,
Nimesh
0 Kudos
AaronConnolly
Regular Contributor
It's just one line of code for you and we're leaving that choice on the developers if they want to do it.

Regards,
Nimesh


Yes, you're right its one line of code, but if it's something that every developer is going to do why not include it? Plus developers have to do a bunch of extra work to listen for a user-tap, user-pinch, user-pan, etc... to rotate the map back to north.

Curious to know what the use case is for leaving the map rotated at whatever direction it was on.

I'm not trying to be argumentative, I'm just saying it seems logical to auto-rotate it back especially if that's what everyone's going to do anyway.

Thanks,
- Aaron
0 Kudos