简体   繁体   中英

Drawing a circle on mapkit

我必须在地图上画一个圆,它必须以一个点为中心约1.8英里。我该怎么做?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM