Creating an AGSStopGraphic,Routing ios

好久不见. 提交于 2020-01-06 14:32:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!