ライブラリの結合
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Combine は
イベント処理演算子を組み合わせて非同期イベントを処理するフレームワークです。
Combine を使用すると、イベント処理コードを一元化することで、コードの読みやすさと保守が容易になります。
GoogleMapsPlatformCombine ライブラリ
Swift ライブラリで
Publishers
サポートされており、
豊富な機能を使用して
インストール
GoogleMapsPlatformCombine ライブラリをご覧ください。
で最新のシステム要件とインストール手順をご確認ください。
サンプル使用量
GoogleMapsPlatformCombine ライブラリには、
GMSMapViewPublisher
クラス
これには、地図によって出力されたイベントに登録できるパブリッシャー プロパティが含まれています。
次の例では、GMSMapViewPublisher
インスタンスをサブスクライブするように構成します。
カメラの変更イベント:
let publisher = GMSMapViewPublisher(mapView: mapView)
publisher.didChangeCameraPosition.sink { cameraPosition in
print("Camera position at \(cameraPosition.target)")
}
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-12 UTC。
[null,null,["最終更新日 2025-09-12 UTC。"],[],["The content introduces the GoogleMapsPlatformCombine library, which utilizes Apple's Combine framework for handling asynchronous events within the Google Maps and Places SDKs for iOS. It leverages `Publishers` to manage events. A key action is demonstrated through the `GMSMapViewPublisher` class, allowing users to subscribe to map events. An example illustrates how to monitor camera position changes using the `didChangeCameraPosition` publisher. Installation instructions and further details are available on the library's GitHub page.\n"],null,[]]