在MKMapView上的一个点周围转圈 [英] Circle around a point on an MKMapView
问题描述
我需要在MKMapView上的任意点(不一定是用户的位置)周围绘制具有指定半径的圆.我希望外观类似于地图"应用使用的圆圈,以显示用户位置的准确性.
I need to draw a circle with a specified radius around an arbitrary point (not necessarily the user's location) on an MKMapView. I would like the appearance to be similar to the circle that the Maps app uses, to show the accuracy of the user's location.
有推荐的方法吗?还是需要创建自定义叠加层?
Is there a recommended way of doing this, or will I need to create a custom overlay?
推荐答案
您可能想看看 MKCircleView ,它们是MapKit API的一部分,旨在在MKMapView上绘制圆.我认为没有像用户位置圈那样简单的方法来复制动画的归零"效果,但是您应该能够使用这些类在给定坐标周围显示固定的精度.
You might want to look at MKCircle and MKCircleView, which are part of the MapKit API and are designed for drawing circles on an MKMapView. I don't think there's an easy way to duplicate the animated "zeroing in" effect like the user location circle does, but you should be able to use these classes to show a fixed degree of accuracy around a given coordinate.
这篇关于在MKMapView上的一个点周围转圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!