最佳答案
您可以只绘制具有相同路径的 2 条折线。
假设您创建了一个带有缓冲坐标的变量thePath
。
您已经使用此路径创建了一条折线。
let redPolyline = GMSPolyline()
redPolyline.path = thePath
redPolyline.map = mapview
创建另一个。
let redPolyline = GMSPolyline()
redPolyline.path = thePath
redPolyline.strokeWidth = 6.0 // Change it accordingly
redPolyline.strokeWidth = UIColor.redColor().colorWithAlphaComponent(0.5) // Change it accordingly
redPolyline.map = mapview
请记住,redPolyline 的 zIndex
应高于 bluePolyline,因为正如我在您提供的图像中看到的那样,redPolyline 位于另一条线的顶部。
关于ios - 如何在ios swift中绘制以折线为半径的多边形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39640714/