<style>
.subjectTitle { font-size: 1.15em;}
</style>

## Geolocation

### hysdk.geolocation.getCurrentPosition

<h4 class="subjectTitle">功能</h4>

获取当前位置信息。

<h4 class="subjectTitle">环境</h4>

| 平台 | 版本 | 
|-----|-----|
| iOS | |
| Android | |
| touch | 不支持 |
| 微信 | 不支持 |

<h4 class="subjectTitle">参数</h4>

| 参数 | 类型 | 描述 | 必选 | 默认值 | 备注 |
|-----|-----|-----|-----|-----|-----|
| enableHighAccuracy | bool | 是否使用高精度 | N | false | - |
| timeout | number | 超时时长，单位毫秒 ms | N | - | - |
| maximumAge | number | 缓存时长，单位毫秒 ms | N | 0 | - |

<h4 class="subjectTitle">返回参数</h4>

| 参数 | 类型 | 描述 | 备注 |
|-----|-----|-----|-----|
| type | string | 位置信息类型 | `gps` / `bd09` |
| coords | object |  位置信息 | - |
| coords.accuracy | number | 位置精度 | |
| coords.altitude | number |  | |
| coords.altitudeAccuracy | number |  | |
| coords.heading | number |  | |
| coords.latitude | number |  | |
| coords.longitude | number |  | |
| coords.timestamp | number |  | |
| coords.velocity | number |  | |

<h4 class="subjectTitle">示例</h4>

```javascript
hysdk.geolocation.getCurrentPosition({
    success: function(res) {
        // res = {
        //     "type": gps / bd09,
        //     "coords": {
        //         "accuracy": 65, // 位置精度
        //         "altitude": 68.31856536865234,
        //         "altitudeAccuracy": 10,
        //         "heading": -1,
        //         "latitude": 39.97635468414903, // 纬度，浮点数，范围为90 ~ -90
        //         "longitude": 116.299878951932, // 经度，浮点数，范围为180 ~ -180。
        //         "timestamp": 1499051091483.203,
        //         "velocity": -1,
        //     }
        // }
    },
    fail: function() {}
});
```
