(未显示1个用户的2个中间版本) | |||
第1行: | 第1行: | ||
{{car-sidebar}} | {{car-sidebar}} | ||
− | |||
− | + | == 接口说明 == | |
− | == | + | <span style="color:red;"> </span><span style="color:#FF0000;">车联网API服务的各种能力后续将合并到Web API服务中。自2015年12月31日起,车联网API服务将不再向新用户提供服务支持,服务已不再维护,请已使用了各种车联网API服务的开发者,尽快升级服务到Web API中使用。</span><br/><br/>将坐标转换成地址的功能,将经纬度信息传给百度车联网服务,服务返回详细的地址描述信息,如北京市上地十街十号百度大厦。 |
− | + | == 接口示例 == | |
− | ==接口参数设置== | + | [http://api.map.baidu.com/telematics/v3/reverseGeocoding?location=116.3017193083,40.050743859593&coord_type=gcj02&ak=E4805d16520de693a3fe707cdc962045 http://api.map.baidu.com/telematics/v3/reverseGeocoding?location=116.3017193083,40.050743859593&coord_type=gcj02&ak=E4805d16520de693a3fe707cdc962045] |
+ | |||
+ | == 接口参数设置 == | ||
{| | {| | ||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | ! width="100" | 参数类型 |
− | | | + | ! width="100" | 参数名称 |
− | | | + | ! width="100" | 是否必须 |
− | + | ! 具体描述 | |
|- | |- | ||
− | |String | + | | String |
− | | | + | | ak |
− | | | + | | true |
− | | | + | | 开发者密钥 |
|- | |- | ||
− | |String | + | | String |
− | |location | + | | sn |
− | |true | + | | false |
− | |搜索地点的经纬度; | + | | 若用户所用ak的校验方式为sn校验时该参数必须。 |
− | + | |- | |
+ | | String | ||
+ | | location | ||
+ | | true | ||
+ | | 搜索地点的经纬度; | ||
如:location= 116.30171930,40.05074385953 | 如:location= 116.30171930,40.05074385953 | ||
+ | |||
|- | |- | ||
− | |String | + | | String |
− | |output | + | | output |
− | |false | + | | false |
− | |输出的数据类型,默认为xml格式的数据,如果将output的值设置为“json”,则输出json格式的数据; | + | | 输出的数据类型,默认为xml格式的数据,如果将output的值设置为“json”,则输出json格式的数据; |
|- | |- | ||
− | |String | + | | String |
− | |coord_type | + | | coord_type |
− | |false | + | | false |
− | |请求参数坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02、wgs84。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标,wgs84表示gps获取的坐标。 | + | | 请求参数坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02、wgs84。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标,wgs84表示gps获取的坐标。 |
|- | |- | ||
− | |String | + | | String |
− | |callback | + | | callback |
− | |false | + | | false |
− | |将json格式的返回值通过callback函数返回以实现jsonp功能。举例:callback=showLocation(JavaScript函数名)。 | + | | 将json格式的返回值通过callback函数返回以实现jsonp功能。举例:callback=showLocation(JavaScript函数名)。 |
|} | |} | ||
− | ==返回结果== | + | == 返回结果 == |
{| | {| | ||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | ! width="100" | 参数类型 |
− | | | + | ! width="200" | 参数名及位置 |
− | + | ! 具体描述 | |
|- | |- | ||
− | |string | + | | string |
− | | | + | | status |
− | | | + | | 请求状态,如果成功返回0,如果失败返回其他数字,详细见状态码附录。 |
|- | |- | ||
− | |string | + | | string |
− | | | + | | description |
− | | | + | | 地点描述 |
|- | |- | ||
− | |string | + | | string |
− | | | + | | street |
− | | | + | | 所在街道 |
|- | |- | ||
− | |string | + | | string |
− | |district | + | | zipCode |
− | |所在街区的名称 | + | | Zip码 |
+ | |- | ||
+ | | string | ||
+ | | district | ||
+ | | 所在街区的名称 | ||
|} | |} | ||
− | ==返回xml格式的数据== | + | == 返回xml格式的数据 == |
− | + | <pre><ReverseGeocoderResponse> | |
− | <pre> | + | |
− | <ReverseGeocoderResponse> | + | |
<status>Success</status> | <status>Success</status> | ||
<description>北京市海淀区上地十街10号</description> | <description>北京市海淀区上地十街10号</description> | ||
第90行: | 第91行: | ||
</pre> | </pre> | ||
− | ==返回json格式的数据== | + | == 返回json格式的数据 == |
− | + | <pre>{ | |
− | <pre> | + | |
− | { | + | |
status: "Success", | status: "Success", | ||
description: "北京市海淀区上地十街10号", | description: "北京市海淀区上地十街10号", |
2022年11月14日 (一) 11:03的最后版本
接口说明
车联网API服务的各种能力后续将合并到Web API服务中。自2015年12月31日起,车联网API服务将不再向新用户提供服务支持,服务已不再维护,请已使用了各种车联网API服务的开发者,尽快升级服务到Web API中使用。
将坐标转换成地址的功能,将经纬度信息传给百度车联网服务,服务返回详细的地址描述信息,如北京市上地十街十号百度大厦。
接口示例
http://api.map.baidu.com/telematics/v3/reverseGeocoding?location=116.3017193083,40.050743859593&coord_type=gcj02&ak=E4805d16520de693a3fe707cdc962045
接口参数设置
参数类型 | 参数名称 | 是否必须 | 具体描述 |
---|---|---|---|
String | ak | true | 开发者密钥 |
String | sn | false | 若用户所用ak的校验方式为sn校验时该参数必须。 |
String | location | true | 搜索地点的经纬度;
如:location= 116.30171930,40.05074385953 |
String | output | false | 输出的数据类型,默认为xml格式的数据,如果将output的值设置为“json”,则输出json格式的数据; |
String | coord_type | false | 请求参数坐标类型,默认为gcj02经纬度坐标。允许的值为bd09ll、bd09mc、gcj02、wgs84。bd09ll表示百度经纬度坐标,bd09mc表示百度墨卡托坐标,gcj02表示经过国测局加密的坐标,wgs84表示gps获取的坐标。 |
String | callback | false | 将json格式的返回值通过callback函数返回以实现jsonp功能。举例:callback=showLocation(JavaScript函数名)。 |
返回结果
参数类型 | 参数名及位置 | 具体描述 |
---|---|---|
string | status | 请求状态,如果成功返回0,如果失败返回其他数字,详细见状态码附录。 |
string | description | 地点描述 |
string | street | 所在街道 |
string | zipCode | Zip码 |
string | district | 所在街区的名称 |
返回xml格式的数据
<ReverseGeocoderResponse> <status>Success</status> <description>北京市海淀区上地十街10号</description> <province>北京市</province> <city>北京市</city> <district>海淀区</district> <street>上地十街</street> </ReverseGeocoderResponse>
返回json格式的数据
{ status: "Success", description: "北京市海淀区上地十街10号", province: "北京市", city: "北京市", district: "海淀区", street: "上地十街", street_number: "10号" zipCode: "" }