Select to view content in your preferred language

Z-order of AGSGraphic

991
5
09-26-2012 02:45 PM
AaronConnolly
Regular Contributor
Is it possible to change the z-order of an AGSGraphic when it is selected? The use case is when there are heaps of points on the map and the user selects one from the crowd, it's not always clear which graphic was selected. I'd like to change the image of the symbol and bring it to the front if possible.

I don't see any properties on AGSGraphicsLayer that might allow you to "select" a graphic, and neither do I see any comparable properties on AGSGraphic or AGSSymbol.

Thanks,
- Aaron
0 Kudos
5 Replies
NimeshJarecha
Esri Regular Contributor
You cannot change the Z order of the graphic but you can change the symbol of graphic to make it look different from others in order to visualize the selection.

Regards,
Nimesh
0 Kudos
AaronConnolly
Regular Contributor
You cannot change the Z order of the graphic but you can change the symbol of graphic to make it look different from others in order to visualize the selection.

Regards,
Nimesh


Great! That was going to be my next question. I'm assuming that would be as simple as changing the image that is supplied to the AGSPictureMarkerSymbol, right? Would we have to create a whole new symbol for that graphic?

Thanks,
- Aaron
0 Kudos
NimeshJarecha
Esri Regular Contributor
You'll have to create a new symbol and assign to graphic.

Regards,
Nimesh
0 Kudos
AaronConnolly
Regular Contributor
You'll have to create a new symbol and assign to graphic.

Regards,
Nimesh


Great, that's what I thought. I've got a prototype working that grabs the graphic from the mapView:didClickAtPoint: method but the Graphic that I pull from the ASGGraphics array doesn't refresh or change when I give it a new symbol. Must I retain each AGSGraphic (and thus its symbol) in some managed data structure and update THAT instance of the AGSGraphic rather than the one returned from mapView:didClickAtPoint: ? I wonder if the graphic returned there is the same instance that I need to update.

Thanks,
- Aaron
0 Kudos
NimeshJarecha
Esri Regular Contributor
You need to call dataChanged method of AGSGraphicsLayer after updating symbol.

Regards,
Nimesh
0 Kudos