nodejs sdk for http://lbsyun.baidu.com/index.php?title=webapi (Baidu map)
$ npm install baidu_map
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
});