Sorry, you need to enable JavaScript to visit this website.

Map ReactX Extensions

Map ReactX Extensions

Additional classes that allow to write reactive components using TomtomMap. Specific map callbacks
(e.g. map click listener) are transformed to Observables so they can be easily integrated
with RxJava2 types. This module does not add any new features to the existing TomtomMap API.

To use this library, add the following dependency to the build.gradle file:

api("com.tomtom.online:sdk-maps-rx-extensions:2.+")

To initialize the Rx wrapper for TomtomMap:

RxTomtomMap rxTomtomMap = new RxTomtomMap(tomtomMap);

To subscribe for map click events:

Disposable mapClickDisposable = rxTomtomMap
        .getOnMapClickObservable()
        .observeOn(mainThread())
        .subscribe(new Consumer<LatLng>() {
            @Override
            public void accept(LatLng latLng) throws Exception {
                displayMessage(
                        R.string.menu_events_on_map_click,
                        latLng.getLatitude(),
                        latLng.getLongitude()
                );
            }
        });