baidu_map

1.2.0 • Public • Published

npm download npm version

nodejs sdk for http://lbsyun.baidu.com/index.php?title=webapi (Baidu map)

APIs

See Baidu Web API Doc

Installation

$ npm install baidu_map

General Usage

var BaiduMap = require('baidu_map');
 
// Get an api object for a certain ak/sk
var baiduMap = BaiduMap(
  {
    ak: 'ak',
    // Optional, if provided, it will calculate the sn every request
    sk: 'sk',
    // Optional, default json, could be xml
    output: 'xml'
  });
 
// Supported API
{
  geocoder: "/geocoder/v2/",
  direction: "/direction/v1",
  directionRouteMatrix: "/direction/v1/routematrix",
  locationIp: "/location/ip",
  geoconv: "/geoconv/v1/",
  placeSuggestion: "/place/v2/suggestion/",
  placeSearch: "/place/v2/search",
  placeDetail: "/place/v2/detail",
  placeEventSearch: "/place/v2/eventsearch",
  placeEventDetail: "/place/v2/eventdetail"
}
 
// Sample call
baiduMap.geocoder({city: '深圳市', address: 'some where'}, (err, res, body) => {
  // do something with the response
});

License

license

Package Sidebar

Install

npm i baidu_map

Weekly Downloads

4

Version

1.2.0

License

MIT

Last publish

Collaborators

  • jy00520336