地图坐标服务

最后更新于:2022-04-02 08:18:43

## 地图坐标服务 ![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/f2/a0/f2a0a0726804a54764a38ff94a12c1a8_207x185.png) > 支持百度、谷歌、GPS三大经纬度互相转化 ## 接口费用( [点击购买](https://market.topthink.com/product/324)) > 最低 0.01元/次 ## 接口调用([调用须知](https://docs.topthink.com/think-api/1835086)) ### 请求地址 ``` GET https://api.topthink.com/geo/convert ``` ### 请求参数 | 名称 | 必填 | 类型 | 说明 | | --- | --- | --- | --- | | appCode| 是 |string| 用户授权码,参考[API调用](https://docs.topthink.com/think-api/1835086) | | lng | 是 | string | 经度,如:116.3974965092 | | lat | 是 | string | 纬度,如:39.908700982285396 | | type | 是 | int | 转换类型,1:GPS->百度 ,3:GPS->谷歌,  5:百度->谷歌 ,6:谷歌->百度 | ### 返回`data`参数 参考返回示例 ## SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->geoConvert() ->withLat('39.908700982285396') ->withLng('116.3974965092') ->withType(6) ->request(); ``` 返回示例: ~~~ { "code":0, "message": "成功", "data": { "lng":"116.3974965092", /*原经度*/ "lat":"39.908700982285396", /*原纬度*/ "off_lng":"116.40392322342767", /*转换后经度*/ "off_lat":"39.91494947029461", /*转换后纬度*/ "type":"6" } } ~~~
';