THIS SDK ISDEPRECATED.

We rolled out a new and better SDK for you.

Map Kotlin Extensions

Additional classes that make development with Kotlin more pleasant and idiomatic. 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-ktx-extensions:{libversion}")

To apply an operation on the TomtomMap:

1inline fun MapFragment.applyOnTomtomMap(noinline block: TomtomMap.() -> Unit) {
2 getAsyncMap(block)
3}

To take advantage of coroutines:

1suspend inline fun MapFragment.getTomtomMap(): TomtomMap = suspendCoroutine { cont ->
2 val callback = OnMapReadyCallback { tomtomMap -> cont.resume(tomtomMap) }
3 getAsyncMap(callback)
4}

API Reference

JavaDocMapKtxExtensions_2.4.807 (JavaDocMapKtxExtensions_2.4.807.zip)