# location

地理位置 

## API 调用

### QN.app.invoke({api:'location', query})

#### API 调用入参

参数名             | 类型       | 是否可选 | 默认值 | 含义
:-------------- | :------- | :--- | :-- | :-----------------------------------------------------------------------------------------------------------------------
`query`         | `Object` |      |     |
`query.enableHighAccuracy`  | `string` |  可选    |  true/faluse | 是否获取高精度的位置，true/faluse，默认为 false。
`query.address`  | `string` |  可选    |  true/false | 是否获取地址描述，如中国杭州市，true/false，默认为 false。


#### API 响应结果

参数名      | 类型  | 示例 | 含义
:------- | :-- | :----- | :---
`result` | `*` |        | 请求响应
`query.coords`  | `object` |  <need>    |  <default> | 经纬度信息
`query.=== longitude`  | `string` |  <need>    |  <default> | 经度
`query.=== latitude`  | `string` |  <need>    |  <default> | 纬度
`query.=== altitude`  | `string` |  <need>    |  <default> | 高度
`query.=== accuracy`  | `string` |  <need>    |  <default> | 精度
`query.=== bearing`  | `string` |  <need>    |  <default> | 宿主设备当前移动的角度方向，相对于正北方向顺时针计算。
`query.=== speed`  | `string` |  <need>    |  <default> | 以米每秒为单位的设备的当前对地速度。
`query.address`  | `object` |  <need>    |  <default> | 地址信息
`query.=== city`  | `string` |  <need>    |  <default> | 城市
`query.=== province`  | `string` |  <need>    |  <default> | 省
`query.=== district`  | `string` |  <need>    |  <default> | 区
`query.=== road`  | `string` |  <need>    |  <default> | 路
`query.=== addressLine`  | `string` |  <need>    |  <default> | 详细地址


#### 调用示例

```javascript
QN.app.invoke({
      api:'location',
      query:{
                enableHighAccuracy : 'true/faluse'  ,
                    address : 'true/false'  
            
      }
}).then(result => {
    console.log(result);
}, error => {
    console.log(error);
});
    
```
