我一直在努力尝试在Google地图上绘制虚线圆,但没有找到任何有用的东西...
我已经在互联网上搜索了几天,想要找到绘制虚线圆的解决方案,但每次得到的答案都是绘制一个普通的圆形。
以下是我的做法:
以上代码为:
import UIKit
import GoogleMaps
import GooglePlaces
class ViewController: UIViewController
{
@IBOutlet weak var gmsMapView: GMSMapView!
override func viewDidLoad()
{
super.viewDidLoad()
gmsMapView.isMyLocationEnabled = true
gmsMapView.settings.myLocationButton = true
gmsMapView.animate(toZoom: 10.0)
gmsMapView.animate(toLocation: CLLocationCoordinate2D(latitude: 40.709677, longitude: -74.011088))
let circleCenter = CLLocationCoordinate2D(latitude: 40.709677, longitude: -74.011088)
let circle = GMSCircle(position: circleCenter, radius: 5000)
circle.strokeWidth = 2
circle.strokeColor = UIColor.blue
circle.map = gmsMapView
}
override func didReceiveMemoryWarning(){
super.didReceiveMemoryWarning()
}
}
这是所需的内容:
需要的是: