cancel

fun cancel()

Cancels any/all background tasks that may be running.

Call this when the instance is no longer needed, for example when the map that renders its data is destroyed. Besides stopping background work, it unregisters the instance from the process-wide memory monitor and clears the route line caches. The instance can still be used after this call.