根据坐标获取地址信息,调用百度api
<h5>简要描述</h5>
<ul>
<li>根据坐标获取地址信息,调用百度api(推荐使用百度,百度API已企业实名访问次数更多)</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://business-serve.ecoweather.cn/webApi/getCityByLocation</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>POST </li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">lon</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">float</td>
<td>经度</td>
</tr>
<tr>
<td style="text-align: left;">lat</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">float</td>
<td>纬度</td>
</tr>
</tbody>
</table>
<h5>参数示例</h5>
<pre><code>{
"lon":115,
"lat":30
}</code></pre>
<h5>返回示例</h5>
<pre><code>{
"success": true,
"code": 20000,
"message": "成功",
"data": {
"responseJson": {
"result": {
"formatted_address": "湖北省黄石市大冶市",
"business": "",
"sematic_description": "",
"cityCode": 311,
"roads": [],
"location": {
"lng": 115.01180548223997,
"lat": 30.003222477194464
},
"poiRegions": [],
"pois": [],
"addressComponent": {
"city_level": 2,
"country": "中国",
"town": "",
"distance": "",
"city": "黄石市",
"adcode": "420281",
"country_code_iso": "CHN",
"country_code_iso2": "CN",
"country_code": 0,
"town_code": "",
"province": "湖北省",
"street": "",
"district": "大冶市",
"street_number": "",
"direction": ""
}
},
"status": 0
}
}
}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">addressComponent</td>
<td style="text-align: left;">String</td>
<td>已知经纬度对应的地址信息</td>
</tr>
</tbody>
</table>
<h5>备注</h5>
<ul>
<li>无</li>
</ul>