🚴
COBI.Bike
  • Introduction
  • Getting up and running
  • Namespaces
    • App
      • Theme
      • Text to Speech
      • Read Later
      • Language
      • Contact
      • Touch Interaction Enabled
      • Hub Location
      • Clock Visible
      • Is Dark
      • Is Hub Connected
    • Parameters
      • Language
      • Context
      • SDK Version
    • Hub
      • Motor Interface Ready
      • Bell Ringing
      • External Interface Action
      • Ambient Light State
    • Battery
      • State
    • Battery Two
      • State
    • Battery Controller
      • Slots
      • State
    • Motor
      • Serialnumber
      • Distance
      • Assistance Indicator
      • Range
      • Supported Drive Modes
      • Drive mode
      • Next Service
      • Power On Time
    • Mobile
      • Location
      • Heading
      • Location Availability
    • Navigation Service
      • Route
      • Eta
      • Distance To Destination
      • Status
      • Control
    • User
      • Temperature Unit
      • Length Unit
    • Bike
      • Type
    • Ride Service
      • Speed
      • User Power
      • User Power Availability
      • Heart Rate
      • Heart Rate Availability
      • Cadence
      • Cadence Availability
    • Tour Service
      • Calories
      • Ascent
      • Riding Distance
      • Riding Duration
      • Average Speed
    • Devkit
      • Override ThumbController Mapping
  • Entities
    • Theme
    • RgbColor
    • TextToSpeechContent
    • ReadLaterItem
    • ContactData
    • ExternalInterfaceAction
    • AmbientLightState
    • BatteryCondition
      • BatteryState
    • BatterySlots
    • ServiceTrigger
    • Location
    • Coordinate
    • Route
    • NavigationStatus
    • NavigationCommand
      • NavigationAction
    • TemperatureUnit
    • MeasurementUnit
    • BikeType
    • Placemark
      • PlacemarkCategory
Powered by GitBook
On this page
  1. Namespaces
  2. Navigation Service

Route

PreviousNavigation ServiceNextEta

Last updated 2 years ago

The calculated navigation route.

Drawn on the map during a ride and used for turn-by-turn advices. The route is not updated while riding — live information is available via the navigation service eta and distance to destination.

To request a route to a different destination write to the navigation service control.

const onRouteChange = (value: Route, timestamp?: Date) => {
    console.log(value, timestamp);
};

COBI.navigationService.route.subscribe(onRouteChange);
COBI.navigationService.route.unsubscribe(onRouteChange);
const onRouteChange = (value, timestamp) => {
    console.log(value, timestamp);
};

COBI.navigationService.route.subscribe(onRouteChange);
COBI.navigationService.route.unsubscribe(onRouteChange);
Example Response
{
    "origin": {
        "name": "Test",
        "address": "Some address",
        "category": "SHOPPING",
        "coordinate": {
            "latitude": 12.345,
            "longitude": 12.345
        }
    },
    "destination": {
        "name": "Test 2",
        "address": "Some other address",
        "category": "NONE",
        "coordinate": {
            "latitude": 57.345,
            "longitude": 80.365
        }
    },
    "name": "Test",
    "distance": 12,
    "elevationGain": 56,
    "duration": 5.5,
    "predefined": true,
    "waypoints": {
        "latitude": 57.345,
        "longitude": 80.365
    }
}
Route