## uni.getLocation(OBJECT)
获取当前的地理位置、速度。 在微信小程序中,当用户离开应用后,此接口无法调用;当用户点击“显示在聊天顶部”时,此接口可继续调用。
**OBJECT 参数说明**

**success 返回参数说明**

**示例**
```
uni.getLocation({
type: 'wgs84',
success: function (res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
}
});
```
Tips
组件默认为国测局坐标,调用 uni.getLocation 返回结果传递给 组件时,需指定 type 为 gcj02。
## uni.chooseLocation(OBJECT)
**打开地图选择位置。**
**OBJECT 参数说明**

**success 返回参数说明**

**示例**
```
uni.chooseLocation({
success: function (res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
}
});
```
-
|