VoiceInstructions

@Serializable
data class VoiceInstructions(val distanceAlongGeometry: Double, val announcement: String? = null, val ssmlAnnouncement: String? = null)

This class provides information thats useful for properly making navigation announcements at the correct time. Essentially, a distance and a string are given, using Turf Distance measurement methods you can measure the users current location to the next steps maneuver point and if the measured distance is less than the one the API provides, the announcement should be made.

Since

3.0.0

Constructors

Link copied to clipboard
constructor(distanceAlongGeometry: Double, announcement: String? = null, ssmlAnnouncement: String? = null)

Types

Link copied to clipboard
class Builder(distanceAlongGeometry: Double)

Builder class for creating VoiceInstructions instances.

Properties

Link copied to clipboard
val announcement: String? = null

Provides the instruction string which was build on the server-side and can sometimes concatenate instructions together if maneuver instructions are too close to each other.

Link copied to clipboard

This provides the missing piece in which is needed to announce instructions at accurate times. If the user is less distance away from the maneuver than what this distanceAlongGeometry() than, the announcement should be called.

Link copied to clipboard

Get the same instruction string you'd get from .announcement but this one includes Speech Synthesis Markup Language which helps voice synthesiser read information more humanely.

Functions

Link copied to clipboard

Creates a builder initialized with the current values of the VoiceInstructions instance.