腾讯定位 SDK 定位结果接口,包含位置坐标、精度、地址等完整的定位信息。

Author

Tencent Location Team

Since

1.0.0

interface TencentLocation {
    latitude?: number;
    longitude?: number;
    altitude?: number;
    accuracy?: number;
    direction?: number;
    directionFromSensor?: number;
    speed?: number;
    source?: LocationSource;
    geoAddress?: TencentGeoAddress;
    poiList?: TencentPOI[];
    additions?: string[];
    additionSize?: number;
    additionsMap?: Map<string, string>;
    timeStamp?: number;
    getCacheSource(): string;
}

Properties

latitude?: number

纬度。

Since

1.0.0

longitude?: number

经度。

Since

1.0.0

altitude?: number

海拔,单位:米。

Since

1.0.0

accuracy?: number

定位精度,单位:米。

Since

1.0.0

direction?: number

方向,仅 GNSS 定位结果有值。

单位:度,取值范围:[0, 360)。

Since

1.0.0

directionFromSensor?: number

方向,来自传感器。

仅当 TencentLocationRequest 中开启了 enableSensorForDirection 才有值。

单位:度,取值范围:[0, 360),0 为正北方向。

Since

1.0.0

speed?: number

速度,单位:米/秒。

Since

1.0.0

定位结果来源,标识定位技术类型(GNSS、网络、室内、RTK)。

Since

1.0.0

geoAddress?: TencentGeoAddress

逆地理编码地址信息,包含名称、地址、行政区划等信息。

Since

1.0.0

poiList?: TencentPOI[]

POI(兴趣点)列表,包含周边地点信息。

Since

1.0.0

additions?: string[]

附加信息数组。

Since

1.0.0

additionSize?: number

附加信息数组的大小。

Since

1.0.0

additionsMap?: Map<string, string>

附加信息的键值对映射。

Since

1.0.0

timeStamp?: number

定位时间戳,单位:毫秒。

Since

1.0.0

Methods

  • 获取缓存来源信息。

    Returns string

    缓存来源类型字符串:"none"(实时定位)、"sdk"(SDK 缓存)、"system"(系统缓存)。

    Since

    1.0.8