Skip to main content

bn.getLocation

getLocation(options): Promise<LocationDetail>

description Gets the current location and speed

Parameters

NameTypeDescription
optionsGetLocationOptionsGet location options

Returns

Promise<LocationDetail>

Location information


GetLocationOptions

Ƭ GetLocationOptions: Object

Type declaration

NameTypeDescription
type?stringCoordinates type: 'gcj02'; 'wgs84'
altitude?booleanSet true to return altitude. This option may slow down the interface due to the high precision is required to obtain altitude

Interface: LocationDetail

NameTypeDescription
accuracynumberAccuracy of position
altitudenumberHeight, unit m
horizontalAccuracynumberHorizontal precision, unit m
latitudenumberLatitude, range -90 ~ 90. The negative number indicates latitude south. use gcj02 NBS coordinate system
longitudenumberLongitude, range -180 ~ 180. The negative numbers indicates west longitude. use gcj02 NBS coordinate system
speednumberSpeed, unit m/s
verticalAccuracynumberVertical accuracy, unit m(return 0 when unable to get)