gpt4 book ai didi

swift - 如何使用 Swift 在谷歌地图上填充圆圈外的颜色?

转载 作者:行者123 更新时间:2023-11-30 10:07:53 26 4
gpt4 key购买 nike

我想要红色圆圈只有边框(中心没有红色)并将圆圈外的其余部分变暗?

我对此有疑问。你能帮我解决一下吗?

My screen

最佳答案

使用谷歌地图,您应该执行以下步骤

  1. 创建一个 GMSCircle 对象
  2. 设置描边颜色和填充颜色圆圈
  3. 为圆形对象设置 map

示例代码:

let circleCenter = CLLocationCoordinate2DMake(9.931233, 76.267303)//change to your center point
let circ = GMSCircle(position: circleCenter, radius: 5000)//radius in meters

circ.fillColor = UIColor(red: 0.35, green: 0, blue: 0, alpha: 0.05)
circ.strokeColor = UIColor.redColor()
circ.strokeWidth = 1
circ.map = mapView //your map view in the UI

关于swift - 如何使用 Swift 在谷歌地图上填充圆圈外的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35052877/

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