コンテンツにスキップ

GroundImageState

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

実行時に画像、不透明度、地理的バウンズ、またはクリックハンドラーが変化する場合に使用してください。

  • id: String
  • bounds: GeoRectBounds
  • image: UIImage
  • opacity: Double
  • tileSize: Int
  • extra: Any?
  • onClick: OnGroundImageEventHandler?
let bounds = GeoRectBounds(
southWest: GeoPoint(latitude: 35.67, longitude: 139.74),
northEast: GeoPoint(latitude: 35.69, longitude: 139.76)
)
let groundImageState = GroundImageState(
bounds: bounds,
image: UIImage(named: "overlay")!,
opacity: 0.5
)
GroundImage(state: groundImageState)
groundImageState.opacity = 1.0

画像を移動またはリサイズするには bounds を更新してください:

groundImageState.bounds = GeoRectBounds(
southWest: GeoPoint(latitude: 35.66, longitude: 139.73),
northEast: GeoPoint(latitude: 35.70, longitude: 139.77)
)

表示するラスター画像が変わった場合は image を更新してください。オーバーレイレンダラーで使用するタイルサイズを制御するには tileSize を使用してください。