🚴
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. App

Hub Location

PreviousTouch Interaction EnabledNextClock Visible

Last updated 2 years ago

The last known hub location.

The location is updated sporadically while the hub is connected. When it gets disconnected, the current location is stored. If you want to receive continous location updates, use mobile.location.

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


COBI.app.hubLocation.read(onHubLocationChange); // Instantly get the current value
COBI.app.hubLocation.subscribe(onHubLocationChange);
COBI.app.hubLocation.unsubscribe(onHubLocationChange);
const onHubLocationChange = (value, timestamp) => {
    console.log(value, timestamp);
};


COBI.app.hubLocation.read(onHubLocationChange); // Instantly get the current value
COBI.app.hubLocation.subscribe(onHubLocationChange);
COBI.app.hubLocation.unsubscribe(onHubLocationChange);
Example Response
{
    "name": "Test",
    "address": "Some address",
    "category": "NONE",
    "coordinate": {
        "latitude": 0.0,
        "longitude": 0.0
    }
}
Placemark