Directories | |
| dart | |
| java | |
| kotlin | |
| objc | |
| swift | |
This directory contains comprehensive examples demonstrating the usage of AsyncRouteManager across all supported platforms: Dart/Flutter, Java, Kotlin, Objective-C, and Swift.
AsyncRouteManager is used for managing asynchronous route planning sessions. It provides functionality for creating route sessions, managing route listeners, and handling route updates asynchronously.
The main class for managing asynchronous route planning sessions.
Methods:
createRouteSession(wayPoint, routeOptions) - Creates a routing session with default graph tagcreateRouteSessionWithTag(wayPoint, routeOptions, tag) - Creates a routing session using a specific graph tagcancelRouteSession(session) - Cancels a routing sessionProtocol/interface for receiving route updates and progress notifications.
Methods:
onRouteChanged(status, currentPath) - Called when a new route is built or rebuilt, includes router statusonRouteAdvanced(distance, point) - Called when user progresses along the routeEnumeration of router states:
MISSING_GRAPH - Router is missing the route graphMISSING_POSITION - Router is missing the current positionMISSING_ROUTE - Router is unable to build route to destinationMISSING_PROJECTION - Current position is off the route graphNEW_ROUTE - Router is ready and has a valid routeClass for managing route listeners and session lifecycle.
Methods:
addRouteListener(listener) - Adds a route listener to receive updatesremoveRouteListener(listener) - Removes a previously added route listenerClass representing a route path between two points.
Properties:
length - Total length of the route path in metersweight - Total route cost/weightnodes - List of route nodes (point, weight, distance, events)Methods:
head(advance) - Returns the leading segment of the routetail(advance) - Returns the remaining segment of the routeClass representing a route event (turn, transition, etc.).
Properties:
type - Event type discriminatorturnEvent - Payload with turn type and angletransitionEntryEvent - Transition start payload (from, to)transitionExitEvent - Transition finish payload (from, to)targetReachedEvent - Reached target payload (index, point)Enumeration of route event types:
TURN_EVENT - Turn eventTRANSITION_ENTRY_EVENT - Transition entry eventTRANSITION_EXIT_EVENT - Transition exit eventTARGET_REACHED_EVENT - Target reached eventEnumeration of turn event variants:
LEFT_SLIGHT, LEFT_NORMAL, LEFT_SHARPRIGHT_SLIGHT, RIGHT_NORMAL, RIGHT_SHARPCOMPLETEAll examples demonstrate how to get all enum values using the values() method or equivalent platform-specific approach.
Class for configuring route planning parameters.
Properties:
smoothRadius - Controls route smoothing (0 = no smoothing)maxProjectionDistance - Maximum deviation distance before route rebuildmaxAdvance - Maximum distance advancement between navigation solutionsClass representing a point within a location.
Properties:
point - X and Y coordinates in meterslocationId - Location identifiersublocationId - Sublocation identifierClass representing 2D coordinates.
Properties:
x - X coordinatey - Y coordinatedart/async_route_manager_example.dart[dart_AsyncRouteManager_createRouteSession][dart_AsyncRouteListener_onRouteChanged][dart_RoutePath_getLength][dart_RouteEventType_values][dart_RouteStatus_values]java/AsyncRouteManagerExample.java[java_AsyncRouteManager_createRouteSession][java_AsyncRouteListener_onRouteChanged][java_RoutePath_getLength][java_RouteEventType_values][java_RouteStatus_values]kotlin/AsyncRouteManagerExample.kt[kotlin_AsyncRouteManager_createRouteSession][kotlin_AsyncRouteListener_onRouteChanged][kotlin_RoutePath_getLength][kotlin_RouteEventType_values][kotlin_RouteStatus_values]objc/AsyncRouteManagerExample.m[objc_AsyncRouteManager_createRouteSession][objc_AsyncRouteListener_onRouteChanged][objc_RoutePath_getLength][objc_RouteEventType_values][objc_RouteStatus_values]swift/AsyncRouteManagerExample.swift[swift_AsyncRouteManager_createRouteSession][swift_AsyncRouteListener_onRouteChanged][swift_RoutePath_getLength][swift_RouteEventType_values][swift_RouteStatus_values]All examples demonstrate the following common patterns:
Each example includes comprehensive documentation tags that help developers quickly locate specific API usage examples:
[platform_ClassName_methodName] - For method demonstrations[platform_ClassName_propertyName] - For property access[platform_ClassName_constructor] - For object creation[platform_ClassName_values] - For enum value demonstrationsThese tags help developers quickly locate specific API usage examples across all platforms.
Each platform has its own way of running the examples:
dart async_route_manager_example.dartjavac AsyncRouteManagerExample.java && java AsyncRouteManagerExamplekotlin AsyncRouteManagerExampleKtswift AsyncRouteManagerExample.swift