Skip to Content
API ReferenceConfigurationRouteConfiguration

RouteConfiguration

Constructors

RouteConfiguration.new

RouteConfiguration.new({required dynamic initialLocation, required dynamic finalLocation, String mapId = '', bool preferAccessibleRoute = false, String? nextStepsRouteColor = '#33B5E5', String? prevStepsRouteColor = '#aaaaaa', double polylineWidth = 10, dynamic nextStepsRouteStyle, dynamic prevStepsRouteStyle, String? language = 'es', String? unitSystem = 'METRIC', String? announceFormat = 'RELATIVE'})

Configuration for creating routes on the map with enhanced origin handling. const

Properties

PropertyTypeDescription
announceFormatString?Format for route announcements (‘RELATIVE’ or ‘ABSOLUTE’). Defaults to ‘RELATIVE’. (final)
finalLocationdynamicFinal destination for the route. Can be either a LzLocation object or a place ID string. This is required for route creation. (final)
initialLocationdynamicStarting location for the route. Can be either a LzLocation object or a place ID string. If null or not provided, the system will use the user’s current location as fallback. (final)
languageString?Language for route instructions (e.g., ‘es’, ‘en’, ‘fr’). Defaults to ‘es’. (final)
mapIdStringIdentifier of the target map where the route will be displayed. (final)
nextStepsRouteColorString?Color for the next steps of the route in hexadecimal format (e.g., ‘#FF0000’). Defaults to ‘#33B5E5’. (final)
nextStepsRouteStyledynamicStyle configuration for the next steps of the route. Can be used for advanced styling options. (final)
polylineWidthdoubleWidth of the route polyline in pixels. Defaults to 10. (final)
preferAccessibleRouteboolWhether to prefer accessible routes (e.g., avoiding stairs, using ramps). Defaults to false. (final)
prevStepsRouteColorString?Color for the previous steps of the route in hexadecimal format (e.g., ‘#CCCCCC’). Defaults to ‘#aaaaaa’. (final)
prevStepsRouteStyledynamicStyle configuration for the previous steps of the route. Can be used for advanced styling options. (final)
unitSystemString?Unit system for distances (‘METRIC’ or ‘IMPERIAL’). Defaults to ‘METRIC’. (final)

Methods

toJson

toJson() → Map<String, Object?>
Last updated on