コンテンツにスキップ

PolygonState

PolygonStatePolygon(state:) で使用される ObservableObject です。

作成後に塗りつぶし領域の形状、スタイル、穴、Z インデックス、または選択状態が変化する場合に使用してください。

  • id: String
  • strokeColor: UIColor
  • strokeWidth: Double
  • fillColor: UIColor
  • geodesic: Bool
  • zIndex: Int
  • points: [GeoPointProtocol]
  • holes: [[GeoPointProtocol]]
  • extra: Any?
  • onClick: OnPolygonEventHandler?

透明度を表現するには fillColor または strokeColor のアルファ値を使用してください。

let polygonState = PolygonState(
points: outerRing,
fillColor: UIColor.green.withAlphaComponent(0.25),
holes: [innerRing]
)
Polygon(state: polygonState)
polygonState.strokeWidth = 3
polygonState.fillColor = UIColor.red.withAlphaComponent(0.2)

holes は外側のポリゴンの内部にあるリングの配列です:

polygonState.holes = [restrictedAreaRing]

半透明な領域には fillColor のアルファ値を使用してください。pointsholes はデータモデルで要求される座標順序に従って設定してください。