Code Monkey home page Code Monkey logo

baidumap's Introduction

##百度地图sdk

使用:

首先需要在百度上申请ak 申请地址

npm install baidumap

var baiduMap = require('baidumap');
var bdmap = baiduMap.create({'ak':'xxxxxxxxxxxxxxxxxxxxxxxxx'});  

百度地图place相关用法:(请求字段按照百度官方文档)

1.城市内检索 官方地址

    var options = {'query':'***','region':'北京'};  
    bdmap.search(options,function(err,reuslt){});  

2.矩形检索 官方地址

    var options = {'query':'***','bounds':'39.915,116.404,39.975,116.414','page_size':1};
    bdmap.search(options,function(err,reuslt){});  

3.圆形区域检索 官方地址

    var options = {'query':'银行','location':'39.915,116.404','page_size':2,'radius':100};
    bdmap.search(options,function(err,reuslt){});

4.区域详情检索 官方地址

    var detailOption = {'uid':'8ee4560cf91d160e6cc02cd7'};
    bdmap.detail(detailOption,function(err,reuslt){});

5.团购信息检索 官方地址

    var eventsearchOption = {'query':'美食','event':'groupon','region':131,'bounds':'39.915,116.404,39.935,116.435','page_size':1};
    bdmap.eventsearch(eventsearchOption,function(err,reuslt){});

6.商家团购详情查询 官方地址

    var eventdetailOption = {'uid':'c14fc238f7fadd4ea5da390f'};
    bdmap.eventdetail(eventdetailOption,function(err,reuslt){});

百度地图Place Suggestion API相关用法 官方地址

    var suggestionOption = {'query':'***','region':131};
    bdmap.suggestion(suggestionOption,function(err,reuslt){});

百度地图Geocoding API 相关用法 官方地址

1.地理编码

    var geocoderOption = {'address':'***','city':'北京市','callback':'showMap'};
    bdmap.geocoder(geocoderOption,function(err,reuslt){});

2.逆地理编码

    var reverseGeocoderOption = {'location':'39.983424,116.322987','pois':1,'callback':'showMap'};
    bdmap.reverseGeocoder(reverseGeocoderOption,function(err,reuslt){});

百度地图Direction API 相关用法 官方地址

    var directionOption = {'origin':'上地五街','destination':'北京大学','origin_region':'北京','destination_region':'北京'};
    bdmap.direction(directionOption,function(err,reuslt){});

百度地图Route Matrix API 相关用法 官方地址

    var routeMatrixOption = {'origins':'***|鸟巢','destinations':'北京大学'};
    bdmap.routeMatrix(routeMatrixOption,function(err,reuslt){});

百度地图Route Matrix API 相关用法 官方地址

    var ipSearchOption = {ip:"119.75.217.56"};
    bdmap.ipSearch(ipSearchOption,function(err,reuslt){});

百度地图 坐标转换API 相关用法 官方地址

    var geoconvOption = {coords:'114.21892734521,29.575429778924;114.21892734521,29.575429778924'};
    bdmap.geoconv(geoconvOption,function(err,reuslt){});

具体示例可以查看test.js

baidumap's People

Contributors

jiangli373 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.