A Swift library containing Combine support, via Publisher
and Future
, for Google Maps Platform iOS SDKs.
- Sign up with Google Maps Platform
- A Google Maps Platform project with the Maps SDK for iOS enabled
- An API key associated with the project above
- Swift and XCode
- (Deployment target of) iOS 13+
// 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
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.
Contributions are welcome and encouraged! If you'd like to contribute, send us a pull request and refer to our code of conduct and contributing guide.
This library uses Google Maps Platform services. Use of Google Maps Platform services through this library is subject to the Google Maps Platform Terms of Service.
This library is not a Google Maps Platform Core Service. Therefore, the Google Maps Platform Terms of Service (e.g. Technical Support Services, Service Level Agreements, and Deprecation Policy) do not apply to the code in this library.
This library is offered via an open source license. It is not governed by the Google Maps Platform Support [Technical Support Services Guidelines, the SLA, or the Deprecation Policy. However, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service.
This library adheres to semantic versioning to indicate when backwards-incompatible changes are introduced. Accordingly, while the library is in version 0.x, backwards-incompatible changes may be introduced at any time.
If you find a bug, or have a feature request, please file an issue on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our developer community channels. If you'd like to contribute, please check the contributing guide.
You can also discuss this library on our Discord server.