Layer that renders a route on the map as traveled and remaining polylines. More...
Inherits Finalizable.
Public Member Functions | |
| void | setVisible (bool visible) |
| Shows or hides the route layer. | |
| bool | isVisible () |
| Returns true if the route layer is visible. | |
| void | setTarget (RouteEndpoint target) |
| Starts turn-by-turn guidance to the target from the current position. | |
| void | setRoute (RouteEndpoint from, RouteEndpoint to) |
| Builds and shows a static route between two points (no live guidance). | |
| void | clear () |
| Cancels guidance / static route and removes polylines from the map. | |
| List< RouteView > | routes () |
| Returns currently rendered routes. V1 exposes a single active route. | |
| RouteView | selectedRoute () |
| Returns selected route view, or null when no route is selected. | |
| void | selectRoute (RouteView? route) |
| Selects the provided route view. Pass null to clear selection. | |
| void | addRouteLayerListener (RouteLayerListener listener) |
| Adds listener for route lifecycle, progress and target reach events. | |
| void | removeRouteLayerListener (RouteLayerListener listener) |
| Removes previously added route layer listener. | |
| void | addRouteViewListener (RouteViewListener listener) |
| Adds listener for route view list, selection and tap events. | |
| void | removeRouteViewListener (RouteViewListener listener) |
| Removes previously added route view listener. | |
| void | setTraveledColor (Color color) |
| Sets traveled (passed) route polyline color. | |
| void | setRemainingColor (Color color) |
| Sets remaining route polyline color. | |
| void | setWidth (double width) |
| Sets route polyline width in pixels (also used as default dotted point size). | |
| void | setRemainingStyle (RouteRemainingStyle style) |
| Sets rendering style for the remaining route. | |
| RouteRemainingStyle | remainingStyle () |
| Returns the remaining route rendering style. | |
| void | setRemainingDashLength (double dashLength) |
| Sets dash length for DASHED remaining style. Use 0 to disable dashing. | |
| void | setRemainingGapLength (double gapLength) |
| Sets gap length for DASHED remaining style. Use 0 to disable dashing. | |
| void | setRemainingPointSize (double width, double height) |
| Sets point size for DOTTED remaining style. | |
| void | setRemainingPlacement (Placement placement) |
| Sets point placement mode for DOTTED remaining style. | |
| void | setRemainingPlacementSpacing (double spacing) |
| Sets spacing between points for DOTTED + SPACED placement (pixels). | |
| void | setRemainingPlacementMinRatio (double ratio) |
| Sets minimum polyline length ratio for DOTTED placement. | |
| void | setRemainingCollisionEnabled (bool enabled) |
| Enables or disables collision for DOTTED remaining points. | |
| bool | isValid () |
Layer that renders a route on the map as traveled and remaining polylines.
Independent from UserLocationLayer: a route can be shown without a user marker, and a user marker can be shown without a route.
Location and position are taken from the SDK automatically (same pattern as UserLocationLayer).
Referenced from NavigineSdk.
Definition at line 37 of file route_layer.dart.
| void RouteLayer.addRouteLayerListener | ( | RouteLayerListener | listener | ) |
Adds listener for route lifecycle, progress and target reach events.
Dart code snippet:
| void RouteLayer.addRouteViewListener | ( | RouteViewListener | listener | ) |
Adds listener for route view list, selection and tap events.
Dart code snippet:
| void RouteLayer.clear | ( | ) |
Cancels guidance / static route and removes polylines from the map.
Dart code snippet:
| bool RouteLayer.isValid | ( | ) |
| bool RouteLayer.isVisible | ( | ) |
Returns true if the route layer is visible.
Dart code snippet:
| RouteRemainingStyle RouteLayer.remainingStyle | ( | ) |
Returns the remaining route rendering style.
Dart code snippet:
| void RouteLayer.removeRouteLayerListener | ( | RouteLayerListener | listener | ) |
Removes previously added route layer listener.
| void RouteLayer.removeRouteViewListener | ( | RouteViewListener | listener | ) |
Removes previously added route view listener.
| List< RouteView > RouteLayer.routes | ( | ) |
Returns currently rendered routes. V1 exposes a single active route.
Dart code snippet:
| RouteView RouteLayer.selectedRoute | ( | ) |
Returns selected route view, or null when no route is selected.
Dart code snippet:
| void RouteLayer.selectRoute | ( | RouteView? | route | ) |
Selects the provided route view. Pass null to clear selection.
| route | Route view from routes, or null. |
Dart code snippet:
| void RouteLayer.setRemainingCollisionEnabled | ( | bool | enabled | ) |
Enables or disables collision for DOTTED remaining points.
Dart code snippet:
| void RouteLayer.setRemainingColor | ( | Color | color | ) |
Sets remaining route polyline color.
Dart code snippet:
| void RouteLayer.setRemainingDashLength | ( | double | dashLength | ) |
Sets dash length for DASHED remaining style. Use 0 to disable dashing.
Dart code snippet:
| void RouteLayer.setRemainingGapLength | ( | double | gapLength | ) |
Sets gap length for DASHED remaining style. Use 0 to disable dashing.
Dart code snippet:
| void RouteLayer.setRemainingPlacement | ( | Placement | placement | ) |
Sets point placement mode for DOTTED remaining style.
Dart code snippet:
| void RouteLayer.setRemainingPlacementMinRatio | ( | double | ratio | ) |
Sets minimum polyline length ratio for DOTTED placement.
Dart code snippet:
| void RouteLayer.setRemainingPlacementSpacing | ( | double | spacing | ) |
Sets spacing between points for DOTTED + SPACED placement (pixels).
Dart code snippet:
| void RouteLayer.setRemainingPointSize | ( | double | width, |
| double | height ) |
Sets point size for DOTTED remaining style.
Dart code snippet:
| void RouteLayer.setRemainingStyle | ( | RouteRemainingStyle | style | ) |
Sets rendering style for the remaining route.
Dart code snippet:
| void RouteLayer.setRoute | ( | RouteEndpoint | from, |
| RouteEndpoint | to ) |
Builds and shows a static route between two points (no live guidance).
| from | Route start endpoint. |
| to | Route finish endpoint. |
Dart code snippet:
| void RouteLayer.setTarget | ( | RouteEndpoint | target | ) |
Starts turn-by-turn guidance to the target from the current position.
| target | Destination endpoint. Route and progress are updated automatically. |
Dart code snippet:
| void RouteLayer.setTraveledColor | ( | Color | color | ) |
Sets traveled (passed) route polyline color.
Dart code snippet:
| void RouteLayer.setVisible | ( | bool | visible | ) |
Shows or hides the route layer.
Dart code snippet:
| void RouteLayer.setWidth | ( | double | width | ) |
Sets route polyline width in pixels (also used as default dotted point size).
Dart code snippet: