Drawing a circle on mapkit

空扰寡人 提交于 2019-12-23 03:21:29

问题


I got to draw a circle on my map, it has to be about 1,8 miles centered on a point.. How can I do it?


回答1:


Basically you need to do 2 steps:

  1. Create MKCircle object using circleWithCenterCoordinate:radius: method and add it to your mapView (using addOverlay: method)
  2. In mapView delegate implement mapView:viewForOverlay: method, create and setup MKCircleView instance there and return it

If you have different overlay types you may need to perform some type-checks in delegate method to create overlay views appropriate for each type of overlay.



来源:https://stackoverflow.com/questions/5563093/drawing-a-circle-on-mapkit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!