创建一个AGSStopGraphic,Routing ios [英] Creating an AGSStopGraphic,Routing ios

查看:19
本文介绍了创建一个AGSStopGraphic,Routing ios的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用适用于 ios 的 ARCGIS SDK 进行路由.我有一个 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.

如何用这个做路由?有没有更好的方法

And how to do routing with this?Is there a better approch

推荐答案

您需要使用 AGSPoint 创建一个 AGStopGraphic.您的 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 对象开始,并使用 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,Routing ios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆