问题
Trying to do routing with ARCGIS SDK for ios.I have a AGSPoint with me as
AGSSpatialReference *sr = [AGSSpatialReference spatialReferenceWithWKID:102100];
AGSPoint *myMarkerPoint =[AGSPoint pointWithX:-13626235.170442
y:4549170.396625 spatialReference:sr];
I have to make AGSStopGraphic
with respect to this point ,How it can be done?This is something basic ,But don't know how to do it.
And how to do routing with this?Is there a better approch
回答1:
You need to create an AGStopGraphic
using the AGSPoint
. Your myMarkerPoint
is a geometry that defines the location. Something like this:
AGSPictureMarkerSymbol* destSymbol = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImage:[UIImage imageNamed:@"RedPin.png"]];
AGSStopGraphic* stop = [AGSStopGraphic graphicWithGeometry:myMarkerPoint
symbol:destSymbol
attributes:{@"Destination" : @"Name"}];
To do the routing request, you need to start with an AGSRouteTaskParameters
object and add the stops to it (along with all the other parameters) using the setStopsWithFeatures:
method. Then using your AGSRouteTask
object, call the method solveWithParameters:
and pass it the route task parameters.
According to the AGSRouteTask documentation there is a Routing sample app that you can look at.
来源:https://stackoverflow.com/questions/17944002/creating-an-agsstopgraphic-routing-ios