周边搜索
var map = new BMap.Map("container");
map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
var local = new BMap.LocalSearch(map, {
renderOptions:{map: map, autoViewport: true}
});
local.searchNearby("小吃", "前门");
范围搜索
var map = new BMap.Map("container");
map.centerAndZoom(new BMap.Point(116.404, 39.915), 14);
var local = new BMap.LocalSearch(map, {
renderOptions:{map: map}
});
local.searchInBounds("银行", map.getBounds());
searchNearby("小吃", new BMap.Point(116.404, 39.915),1000)也是可以的。
更多技术可见
http://developer.baidu.com/map/index.php?title=jspopular
版权声明:本文为博主原创文章,未经博主允许不得转载。