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:
IDLE
- Initial state when router is createdMISSING_GRAPH
- Router is missing the route graphMISSING_POSITION
- Router is missing the current positionPOSITION_OFF_GRAPH
- Current position is off the route graphREADY
- 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 meterspoints
- List of consecutive points along the routeevents
- List of consecutive route eventsMethods:
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 (TURN_LEFT, TURN_RIGHT, TRANSITION)value
- Angle in degrees for turns, or target sublocation ID for transitionsdistance
- Distance from the beginning of the route to the eventEnumeration of route event types:
TURN_LEFT
- Left turn eventTURN_RIGHT
- Right turn eventTRANSITION
- Sublocation transition eventAll 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.dart
javac AsyncRouteManagerExample.java && java AsyncRouteManagerExample
kotlin AsyncRouteManagerExampleKt
swift AsyncRouteManagerExample.swift