Navigation Component


Properties

apiKey
  API Key for Open Route Service. Obtain an API key at https://openrouteservice.org.
Data type: string
Designer Writable true <navigation name="navigationName" apiKey="Test apiKey">
Code Writeable true navigationName.apiKey = "Test apiKey"
Code Readable false

endLatitude
  The latitude of the end location.
Data type: number
Designer Writable true <navigation name="navigationName" endLatitude="-27">
Code Writeable true navigationName.endLatitude = -27
Code Readable true let variable = navigationName.endLatitude

endLocation
  Set the end location.
Data type: string
Designer Writable false
Code Writeable true navigationName.endLocation = getComponent(circle1)
Code Readable false

endLongitude
  The longitude of the end location.
Data type: number
Designer Writable true <navigation name="navigationName" endLongitude="152">
Code Writeable true navigationName.endLongitude = 152
Code Readable true let variable = navigationName.endLongitude

language
  The language to use for textual directions. Default is "en" for English.
Data type: string
Designer Writable true <navigation name="navigationName" language="en">
Code Writeable true navigationName.language = "en"
Code Readable true let variable = navigationName.language

responseContent
  The raw response from the server. This can be used to access more details beyond what the GotDirections event provides.
Data type: object
Designer Writable false
Code Writeable false
Code Readable true let variable = navigationName.responseContent

startLatitude
  The latitude of the start location.
Data type: number
Designer Writable true <navigation name="navigationName" startLatitude="-27.5083">
Code Writeable true navigationName.startLatitude = -27.5083
Code Readable true let variable = navigationName.startLatitude

startLocation
  Set the start location.
Data type: string
Designer Writable false
Code Writeable true navigationName.startLocation = getComponent(circle2)
Code Readable false

startLongitude
  The longitude of the start location.
Data type: number
Designer Writable true <navigation name="navigationName" startLongitude="152.9281">
Code Writeable true navigationName.startLongitude = 152.9281
Code Readable true let variable = navigationName.startLongitude

transportationMethod
  The transportation method used for determining the route. Valid options are 'walking', 'driving', 'cycling', 'wheelchair'
Data type: string
Designer Writable true <navigation name="navigationName" transportationMethod="driving">
Code Writeable true navigationName.transportationMethod = "driving"
Code Readable true let variable = navigationName.transportationMethod

class
  The styling class of the the component
Data type: string
Designer Writable true <navigation name="navigationName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <navigation name="navigationName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <navigation name="navigationName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
requestDirections Request directions from the routing service using the values of StartLatitude, StartLongitude, EndLatitude, and EndLongitude. On success, the GotDirections event block will run. If an error occurs, the error will be reported via the Screen's ErrorOccurred event.
navigationName.requestDirections()
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
gotDirections Event indicating that a request has finished and has returned data. The following parameters are provided:- directions: A list of text directions, such as "Turn left at Massachusetts Avenue"., points: A list of (latitude, longitude) points that represent the path to take. This can be passed to LineString's Points to draw the line on a Map. distance: Estimated distance for the route, in meters. duration: Estimated duration for the route, in seconds.
navigationName.addEventListener(
    "gotDirections",
    function (directions, points, distance, duration) {
        //Your code here
    }
)
directions list
points list
distance number
duration number