Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
合併程式庫
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
合併是
這個架構可用於結合事件處理運算子來處理非同步事件。
合併功能可讓您集中處理事件處理程式碼,以便讀取及維護程式碼。
GoogleMapsPlatformCombine 程式庫
這個 Swift 程式庫會傳回
Publishers敬上
Maps SDK for iOS 和 Places SDK for iOS 版本,這樣您就能
更豐富的「合併」功能組合
安裝
查看
GoogleMapsPlatformCombine 程式庫
說明文件,瞭解最新系統需求和安裝操作說明。
使用範例
GoogleMapsPlatformCombine 程式庫包含
GMSMapViewPublisher 類別
包含發布商屬性,可讓您訂閱地圖所引發的事件。
以下範例會設定要訂閱的 GMSMapViewPublisher 例項
攝影機變更事件:
let publisher = GMSMapViewPublisher(mapView: mapView)
publisher.didChangeCameraPosition.sink { cameraPosition in
print("Camera position at \(cameraPosition.target)")
}
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-05-13 (世界標準時間)。
[null,null,["上次更新時間:2026-05-13 (世界標準時間)。"],[],["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"]]