A solution for app search near features-based on the Baidu lbs cloud service

Source: Internet
Author: User

In order to achieve in the app based on the location of the search near (POI) function, using the Baidu lbs cloud service, all POI data upload, you can achieve this function.

LBS Data Management Address: After marking the information here (Support batch upload), you can start using the search function.

Http://lbsyun.baidu.com/datamanager/datamanage

Search for nearby interface addresses:

Http://api.map.baidu.com/geosearch/v3/nearby

Request Method:

GET

Parameters:

{ak: ' 540b088ff0f926b7d0b6d5a641****** ',//app key, need to go to the Baidu Open platform Application geotable_id:89059,//Data sheet ID, in the above lbs data Management address to obtain location=117.118675,39.078544,//user coordinates or latitude and longitude, need to get positioning coord_type:3,//coordinates category, 3 for Baidu coordinates, please see the following instructions radius:1000,//search scope, unit meters, Page_ index:0,//Page page_size:10,//page record number of records Q: ' American Tesla ',//keywords, will match search for nearby stores again, can be empty
Sortby:distance:1  //by distance in ascending order,-1 means descending}/**coord_type description, according to the location information you obtained to change this parameter, the use of Baidu Positioning SDK should be set to 3,
The use of HTML5 positioning should be set to 11:gps latitude and longitude coordinates 2: National Bureau of encryption latitude and longitude coordinates 3: Baidu encryption latitude and longitude coordinates 4: Baidu encryption Mercator coordinates **/

return value:

{"Status": 0, "total": 5,//result number "size": 5, "contents": [{"title": "Tianjin",//Location name "Location": [117.068811, 39.062756], "City": "Tianjin", "Crea Te_time ": 1419229456," geotable_id ": 89059," Address ":" Tianjin "," tags ":" "," Prov             Ince ":" Tianjin "," District ":" Xiqing District "," UID ": 576117245," Coord_type ": 3," type ": 0, "Distance": 4650,//distance, Unit meter "weight": 315}, {"Address": "No. 111th, Jin Wei Road, Hebei District, Tianjin" (Milan Supermarket Hebei Store) No. 1th "," City ":" Tianjin "," Create_time ": 1419053693," District ":" Hebei District "," Geot able_id ": 89059," icon_style_id ":" Sid1 "," Location ": [117.208617, 39            .155932], "modify_time": 1419229238, "Province": "Tianjin", "tags": "Shops", "title": "United States of America (Jin Wei Road branch)) "," UID ": 574315040," Coord_type ": 3," type ": 0," distance ": 11580, "Weight": si}, {"Address": "Heping Heping Road 194-196, Tianjin", "City": "Tianjin", "Create_            Time ": 1419053596," District ":" Heping "," geotable_id ": 89059," icon_style_id ":" Sid1 ", "Location": [117.201581, 39.135009], "modify_time": 141922924 3, "Province": "Tianjin", "title": "United States Tesla (Heping Road Shop)", "UID": 574314000, "Coord_type": 3, "type": 0, "distance": 9515, "Weight": si}, {"Address": "Tianjin            City Hexi District Dagu South China Resources million South building North Shop 1 floor (Near East building) "," City ":" Tianjin "," Create_time ": 1419226421," District ":" Hexi District ",                "geotable_id": 89059, "icon_style_id": "Sid1", "Location": [117.230504,   39.103007         ], "modify_time": 1419229272, "Province": "Tianjin", "title": "American Tesla (South building North Branch)",  "UID": 576070688, "Coord_type": 3, "type": 0, "distance": 10037, "weight": Wu}, {"Address": "153th Binjiang Road, Heping District, Tianjin, one floor to two floor and 2nd, Central China Road, one to four floor", "City": "Tianjin", "creat            E_time ": 1419053799," District ":" Heping "," geotable_id ": 89059," icon_style_id ":" Sid1 ", "Location": [117.204502, 39.128208], "modify_time": 1419229 233, "Province": "Tianjin", "tags": "Shop", "title": "American Tesla (Binjiang Road Shop)", "UID": 574316229 , "Coord_type": 3, "type": 0, "distance": 9238, "Weight": 54}]}

Returns a detailed table of parameters, which can be used for reference:

In this way, to achieve a search near the function, relying on Baidu's cloud platform, we can get more stable service.

Baidu lbs Open Platform also provides a search for a designated area of the interface, and search is not the same near the same, can be selected according to the actual needs, details here is not introduced, interested can refer to the Baidu lbs cloud Developer documentation.

A solution for app search near features-based on the Baidu lbs cloud service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.