npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

baidumap

v0.0.4

Published

nodejs版百度地图服务sdk

Readme

##百度地图sdk

http://developer.baidu.com/map/index.php?title=webapi

使用:

首先需要在百度上申请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