Valhalla

class Valhalla(context: Context, config: ValhallaConfig, valhallaConfigManager: ValhallaConfigManager = ValhallaConfigManager(context), moshi: Moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build())

Main entry point for the Valhalla routing engine on Android.

This class provides a Kotlin interface to the native Valhalla C++ routing engine. It handles configuration management, JSON serialization, and routing requests.

Parameters

context

The Android context used for file system operations and configuration management.

config

The Valhalla configuration specifying tile locations and routing options.

valhallaConfigManager

Manages the Valhalla configuration file on the device. Defaults to a new instance.

moshi

JSON serialization adapter. Defaults to a Moshi instance with Kotlin reflection support.

See also

ValhallaConfig
RouteRequest

Constructors

Link copied to clipboard
constructor(context: Context, config: ValhallaConfig, valhallaConfigManager: ValhallaConfigManager = ValhallaConfigManager(context), moshi: Moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build())

Functions

Link copied to clipboard
fun route(request: RouteRequest): ValhallaResponse

Fetch a route from Valhalla.