AGSGPSAutoPanModeCompassNavigation + Graphics Layer Symbols

746
9
12-19-2012 08:10 AM
AaronConnolly
Occasional Contributor
Hi,

When the map's gps is set to AGSGPSAutoPanModeCompassNavigation, the map rotates around the user's location. Unfortunately any graphics on the map do not rotate as well. I would like to rotate them manually, do you have any suggestions as to the best approach for this?

To date, I have:

1. Started listening for heading updates from CLLocationManager which come in very fast and in a high volume.
2. Retained a pointer to my graphics layer and rotate each graphic based on the heading that was provided by the device.
3. Refresh the graphics layer.

This seems to work, but it doesn't look great and it is not efficient because of the frequency with which the headings are provided.

Questions:

1. If I want the map's graphics to rotate around the user's location while in AGSGPSAutoPanModeCompassNavigation, what's the best approach to do that?
2. Is there a better way to do what I'm trying to do?
3. Is it even recommended to do what I am trying to do?
4. Are there any known issues with calling dataChanged on a graphics layer frequently in short intervals?

Thanks,
- Aaron
0 Kudos
9 Replies
AaronConnolly
Occasional Contributor
I've been trying to make this map rotation work for a while now and am running into memory related crashes. I'm thinking that it has to do with the continuous update of the graphics layer, but I'm not certain. Does anyone at ESRI, or otherwise, know what I'm talking about here? If you've done this before what should I look out for?
0 Kudos
NimeshJarecha
Esri Regular Contributor
No, unfortunately, there is no easy way to rotate graphics along with map rotation. We'll see if we can do something about it in the future.

Regards,
Nimesh
0 Kudos
AaronConnolly
Occasional Contributor
Thanks Nimesh,

So you do you NOT recommend that users try this with the SDK at this time? What is the main problem with this? The reason I ask is because it is requirement for our app to rotate the map and I need as much info on why it doesn't work. Can you offer more insight on this?

Thanks,
- Aaron
0 Kudos
NimeshJarecha
Esri Regular Contributor
The limitation is calling dataChanged on graphics layer very frequently which producing flashing effect. In the next version of the SDK (very soon) you'll be able to change graphic >> symbol >> angle and it'll refresh on it's own. That's what you are looking for, right?

Stay tuned 🙂

Regards,
Nimesh
0 Kudos
AaronConnolly
Occasional Contributor
The limitation is calling dataChanged on graphics layer very frequently which producing flashing effect. In the next version of the SDK (very soon) you'll be able to change graphic >> symbol >> angle and it'll refresh on it's own. That's what you are looking for, right?

Stay tuned 🙂

Regards,
Nimesh


That would be great, yes. It would be better if the graphics layer or the graphic itself *knew* to auto-rotate when the map rotated. Maybe it could have a setting "autoRotateGraphics" or something similar.
0 Kudos
NimeshJarecha
Esri Regular Contributor
The new version of ArcGIS SDK for iOS is available now.

Regards,
Nimesh
0 Kudos
AaronConnolly
Occasional Contributor
Taking a look at it now.... thanks for all the help.
0 Kudos
AaronConnolly
Occasional Contributor
Hello Nimesh,

Even with the latest SDK would it still be your recommendation that we NOT attempt to retain copies to the symbols on the map and rotate them as the map rotates?

Thanks,
- Aaron
0 Kudos
NimeshJarecha
Esri Regular Contributor
With latest SDK you can set symbol's angle to rotate and it'll refresh on it's own.

Regards,
Nimesh
0 Kudos