微信LBC基础开发

百度开发者地址:http://developer.baidu.com/php

PlaceAPI接口文档:http://developer.baidu.com/map/index.php?title=webapi/guide/webservice-placeapihtml

demo:http://yunpan.cn/c3xFQvwhrWMiU  访问密码 412cweb

一、申请百度地图密钥(ak)api

点击建立应用ide

二、查看akui

三、圆形区域检索(xml)url

http://api.map.baidu.com/place/v2/search?&query=QUERY&location=LAT,LNG&radius=2000&output=xml&scope=2&page_size=10&page_num=0&ak=您的akxml

请求参数htm

返回值:接口

 

 //列表信息
<?xml version="1.0" encoding="utf-8" ?>
<PlaceSearchResponse>  
 <status>0</status> 
 <message>ok</message>   
 <total>14</total>   
 <results>   
  <result>   
   <name>俭朴菜酒店汉正街分店</name>   
   <location>    
    <lat>30.5757</lat>    
    <lng>114.278708</lng>   
   </location>       
   <address>中山大道352号(中山大道利济南路交汇口)</address>          
   <telephone>(027)85658337</telephone>                              
   <detail>1</detail>                   
   <uid>b292b3aa959b5228be4842d4</uid>              
   <detail_info>           
    <tag>美食;中餐厅</tag>                
    <detail_url>http://api.map.baidu.com/place/detail?uid=您的ak&amp;output=html&amp;source=placeapi_v2</detail_url> //这里能够连接到详情页面
    <type>cater</type>                
    <distance>1232</distance>                     
    <price>39.0</price>                     
    <overall_rating>3.7</overall_rating>                     
    <service_rating>2.8</service_rating>                
    <environment_rating>2.8</environment_rating> 
    <image_num>36</image_num>      
    <comment_num>19</comment_num>     
    <di_review_keyword>Array</di_review_keyword> 
   </detail_info>     
  </result>
 </results>
</PlaceSearchResponse> 

四、Place详情检索服务

http://api.map.baidu.com/place/v2/detail?uid=5a8fb739999a70a54207c130&ak=您的ak&output=xml&scope=2

请求参数:

返回值

{
    "status": 0,
    "message": "ok",
    "result": {
        "name": "百度大厦员工食堂",
        "location": {
            "lng": 116.308022,
            "lat": 40.056892
        },
        "address": "海淀区上地十街10号(近辉煌国际)",
        "detail": 1,
        "uid": "5a8fb739999a70a54207c130",
        "detail_info": {
            "tag": "美食;其余",
            "detail_url": "http://api.map.baidu.com/place/detail?uid=5a8fb739999a70a54207c130&output=html&source=placeapi_v2",
            "type": "cater",
            "price": "11.0",
            "overall_rating": "4.0",
            "taste_rating": "4.0",
            "service_rating": "4.0",
            "environment_rating": "4.0",
            "image_num": "2",
            "comment_num": "8",
            "shop_hours": "早9点到晚8点",
            "atmosphere": "",
            "featured_service": "",
            "recommendation": "麻辣烫,烤鱼",
            "description": "门店介绍:"
        }
    }
}

注意:必须先有百度帐号,才能成为开发者,申请密钥

相关文章
相关标签/搜索