I am setting a selectionSymbol for my layer this way (iOS SDK v 10.2.5):
if let selectionSymbol = AGSPictureMarkerSymbol(image: selectionSymbolImg) {
selectionSymbol.offset = CGPoint(x: 0, y: 10)
layer.selectionSymbol = selectionSymbol
}
On the first picture you can see the expected result. However sometime when I select a point on the map the selection symbol gets cut, see second picture. So what's wrong with it? Have can I avoid this behavior? And how can I bring selected point to the front?
Hi Nikolay,
I wonder did you use this method: mapView:didClickAtPoint:mapPoint:features: under
10.2.5: <AGSMapViewTouchDelegate> Protocol Reference
Whenever you click on the map, then make sure add the new graphicLayer on top of the featureLayer(I assume the point that you load up in map is coming from featureLayer)
I don't add new graphics when I click on the map, I select existing graphics on the map.
I don't use the touchDelegate method, bc I set the selection symbol once at the initilization of a custom AGSGraphicsLayer and expect ESRI to use it for marker's selected state when I click on the one of the multiple markers previously added to my custom AGSGraphicsLayer.
The marker is AGSGraphic, all graphics are added to single custom AGSGraphicsLayer.
I think this is a bug in our static mode graphics layer rendering. We render to tiles and with a bigger symbol like that for the selection symbol, it doesn't realize that it needs to draw it in multiple tiles. Can you try dynamic graphics layer rendering mode to confirm that?
Thanks! Tested for a while and seems the issue is gone with dynamic rendering mode.
Ok, good. The dynamic rendering mode could not handle as many graphics as the static rendering mode in 10.2.x. So make sure performance is ok for the number of graphics that you are using. If performance becomes an issue there are some other workarounds you can try:
- putting selected graphics in a different graphics layer
- smaller selection symbol