gpt4 book ai didi

ios - 如何在ios swift中围绕折线绘制半径多边形

转载 作者:搜寻专家 更新时间:2023-11-01 07:20:02 24 4
gpt4 key购买 nike

我在围绕折线绘制多边形时遇到问题((我有所有坐标折线,我想缓冲坐标以获得该折线周围多边形的坐标。

我有类似这个的东西:enter image description here .

但我想制作类似this的东西:

enter image description here

请帮忙...

最佳答案

您可以只绘制 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com