VisualNavigator
public class VisualNavigator : NavigatorProtocol
extension VisualNavigator: NativeBase
extension VisualNavigator: Hashable
This class provides all functionality of NavigatorProtocol. In addition,
it provides advanced rendering capabilities for a smooth navigation experience.
This includes interpolation of location updates along a route during turn-by-turn navigation
and during tracking mode. By default, suitable map view settings are automatically applied.
For example, a predefined current location marker is rendered.
Similar to Navigator, this class continuously reacts to new locations
provided from a location source and acts as a LocationDelegate.
Note that the VisualNavigator takes control of the MapView’s (maximum) frame rate when rendering,
i.e., between VisualNavigator.startRendering(...) and VisualNavigator.stopRendering(...) calls. It overwrites the MapView’s frame
rate when some camera behavior is set using the VisualNavigator.guidanceFrameRate. When no camera behavior
is preset, the original MapView’s frame rate (the value prior to the VisualNavigator.startRendering(...) call) will
be used. While the VisualNavigator is rendering, direct changes in the MapView’s frame rate can
lead to unexpected behavior and therefore should be avoided.
-
Creates a new instance of this class.
Declaration
Swift
public init() throws -
Creates a new instance of this class.
Declaration
Swift
public init(sdkEngine: SDKNativeEngine) throwsParameters
sdkEngineAn SDKEngine instance.
-
Creates a new instance of this class using provided instance of
NavigatorProtocolas source of data.Note: The
VisualNavigatorimplements theNavigatorProtocolinterface and forwards all calls to the underlyingNavigatorProtocolinstance. When multipleVisualNavigatorinstances share the sameNavigatorProtocolinstance, method calls on this common instance will overwrite changes made by another, which may lead to unexpected behavior.Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public init(navigator: NavigatorProtocol) throwsParameters
navigatorA NavigatorInterface implementation instance.
-
Creates a new instance of this class using provided instance of
NavigatorProtocolas source of data.Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public init(sdkEngine: SDKNativeEngine, navigator: NavigatorProtocol) throwsParameters
sdkEngineAn SDKEngine instance.
navigatorA NavigatorInterface implementation instance.
-
The route to navigate. Gets and sets the route that is being navigated. If not set, only the current location information will be provided through
NavigableLocationDelegate. If set, both route progress (RouteProgressDelegate) and route deviation (RouteDeviationDelegate) will receive notifications on updates. A route may fail to be set if it is generated by an incompatible engine, in which case the operation has no effect.Declaration
Swift
public var route: Route? { get set } -
Defines the transport profile for the
Navigator, when no route is present. Properly setting the transport profile optimizes the navigation experience, and improves resource consumption. For example, aTransportProfilecan be defined with aVehicleProfile. A vehicle profile can have several parameters such asVehicleTypeto set the source of information describing the vehicle. The default is aVehicleType.carprofile.Currently used members of
TransportProfileVehicleType: Sets the transport mode.- From
vehicleProfile:grossWeightInKilograms: Required for truck related speed information.heightInCentimeters: Required for truck related speed information.widthInCentimeters: Additional truck definition for more specific truck speed information.lengthInCentimeters: Additional truck definition for more specific truck speed information.
Declaration
Swift
public var trackingTransportProfile: TransportProfile? { get set } -
Object to receive notifications about the current location. It returns
nilwhen no delegate is set by an user.Declaration
Swift
public weak var navigableLocationDelegate: NavigableLocationDelegate? { get set } -
Object to receive notifications about navigation route progress. Route progress notifications only occurs if the route has been set. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var routeProgressDelegate: RouteProgressDelegate? { get set } -
Object to receive notifications about deviations from the route if any occurs. Route deviation notifications only occurs if a route has been set. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var routeDeviationDelegate: RouteDeviationDelegate? { get set } -
Object to receive text notifications when they are available. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user. Note: In order to receive the text notification emitted for the traffic merge warner, whenTrafficMergeWarningOptions.enable_text_notificationhas been enabled, thesdk.navigation.EventTextListenermust be enabled as well.Declaration
Swift
public weak var eventTextDelegate: EventTextDelegate? { get set } -
Object to receive notifications about the arrival at each
Milestoneor missing it. It informs on all waypoints (passed or missed) that are of typeMilestoneType.stopoverbut excludes the starting waypoint. Waypoints of typeMilestoneType.passthroughare excluded, by default, but can be included viaisPassthroughWaypointsHandlingEnabled. Milestone status notifications only occurs if a route has been set. Settingnilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var milestoneStatusDelegate: MilestoneStatusDelegate? { get set } -
Object to receive the notification about the arrival at the destination. Destination reached notifications only occurs if a route has been set. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var destinationReachedDelegate: DestinationReachedDelegate? { get set } -
Object to receive notifications when a speed limit on a road is exceeded or driving speed is restored back to normal. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var speedWarningDelegate: SpeedWarningDelegate? { get set } -
Object to receive maneuver view lane assistance notifications. Maneuver view lane assistance notifications only occurs if a route has been set. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var maneuverViewLaneAssistanceDelegate: ManeuverViewLaneAssistanceDelegate? { get set } -
Object to receive current situation lane assistance view notifications. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var currentSituationLaneAssistanceViewDelegate: CurrentSituationLaneAssistanceViewDelegate? { get set } -
Object to receive notification on approaching environmental zones. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var environmentalZoneWarningListenerDelegate: EnvironmentalZoneWarningDelegate? { get set } -
Object to receive junction view lane assistance notifications. Junction view lane assistance notifications only occurs if a route has been set. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var junctionViewLaneAssistanceDelegate: JunctionViewLaneAssistanceDelegate? { get set } -
Object to receive safety camera warner notifications. If a delegate delegate is present, notifications about safety speed cameras will be also sent via
SafetyCameraWarningDelegate. Settingnilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var safetyCameraWarningDelegate: SafetyCameraWarningDelegate? { get set } -
Safety camera warning options to be passed to
SafetyCameraWarningDelegate. These options allow the enabling or disabling the text notification for the warner.Declaration
Swift
public var safetyCameraWarningOptions: SafetyCameraWarningOptions { get set } -
Object to receive notification on approaching danger zones. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var dangerZoneWarningListenerDelegate: DangerZoneWarningDelegate? { get set } -
Object to receive notifications about truck restrictions on the current road. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var truckRestrictionsWarningDelegate: TruckRestrictionsWarningDelegate? { get set } -
Truck restrictions warning options that allow to filter truck restrictions to be passed to
TruckRestrictionsWarningDelegate.Declaration
Swift
public var truckRestrictionsWarningOptions: TruckRestrictionsWarningOptions { get set } -
Object to receive post action notifications, such as a charge action at a charging station. Post actions notifications only occurs if a route has been set. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var postActionDelegate: PostActionDelegate? { get set } -
Object to receive notifications about the speed limit of the current road. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var speedLimitDelegate: SpeedLimitDelegate? { get set } -
Object to receive notifications about the textual attributes of the current road. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var roadTextsDelegate: RoadTextsDelegate? { get set } -
Object to receive notifications about attributes of the current road. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var roadAttributesDelegate: RoadAttributesDelegate? { get set } -
Object to receive notifications about road signs on the current road. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var roadSignWarningDelegate: RoadSignWarningDelegate? { get set } -
Road sign warning options that allow to filter road sings to be passed to
RoadSignWarningDelegate.Declaration
Swift
public var roadSignWarningOptions: RoadSignWarningOptions { get set } -
Object to receive notifications about school zones on the current road. Setting
nilvalue to the delegate will unset the delegate. school zones on the current road. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var schoolZoneWarningDelegate: SchoolZoneWarningDelegate? { get set } -
School zone warning options It allow to configure school zone notifications to be passed to
SchoolZoneWarningDelegate.Declaration
Swift
public var schoolZoneWarningOptions: SchoolZoneWarningOptions { get set } -
Object to receive notifications about junction views on the current road. Setting
nilvalue to the delegate will unset the delegate. This feature requires a map version greater or equal to 67 in order to function properly. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var realisticViewWarningDelegate: RealisticViewWarningDelegate? { get set } -
Realistic view warning options. It allow to filter realistic views to be passed to
RealisticViewWarningDelegate.- This feature requires a map version greater or equal to 67 in order to function properly.
Declaration
Swift
public var realisticViewWarningOptions: RealisticViewWarningOptions { get set } -
Object to receive notifications about border crossings on the current road. Border crossing notifications are given only if a route is present. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var borderCrossingWarningDelegate: BorderCrossingWarningDelegate? { get set } -
Border crossing warning options to be passed to
BorderCrossingWarningDelegate. These options allow the filtering of the border crossing warnings received and set the notification distances.Declaration
Swift
public var borderCrossingWarningOptions: BorderCrossingWarningOptions { get set } -
Object to receive information on the upcoming toll stop. Setting
nilvalue to the delegate will unset the delegate. This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.Declaration
Swift
public weak var tollStopWarningDelegate: TollStopWarningDelegate? { get set } -
Object to receive notifications about railway crossings on the current road. Railway crossing notifications are given regardless if a route is set. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var railwayCrossingWarningDelegate: RailwayCrossingWarningDelegate? { get set } -
Object to receive notifications about low speed zones on the current road. Low speed zone notifications are given regardless if a route is set. This delegate is currently available only for Japan. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var lowSpeedZoneWarningDelegate: LowSpeedZoneWarningDelegate? { get set } -
Object to receive notifications about merging traffic to the current road. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public weak var trafficMergeWarningDelegate: TrafficMergeWarningDelegate? { get set } -
Merging traffic warning options that allow to configure merging traffic notifications to be passed to
TrafficMergeWarningDelegate.Declaration
Swift
public var trafficMergeWarningOptions: TrafficMergeWarningOptions { get set } -
Object to receive the notification about the arrival at the off-road destination. Off-road destination reached notifications only occurs if a route has been set. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public var offRoadDestinationReachedDelegate: OffRoadDestinationReachedDelegate? { get set } -
Object to receive the notification about the off-road progress. Off-road progress notifications only occurs if a route has been set. Setting
nilvalue to the delegate will unset the delegate. It returnsnilwhen no delegate is set by an user.Declaration
Swift
public var offRoadProgressDelegate: OffRoadProgressDelegate? { get set } -
Options used for maneuver notifications. Notifications are only available if a route is present.
Declaration
Swift
public var maneuverNotificationOptions: ManeuverNotificationOptions { get set } -
Options used for text notifications. Notifications are only available if a route is present.
Declaration
Swift
public var eventTextOptions: EventTextOptions { get set } -
Options used for the speed warning feature.
Declaration
Swift
public var speedWarningOptions: SpeedWarningOptions { get set } -
Defines whether to enable or disable tunnel extrapolation. By default the tunnel extrapolation is enabled.
Declaration
Swift
public var isEnableTunnelExtrapolation: Bool { get set } -
Defines whether to enable or disable handling of passthrough waypoints. By default the handling of passthrough waypoints is disabled.
Declaration
Swift
public var isPassthroughWaypointsHandlingEnabled: Bool { get set } -
Traffic information for the current route. This impacts
RouteProgressupdates as the duration of theSectionProgressmight change. However, the remaining distance and the route geometry will remain unchanged.Declaration
Swift
public var trafficOnRoute: TrafficOnRoute? { get set } -
Camera behavior which defines how the
VisualNavigatorhandles the camera. Settingnildisables any camera behavior with the result that the camera does not follow the current location and keeps the last active camera state, i.e., current zoom and tilt. Furthermore, whennilis set map gestures can be used again to freely pan and zoom the map. In opposition, when a camera behavior is defined, then the map cannot be panned and zoomed by the user. The default value is an instance ofFixedCameraBehavior.Declaration
Swift
public var cameraBehavior: CameraBehavior? { get set } -
Routevisibility which defines whether to perform route rendering during visual navigation. When enabled, the setRoutewill be rendered as aMapPolylinetogether withMapArrowitems that indicate the next turns. By default, it is enabled. When disabled,MapArrowitems are still rendered. To hide arrows, useVisualNavigatorColorswith transparent color.Declaration
Swift
public var isRouteVisible: Bool { get set } -
RouteProgressvisibility which defines whether to perform route progress coloring (“eat-up”) during visual navigation. By default, it is enabled.Declaration
Swift
public var isRouteProgressVisible: Bool { get set } -
Maneuver arrows visibility which defines whether to perform maneuver arrow rendering during visual navigation. By default, it is enabled.
Declaration
Swift
public var isManeuverArrowsVisible: Bool { get set } -
Off road destination visibility which defines whether to show a dashed line between the map-matched and the original destination which is off-road. By default it is enabled. Note: The dashed line will be drawn only if the original destination is off-road.
Declaration
Swift
public var isOffRoadDestinationVisible: Bool { get set } -
A boolean which defines whether to perform rendering of traffic conditions on the route when
Routevisualization is enabled during visual navigation. When enabled the route’sMapPolylinewill be enhanced with visualization of the traffic conditions. Colors used for this visualization are defined inVisualNavigatorColors.trafficOnRouteColors. The presented traffic information is either set by the user viatrafficOnRouteor is generated from historical traffic data stored in the map. Note:VisualNavigatordoes not perform automatic traffic data updates. The updated traffic information is available through the [sdk.routing.RoutingEngine.calculate_traffic_on_route] interface. The returnedTrafficOnRoutecould then be used to update [sdk.navigation.NavigatorInterface.traffic_on_route] to refresh the traffic on route visualization. Defaults tofalse.Declaration
Swift
public var isTrafficOnRouteVisible: Bool { get set } -
Custom location indicator
LocationIndicatorwhichVisualNavigatoruses instead of the default. If set, the user is responsible for adding and removing the object to/from the mapview. It is important to stop sending location updates to the providedLocationIndicator, sinceVisualNavigatorwill control its position when rendering is active, i.e., between startRendering() and stopRendering() calls. By default this property isnil, which means the default indicator is used, andVisualNavigatorautomatically adds and removes it to/from the mapview upon startRendering() and stopRendering() calls.Declaration
Swift
public var customLocationIndicator: LocationIndicator? { get set } -
Object to receive interpolated locations. For example, to pan a second instance of a
MapViewBaseor move additional markers smoothly. The map-matched locations are used if available, otherwise the non-map-matched ones are used instead. Defaults tonil.Declaration
Swift
public weak var interpolatedLocationDelegate: InterpolatedLocationDelegate? { get set } -
Returns a value indicating whether visual navigation rendering is enabled.
Declaration
Swift
public var isRendering: Bool { get } -
Object containing colors used to render route progress and maneuver arrow visualization. Setting a new instance overwrites the default color settings as specified in
VisualNavigatorColors.Declaration
Swift
public var colors: VisualNavigatorColors { get set } -
The
measureDependentWidththat defines the route and maneuver arrows width. It is a dictionary that has keys that areMapMeasures and values that are width in pixels at thisMapMeasures. This route and maneuver arrows width is multiplied by a pixel_scalepixelScalebefore being rendered. The maneuver arrow width is additionally multiplied by a factor configurable withVisualNavigator.maneuverArrowWidthFactor; which by default equals one. The function defined by a dictionary is linearly interpolated between each successive pair of data points. For keys below the lowestMapMeasure, its corresponding value width is used. For keys above the highestMapMeasure, its corresponding value width is used. OnlyMapMeasureof [sdk.mapview.MapMeasure.Kind.ZOOM_LEVEL] type are supported.MapMeasureof other unsupported types will be ignored.measureDependentWidthwith a single entry is equivalent to use of the constant width value of this single entry for allMapMeasures. EmptymeasureDependentWidthis ignored and existing dictionary of width is maintained. The width values should be positive. Dictionary entries with width values less than or equal to 0 are ignored. If route and maneuver arrows were not configured with this property, thenmeasureDependentWidthcontains predefined values chosen to be optimal for different route classes.Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public var measureDependentWidth: [MapMeasure : Double] { get set } -
A factor of
VisualNavigator.measureDependentWidthdefining the width of the maneuver arrow. The factor should be positive. A value less than or equal to 0 is ignored. By default it is set to one.Declaration
Swift
public var maneuverArrowWidthFactor: Double { get set } -
Defines whether the position extrapolation logic is enabled or not. The predicted location follows the geometry of the route (or road) ahead. By default it is enabled.
Declaration
Swift
public var isExtrapolationEnabled: Bool { get set } -
Show the contents of a GPX file on the map. Note: This API should be used for debugging purposes only.
Declaration
Swift
public var debugGpxFilePath: String? { get set } -
When enabled, it shows useful information for debugging purposes.
- A semi-transparent location marker indicating the map-matched location.
- A gray, semi-transparent location marker indicating the raw (or original) input location.
- A red polyline indicating the most probable path.
- A SVG overlay, on the middle-left of the screen, showing the following:
- IN - Input location: coordinates [bearing] [speed] [accuracy]
- RM - Route-matched location: coordinates bearing (distance-to-raw-location)
- MM - Map-Matched location: coordinates bearing (distance-to-raw-location)
- RM-MM - distance-between-route-and-map-matched-locations
- RP - Route progress: remaining-duration remaining-distance
- SP - Section progress: section-index/sections-count remaining-duration remaining-distance
- MP - Maneuver progress: maneuver-index remaining-duration remaining-distance
- CPU - CPU usage: cpu-usage current-date-time
- MS - Milestone status: section-index MISSED|REACHED when
- RD - Route deviation: last-traveled-section-index last-traveled-section-distance when
- FPS - Frames per second: frames-per-second
Fields between brackets ([]‘s) are omitted if not available.
Example:
IN: 53.96880,14.77903 167° 8m/s RM: 53.96880,14.77903 167° (0.0m) MM: 53.96879,14.77903 167° (0.5m) RM-MM: 0.5m RP: 49h0m3s 4302km SP: 0/16 1h2m20s 58km MP: 1 5s 25m CPU: 7% 2024-01-01 13:21:59 MS: 1 REACHED 12:34:22 RD: 2 345m 11:13:55 FPS: 30.0
Note: This API should be used for debugging purposes only.
Declaration
Swift
public var isDebugModeEnabled: Bool { get set } -
Controls if the halo accuracy visualization of the default
LocationIndicatoris rendered or not. Does not affect halo accuracy indicator of theVisualNavigator.customLocationIndicator. IfVisualNavigator.customLocationIndicatoris set, then its halo accuracy indicator can be controlled usingLocationIndicator.isAccuracyVisualized.Declaration
Swift
public var isLocationAccuracyVisualized: Bool { get set } -
Flag used to enable or disable the dynamic frame rate. Controls whether the number of map updates is dynamically calculated based on the current zoom level. If the zoom level is low, i.e., the camera target distance is high, updates to LocationIndicator, MapCamera and MapPolylines representing the route progress will happen less frequent. It is on by default.
Declaration
Swift
public var isDynamicFrameRateEnabled: Bool { get set } -
Frame rate used during guidance. Frame rate used during guidance. Default is 30fps.
Declaration
Swift
public var guidanceFrameRate: Int32 { get set } -
The draw order of the polylines representing the route. The draw order of the polylines representing the route. For more details see
MapPolyline.drawOrder. The default is 0.Declaration
Swift
public var routeDrawOrder: Int32 { get set } -
The draw order type of the polylines representing the route. The draw order type of the polylines representing the route. For more details see
MapPolyline.drawOrderType. The default isDrawOrderType.mapSceneAdditionOrderDependent.Declaration
Swift
public var routeDrawOrderType: DrawOrderType { get set } -
Returns maneuver at the given index.
Declaration
Swift
public func getManeuver(index: Int32) -> Maneuver?Parameters
indexThe index of maneuver requested.
Return Value
The maneuver if it exists or otherwise
nil. -
Returns maneuver notification timing options with default values given the combination of transport mode and timing profile. The return value can be used as the base for configuring maneuver notification timings. Configure the relevant attributes of this object according to your preferences, and then set it by calling setManeuverNotificationTimingOptions function for the same combination of transport mode and timing profile.
Declaration
Swift
public func getManeuverNotificationTimingOptions(transportMode: TransportMode, timingProfile: TimingProfile) -> ManeuverNotificationTimingOptionsParameters
transportModeThe transport mode of the timing options.
timingProfileThe timing profile of the timing options.
Return Value
The timing options with default values.
-
Set timing option values for the combination of transport mode and timing profile.
Declaration
Swift
@discardableResult public func setManeuverNotificationTimingOptions(transportMode: TransportMode, timingProfile: TimingProfile, options: ManeuverNotificationTimingOptions) -> BoolParameters
transportModeThe transport mode of the timing options.
timingProfileThe timing profile of the timing options.
optionsThe timing options.
Return Value
Trueif set successfully,falsewhen options has invalid value, seeManeuverNotificationTimingOptionsfor more details about options. -
Returns the warning notification distances for the requested warning type. The return value can be used as the base for configuring warning notification distances. Configure the relevant attributes of this object according to your preferences, and then set it by calling
setWarningNotificationDistancesfunction with the same warning type and the modified warning notification distances object.Declaration
Swift
public func getWarningNotificationDistances(warningType: WarningType) -> WarningNotificationDistancesParameters
warningTypeThe warning type for which the notification distances will be returned.
Return Value
The notification distances for the given warning type.
-
Set the warning notification distances for the specified warning types. Note: The warning notification distances are set for most warners. This method can’t be used to set the warning notification distance for the School Zone warning type because it is applicable regardless of the timing profile. Use
NavigatorInterface.school_zone_warning_optionsinstead. Attempting to set the warning notification distances for the school zone warner using theNavigatorInterface.set_warning_notification_distancesmethod will fail and returnfalse. Always useSchoolZoneWarningOptions.warning_distance_in_metersto set the warning notification distance for the school zone warner regardless of theTimingProfile. IfNavigatorInterface.set_warning_notification_distancescould be used, this would allow for different distances to be set for each timing profile, which is undesirable. Attempting to set the warning notification distances for the traffic merge warner using theNavigatorInterface.set_warning_notification_distancesmethod will fail and returnfalse. Always useTrafficMergeWarningOptions.warning_distance_in_metersto set the warning notification distance for the traffic merge warner regardless of theTimingProfile. Using theNavigatorInterface.set_warning_notification_distancesmethod will fail and returnfalseto avoid seting different distances on each timing profile since the traffic merge warning is only applicable on highways.Declaration
Swift
@discardableResult public func setWarningNotificationDistances(warningType: WarningType, warningNotificationDistances: WarningNotificationDistances) -> BoolParameters
warningTypeThe warning type for which the warning notification distances will be set.
warningNotificationDistancesThe warning notification distances to be set for the specified warning types.
Return Value
Trueif set successfully,falsewhen the warning_type is [WarningType.SCHOOL_ZONE] or the options have invalid values, seeWarningNotificationDistancesfor more details about warning notification distances. -
Call of this function is used to trigger the navigator to repeat the last maneuver notification based on the current position.
Declaration
Swift
public func repeatLastManeuverNotification() -
This method calculates the distance between the current position and given coordinates. The coordinates must be on the polyline.
Declaration
Swift
public func calculateRemainingDistanceInMeters(coordinates: GeoCoordinates) -> Int32?Parameters
coordinatesThe geographic coordinates of the location.
Return Value
distance in meters or null if given coordinates are not on route or given coordinates were already traversed.
-
This method sets custom options that controls navigator behavior. Unsupported options are silently ignored. Undocumented options can change their meaning without going through deprecation process.
Declaration
Swift
public func setCustomOption(key: String, value: String)Parameters
keyOption name
valueNew option value
-
Called each time a new location is available. In a navigation context while using the
NavigatororVisualNavigator, it’s required to set theLocation.timeparameter for eachLocationobject so that the HERE SDK can map-match the locations properly. If theLocation.timeparameter is missing, the location will be ignored. For navigation, it is also recommended to provide thebearingandspeedparameters for eachLocationobject. Invoked on the main thread.Declaration
Swift
public func onLocationUpdated(_ location: Location)Parameters
locationCurrent location.
-
Returns the list of languages for maneuver notification currently available in the SDK.
Declaration
Swift
public static func availableLanguagesForManeuverNotifications() -> [LanguageCode]Return Value
the list of languages for maneuver notification currently available in the SDK.
-
Starts visual navigation rendering. A preconfigured current location marker is shown as soon as a location is received. The marker is chosen according to the transport mode specified in the route. If no route is present, the marker is chosen based on the
trackingTransportProfileproperty. Calling startRendering(_) changes theMapCamera.principalPointproperty so that the current position indicator is equal to the value from [sdk.navigation.CameraBehavior.normalized_principal_point], in which by default places the principal point slightly at the bottom of the mapview. It is restored to its original value when stopRendering() is called. Note: When rendering is started again for a new map view instance, rendering is automatically stopped on the previous map view instance. Also note that theframeRatecan be lowered to reduce CPU usage, to adjust for tradeoffs between rendering smoothness versus battery consumption.Declaration
Swift
public func startRendering(mapView: MapViewBase)Parameters
mapViewThe map view on which visual navigation will take place.
-
Stops visual navigation rendering. This removes the current location marker. Other settings, like map orientation or camera distance, which may have been altered during rendering are no longer updated.
Declaration
Swift
public func stopRendering() -
Retrieves a dictionary of default route and maneuver arrow widths as a function of
MapMeasures.Declaration
Swift
public static func defaultRouteManeuverArrowMeasureDependentWidths() -> [MapMeasure : Double]Return Value
A dictionary of default route and maneuver arrow widths as a function of
MapMeasures.