// 百度地图API功能
var sContent = "
杭州http://y-notthai.com刀具有限公司
" +
"
地址:浙江省杭州市拱墅区衢州街50-2号
胡女士:15291525458
金先生:15891557393
" +
"
";
var map = new BMap.Map("allmap");
map.addControl(new BMap.NavigationControl()); //添加默认缩放平移控件
map.addControl(new BMap.NavigationControl({
anchor: BMAP_ANCHOR_TOP_RIGHT,
type: BMAP_NAVIGATION_CONTROL_SMALL
})); //右上角,仅包含平移和缩放按钮
map.addControl(new BMap.NavigationControl({
anchor: BMAP_ANCHOR_BOTTOM_LEFT,
type: BMAP_NAVIGATION_CONTROL_PAN
})); //左下角,仅包含平移按钮
map.addControl(new BMap.NavigationControl({
anchor: BMAP_ANCHOR_BOTTOM_RIGHT,
type: BMAP_NAVIGATION_CONTROL_ZOOM
})); //右下角,仅包含缩放按钮
var point = new BMap.Point(120.149141, 30.32314); //113.283672|22.834463
var marker = new BMap.Marker(point);
var infoWindow = new BMap.InfoWindow(sContent); // 创建信息窗口对象
map.centerAndZoom(point, 15);
map.addOverlay(marker);
marker.openInfoWindow(infoWindow);
marker.addEventListener("click", function () {
this.openInfoWindow(infoWindow);
//图片加载完毕重绘infowindow
});