在我的应用程序中,我实现了地图。使用纬度和经度值丢弃了引脚。但我需要在 2 个引脚之间获得转弯方向。如何获得地图中 2 个引脚(注释)之间的方向?
2 回答
请浏览 google maps api web 服务的文档。 https://developers.google.com/maps/documentation/javascript/directions
里面一步步给的很清楚。他们甚至给出了一个你想要达到的例子 https://google-developers.appspot.com/maps/documentation/javascript/examples/directions-panel
步骤: 1.创建一个UIWebView来显示地图。2. 在文件夹名称“HTML”中创建一个名称为“maps.html”的 html 文件,并复制文档中给出的代码 3. 通过
[WebView loadRequest:[NSURLRequest requestWithURL:[从您的 Objective-c 类调用 html 文件NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"maps" ofType:@"html" inDirectory:@"HTML"]]]];
To draw path between two locations, Finding Path/Route Between two points on MapKit in iPhone will help you.
To retrive list of locations between given two 2 pins, you have to use google map api http://maps.google.com/maps?output=dragdir&saddr=&daddr=