New basemap styling is coming soon to Google Maps Platform. This update to map styling includes a new default color palette, modernized pins, and improvements to map experiences and usability. All map styles will be automatically updated in March 2025. For more information on availability and how to opt in earlier, see New map style for Google Maps Platform.
Stay organized with collections
Save and categorize content based on your preferences.
RxJava is a reactive programming library for composing asynchronous and event-based programs by
using observable sequences.
The Maps Rx library
lets you receive observable sequences for asynchronus events on the Maps SDK for Android
and Places SDK for Android so you can take advantage of the rich set of RxJava features.
Installation
To install the Maps Rx library in your Google Maps project:
Add the following dependencies to your module-level build.gradle file:
dependencies {// RxJava bindings for the Maps SDKimplementation("com.google.maps.android:maps-rx:1.0.0")// RxJava bindings for the Places SDKimplementation("com.google.maps.android:places-rx:1.0.0")// It is recommended to also include the latest Maps SDK, Places SDK and RxJava so you// have the latest features and bug fixes.implementation("com.google.android.gms:play-services-maps:19.0.0")implementation("com.google.android.libraries.places:places:4.1.0")implementation("io.reactivex.rxjava3:rxjava:3.1.8")
Rebuild your project in Android Studio to sync these changes.
Example Usage
Receive an Observable for marker click events as an extension function on the GoogleMap object:
googleMap.markerClickEvents().subscribe { marker ->
Log.d("MapsRx", "Marker ${marker.title} was clicked")}
The next example shows you how you can use the RxJava operator, merge, to combine
various camera events into a single Observable stream:
Observable.merge(googleMap.cameraIdleEvents(),googleMap.cameraMoveEvents(),googleMap.cameraMoveCanceledEvents(),googleMap.cameraMoveStartedEvents()).subscribe {// Notified when any camera event occurs}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-29 UTC."],[[["The Maps Rx library enables the use of RxJava with the Maps SDK and Places SDK for Android to handle asynchronous events."],["It provides observable sequences for events like marker clicks and camera movements, allowing developers to leverage RxJava features."],["You can install the library by adding specific dependencies to your `build.gradle` file and rebuilding your project."],["The library offers extension functions and operators to simplify the integration of RxJava with Google Maps functionality."]]],[]]