Layer that renders a route on the map as traveled and remaining polylines. More...
#include <com/navigine/idl/objc/NCRouteLayer.h>
Inherits NSObject.
Instance Methods | |
| (void) | - setVisible: |
| Shows or hides the route layer. | |
| (BOOL) | - isVisible |
| Returns true if the route layer is visible. | |
| (void) | - setTarget: |
| Starts turn-by-turn guidance to the target from the current position. | |
| (void) | - setRoute: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. | |
| (nonnull NSArray< NCRouteView * > *) | - routes |
| Returns currently rendered routes. V1 exposes a single active route. | |
| (nullable NCRouteView *) | - selectedRoute |
| Returns selected route view, or null when no route is selected. | |
| (void) | - selectRoute: |
| Selects the provided route view. Pass null to clear selection. | |
| (void) | - addRouteLayerListener: |
| Adds listener for route lifecycle, progress and target reach events. | |
| (void) | - removeRouteLayerListener: |
| Removes previously added route layer listener. | |
| (void) | - addRouteViewListener: |
| Adds listener for route view list, selection and tap events. | |
| (void) | - removeRouteViewListener: |
| Removes previously added route view listener. | |
| (void) | - setTraveledColor: |
| Sets traveled (passed) route polyline color. | |
| (void) | - setRemainingColor: |
| Sets remaining route polyline color. | |
| (void) | - setWidth: |
| Sets route polyline width in pixels (also used as default dotted point size). | |
| (void) | - setRemainingStyle: |
| Sets rendering style for the remaining route. | |
| (NCRouteRemainingStyle) | - remainingStyle |
| Returns the remaining route rendering style. | |
| (void) | - setRemainingDashLength: |
| Sets dash length for DASHED remaining style. Use 0 to disable dashing. | |
| (void) | - setRemainingGapLength: |
| Sets gap length for DASHED remaining style. Use 0 to disable dashing. | |
| (void) | - setRemainingPointSize:height: |
| Sets point size for DOTTED remaining style. | |
| (void) | - setRemainingPlacement: |
| Sets point placement mode for DOTTED remaining style. | |
| (void) | - setRemainingPlacementSpacing: |
| Sets spacing between points for DOTTED + SPACED placement (pixels). | |
| (void) | - setRemainingPlacementMinRatio: |
| Sets minimum polyline length ratio for DOTTED placement. | |
| (void) | - setRemainingCollisionEnabled: |
| Enables or disables collision for DOTTED remaining points. | |
Properties | |
| BOOL | valid |
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 32 of file NCRouteLayer.h.
| - (void) addRouteLayerListener: | (nullable id< NCRouteLayerListener >) | listener |
Adds listener for route lifecycle, progress and target reach events.
Swift code snippet:
Objective C code snippet:
| - (void) addRouteViewListener: | (nullable id< NCRouteViewListener >) | listener |
Adds listener for route view list, selection and tap events.
Swift code snippet:
Objective C code snippet:
| - (void) clear |
Cancels guidance / static route and removes polylines from the map.
Swift code snippet:
Objective C code snippet:
| - (BOOL) isVisible |
Returns true if the route layer is visible.
Swift code snippet:
Objective C code snippet:
| - (NCRouteRemainingStyle) remainingStyle |
Returns the remaining route rendering style.
Swift code snippet:
Objective C code snippet:
| - (void) removeRouteLayerListener: | (nullable id< NCRouteLayerListener >) | listener |
Removes previously added route layer listener.
| - (void) removeRouteViewListener: | (nullable id< NCRouteViewListener >) | listener |
Removes previously added route view listener.
| - (nonnull NSArray< NCRouteView * > *) routes |
Returns currently rendered routes. V1 exposes a single active route.
Swift code snippet:
Objective C code snippet:
| - (nullable NCRouteView *) selectedRoute |
Returns selected route view, or null when no route is selected.
Swift code snippet:
Objective C code snippet:
| - (void) selectRoute: | (nullable NCRouteView *) | route |
Selects the provided route view. Pass null to clear selection.
| route | Route view from routes, or null. |
Swift code snippet:
Objective C code snippet:
| - (void) setRemainingCollisionEnabled: | (BOOL) | enabled |
Enables or disables collision for DOTTED remaining points.
Swift code snippet:
Objective C code snippet:
| - (void) setRemainingColor: | (nonnull UIColor *) | color |
Sets remaining route polyline color.
Swift code snippet:
Objective C code snippet:
| - (void) setRemainingDashLength: | (float) | dashLength |
Sets dash length for DASHED remaining style. Use 0 to disable dashing.
Swift code snippet:
Objective C code snippet:
| - (void) setRemainingGapLength: | (float) | gapLength |
Sets gap length for DASHED remaining style. Use 0 to disable dashing.
Swift code snippet:
Objective C code snippet:
| - (void) setRemainingPlacement: | (NCPlacement) | placement |
Sets point placement mode for DOTTED remaining style.
Swift code snippet:
Objective C code snippet:
| - (void) setRemainingPlacementMinRatio: | (float) | ratio |
Sets minimum polyline length ratio for DOTTED placement.
Swift code snippet:
Objective C code snippet:
| - (void) setRemainingPlacementSpacing: | (float) | spacing |
Sets spacing between points for DOTTED + SPACED placement (pixels).
Swift code snippet:
Objective C code snippet:
| - (void) setRemainingPointSize: | (float) | width | |
| height: | (float) | height |
Sets point size for DOTTED remaining style.
Swift code snippet:
Objective C code snippet:
| - (void) setRemainingStyle: | (NCRouteRemainingStyle) | style |
Sets rendering style for the remaining route.
Swift code snippet:
Objective C code snippet:
| - (void) setRoute: | (nonnull NCRouteEndpoint *) | from | |
| to: | (nonnull NCRouteEndpoint *) | to |
Builds and shows a static route between two points (no live guidance).
| from | Route start endpoint. |
| to | Route finish endpoint. |
Swift code snippet:
Objective C code snippet:
| - (void) setTarget: | (nonnull NCRouteEndpoint *) | target |
Starts turn-by-turn guidance to the target from the current position.
| target | Destination endpoint. Route and progress are updated automatically. |
Swift code snippet:
Objective C code snippet:
| - (void) setTraveledColor: | (nonnull UIColor *) | color |
Sets traveled (passed) route polyline color.
Swift code snippet:
Objective C code snippet:
| - (void) setVisible: | (BOOL) | visible |
Shows or hides the route layer.
Swift code snippet:
Objective C code snippet:
| - (void) setWidth: | (float) | width |
Sets route polyline width in pixels (also used as default dotted point size).
Swift code snippet:
Objective C code snippet:
|
readnonatomicassign |
Tells if this object is valid or not. Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now.
Definition at line 388 of file NCRouteLayer.h.