I am now moving to ArcGIS
maps for one of my iOS project.
how do you draw a line between two points. in the case of MapKit
you use MKPolyLine
.
Thanks
There are several steps to this if you don't have any map layers defined yet. The classes you'll need are documented here. Your map view (AGSMapView
) needs to have a graphics layer (AGSGraphicsLayer
). You can add AGSGeometry
objects to the graphics layer, such as a AGSSimpleLineGeomtry
. You set the geometry of the AGSSimpleLineGeometry
object from the AGSPolyline
object which defines its geometry. Something like this:
Use the AGSPolyline
class to define the geometry (AGSPolyline
is a subclass of AGSGeometry
).
Create an AGSGraphic
object and set its geometry property to the polyline geometry created first. Use you can use one of the subclasses of AGSGraphic
such as AGSSimpleLineGeometry
.
Add the AGSGraphic
object to an AGSGraphicsLayer
, which has been added to your map (AGSMapView
is a UIView
subclass)