In my project I have a requirement to draw some arc shapes on maps as overlay. I tried with "AGSPolyline" but it draws only straight lines connecting to points. I was able to do this feature in MapKit by subclassing "MKOverlayPathRenderer" and by overriding "createPath". I would like to do the same but looks like there is no path property available on AGSGeometry. Please let me know how I can achieve this using ESRI iOS map.
Solved! Go to Solution.
You may subclass the AGSDynamicLayer to achieve this. A sample is available here.
In this sample we are using to generate an image for the envelope. In your case, you may use CGPath to render an arc and draw it into an image using CGContext. Once you have the image you just need to set the image using - setImageData:forEnvelope: the method, inside the - requestImageWithWidth:height:envelope:timeExtent: method override.
Let me know if this helps.
Gagan
You may subclass the AGSDynamicLayer to achieve this. A sample is available here.
In this sample we are using to generate an image for the envelope. In your case, you may use CGPath to render an arc and draw it into an image using CGContext. Once you have the image you just need to set the image using - setImageData:forEnvelope: the method, inside the - requestImageWithWidth:height:envelope:timeExtent: method override.
Let me know if this helps.
Gagan
Thanks for the answer. I will try it out. Feels like a work around since we can draw polyline and polygon without using dynamic layer. Ability to subclass AGSGeometry and modify CGPath property would have been perfect.
We don't use CGPath for drawing our polylines or polygons.