[英]iOS MapKit - drawing shapes on map
You can use MKPolygon
. 您可以使用
MKPolygon
。
First of all you'll need to disable user interaction on the map view so that it won't move around while you're trying to draw on it. 首先,您需要在地图视图上禁用用户交互,以便在尝试绘制时不会移动。 Next up you can use the
UIResponder
functions touchesBegan
, touchesMoved
and touchesEnded
. 接下来,您可以使用
UIResponder
函数touchesBegan
, touchesMoved
和touchesEnded
。 As you move through these three functions you can record the points the user has pressed. 当您浏览这三个功能时,可以记录用户按下的点。 Lastly you can then create an MKPolygon from this array of points that you have recorded.
最后,您可以根据已记录的点数组创建MKPolygon。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.