A Swift ilbrary containing Combine support, via Publisher
and Future
, for Google Maps Platform iOS SDKs.
// Create a GMSMapViewPublisher
let publisher = GMSMapViewPublisher(mapView: mapView)
// Subscribe to events
publisher.didChangeCameraPosition.sink { cameraPosition in
print("Camera position at \(cameraPosition.target)")
}
To run the example project:
- Run
pod install
from the Example/ directory. - Open the
GoogleMapsPlatformCombine.xcworkspace
file in Xcode
- Deployment Target of iOS 13.0
In your Podfile
:
pod 'GoogleMapsPlatformCombine', '0.3.1'
Subspecs are also available if you only need Combine support for a specific SDK:
# For Combine support for the Maps SDK for iOS only
pod 'GoogleMapsPlatformCombine/Maps', '0.3.1'
# For Combine support for the Places SDK for iOS only
pod 'GoogleMapsPlatformCombine/Places', '0.3.1'
Since the Maps/Places SDKs for iOS are not yet supported in SPM, if you install this library via SPM you will need to also install Maps/Places using one of the supported package managers. See installation options for Maps and Places for more information.
Encounter an issue while using this library?
If you find a bug or have a feature request, please file an issue. Or, if you'd like to contribute, please refer to our contributing guide and our code of conduct.
You can also reach us on our Discord channel.
For more information, check out the detailed guide on the Google Developers site.