");
}
}
};
var localSearch = new BMap.LocalSearch(map, options);
localSearch.enableAutoViewport(); //允许自动调节窗体大小
//localSearch.search(keyword);
localSearch.searchInBounds(keyword, map.getBounds());
}
function addClickHandler(content, marker) {
marker.addEventListener("click", function(e) {
openInfo(content, e)
});
}
function openInfo(content, e) {
var p = e.target;
var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
var infoWindow = new BMap.InfoWindow(content, opts); // 创建信息窗口对象
map.openInfoWindow(infoWindow, point); //开启信息窗口
}
function openInfoWin(poi, point) {
//alert("poi="+poi.title);
var content =
"