创建AGSStopGraphic,路由ios [英] Creating an AGSStopGraphic,Routing ios
问题描述
尝试使用ARCGIS SDK for ios进行路由。我有一个AGSPoint与我一起
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];
我必须制作 AGSStopGraphic
这一点,它是如何做到的?这是基本的,但不知道该怎么做。
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.
如何用这个做路由?有没有更好的approch
And how to do routing with this?Is there a better approch
推荐答案
您需要使用<$创建 AGStopGraphic
C $ C> AGSPoint 。您的 myMarkerPoint
是一个定义位置的几何体。这样的事情:
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"}];
要执行路由请求,您需要以 AGSRouteTaskParameters开头
object并使用 setStopsWithFeatures:
方法向其添加停靠点(以及所有其他参数)。然后使用 AGSRouteTask
对象,调用方法 solveWithParameters:
并将路径任务参数传递给它。
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.
根据 AGSRouteTask文档您有路由示例应用可以看看。
According to the AGSRouteTask documentation there is a Routing sample app that you can look at.
这篇关于创建AGSStopGraphic,路由ios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!