Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
326 views
in Technique[技术] by (71.8m points)

iphone - Creating an AGSStopGraphic,Routing ios

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...