在MKMapView上绘制路线 [英] drawing routes on MKMapView

查看:136
本文介绍了在MKMapView上绘制路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

添加到MKMapView的路线

所以我我计划在MKMapView上绘制多条路线。在iOS上最简单的方法是什么?如果我给他们两个点(纬度,经度),我不确定iPhone是否可以计算路线。但是如果iPhone能够计算出一条路线,那么该路线可能不是我想要从A点到B线的路线。

So I am planning to draw multiple routes on the MKMapView. What are the easiest way to do this on iOS? I am not sure if the iPhone can calculate routes if I give them two points (lattitude, longitude). But then if the iPhone were able to calculate a route, then that route might not be the route I want to draw to go from point A to B.

我需要吗?沿途有多个点并画出来?因为这似乎非常复杂,因为随着距离的增长,点的数量呈线性增长。有什么建议吗?

Do I need multiple points along the route and draw it? As that seems really complex, as the number of points grows linearly with the growth of distance. Any suggestions?

推荐答案

试试这些帖子..它会帮助你我认为

Try these posts.. It will help you i think

http://navarra.ca/?p=786

http://spitzkoff.com/craig/?p=108

这将自动使用 Google Direction API ,我会猜测这些位置之间的点数。

This will automatically use Google Direction API and will fetch the points in between the locations i guess..

Anyhoo看到这个博客 http://laurilarjo.wordpress.com/2010 / 10/23 / using-google-directions-api-and-drawing-routes-in-iphone-mkmapview /

Anyhoo see this blog http://laurilarjo.wordpress.com/2010/10/23/using-google-directions-api-and-drawing-routes-in-iphone-mkmapview/

这篇关于在MKMapView上绘制路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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