Extension qnx.navigation

qnx.navigation

Allow control of GPS navigation

Methods

addFavourite

Add a location to the current user's favorite locations
Parameters:
Name Type Description
location Object The location object as returned by getHistory(), browsePOI(), or search()

browsePOI

Browse the POI (Point of Interest) database near a location
Parameters:
Name Type Description
categoryId Number A category ID to browse [optional]; defaults to 0 for root category
location Object The location around which we want to find a POI [optional]; defaults to current location
Returns:
An array of category objects
Type
  • Array
Example
{
    id: {Number},    //the ID of the category
    name: {String},  //the name of the category
    type: {String},  //the POI type of the category
}

cancelNavigation

Cancel the navigation if it is in progress

clearHistory

Clear the current user's navigation history

getFavourites

Get the current user's favorite locations
Returns:
An array of favorite objects
Type
  • Array
Example
{
    id: {Number},            //the ID of the location
    name: {String},          //the name of the location
    number: {String},        //the civic number of the address
    street: {String},        //the street of the address
    city: {String},          //the city of the address
    province: {String},      //the province of the address
    postalCode: {String},    //the postal code/zip code of the address
    country: {String},       //the country of the address
    type: {String},          //the poi type of the location
    latitude: {Number},      //the latitude of the location
    longitude: {Number},     //the longitude of the location
}

getHistory

Get the current user's navigation history
Returns:
An array of location objects showing the user's recent history
Type
  • Array
Example
{
    id: {Number},            //the ID of the location
    name: {String},          //the name of the location
    number: {String},        //the civic number of the address
    street: {String},        //the street of the address
    city: {String},          //the city of the address
    province: {String},      //the province of the address
    postalCode: {String},    //the postal code/zip code of the address
    country: {String},       //the country of the address
    type: {String},          //the poi type of the location
    latitude: {Number},      //the latitude of the location
    longitude: {Number},     //the longitude of the location
    timestamp: {Number},     //the timestamp of when the location was visited
}

getRoute

Get the current navigation route
Returns:
An array of navigation route segments, or null if not navigating
Type
  • Array
Example
{
    currentRoad: {String},   //name of the current road
    command: {String},       //command to execute to transition to the next road
    distance: {Number},      //distance covered by this segment, in metres
    time: {Number},          //amount of time required to cover this segment, in minutes
    latitude: {Number},      //latitude at the end of this segment
    longitude: {Number},     //longitude at the end of this segment
}

getStatus

Get details about the current status of the navigation engine
Returns:
A navigation status object
Type
  • Object
Example
{
    isNavigating: {Boolean},             //true if navigation is in progress, otherwise false
    segment: {Number},                   //the index of the current route segment [present if isNavigating=true]
    segmentDistanceRemaining: {Number},  //the distance remaining in the current segment, in metres [present if isNavigating=true]
    totalTimeRemaining: {Number},        //the amount of time remaining in the route, in seconds [present if isNavigating=true]
    totalDistanceRemaining: {Number},    //the distance remaining in the route, in metres [present if isNavigating=true]
}
Navigate to a specific location
Parameters:
Name Type Description
location Object The location we want to navigate to
Example
{
    name: {String},          //the name of the location
    number: {String},        //the civic number of the address
    street: {String},        //the street of the address
    city: {String},          //the city of the address
    province: {String},      //the province of the address
    postalCode: {String},    //the postal code/zip code of the address
    country: {String},       //the country of the address
    type: {String},          //the poi type of the location
    latitude: {Number},      //the latitude of the location
    longitude: {Number},     //the longitude of the location
}

panMap

Pan the current map
Parameters:
Name Type Description
deltaX Number The number of pixels to move the map on the X axis
deltaY Number The number of pixels to move the map on the Y axis

removeFavourite

Remove a location from the current user's favourite locations
Parameters:
Name Type Description
location Object The location object as returned by getFavourites()
Find a location based on a partial address
Parameters:
Name Type Description
location Object The location we want to search for

showOnMap

Show a set of locations on a map
Parameters:
Name Type Description
locations Array An array of locations to show on the map as returned by browsePOI(), search(), getFavourites(), or getHistory()

zoomMap

Zoom the current map
Parameters:
Name Type Description
scale Number The zoom scale