[英]How to draw a line on MKMapView showing the route a user has taken?
I have had a look around online to try and find out the best way to draw a line showing the route a user has travelled. 我已经在网上看了一下,试图找出画出一条显示用户旅行路线的最佳方法。 I think I need to use the MKOverlayView, and I guess I need to collect a selection of data points to plot (would these be GPS coordinates?).
我想我需要使用MKOverlayView,我想我需要收集一些数据点来绘制(这些是GPS坐标吗?)。 The question I have is based on how I would draw the line and keep adding to it as the users location updates?
我的问题是基于我如何画线并继续添加到用户位置更新?
I also want to be able to clear the line when a user presses a button. 我还希望能够在用户按下按钮时清除该行。 How would I implement this (not the button press, just the code to clear the line off the map view)?
我该如何实现这个(不是按下按钮,只是清除地图视图中的线条的代码)?
Thanks in advance! 提前致谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.