var map = new BMap.Map('map'); var poi = new BMap.Point(117.060673,30.54611); map.centerAndZoom(poi, 16); map.enableScrollWheelZoom(); var content = '
' + '' + '地址:安庆市中兴大道73号(4812厂斜对面)
电话:0556-5200076
简介:安徽高端品牌口腔医院' + '
'; //创建检索信息窗口对象 var searchInfoWindow = null; searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, { title : "永辉开元棋牌_开元棋牌是一场骗局_开元棋牌有没有抽水", //标题 width : 290, //宽度 height : 105, //高度 panel : "panel", //检索结果面板 enableAutoPan : true, //自动平移 searchTypes :[ BMAPLIB_TAB_SEARCH, //周边检索 BMAPLIB_TAB_TO_HERE, //到这里去 BMAPLIB_TAB_FROM_HERE //从这里出发 ] }); var marker = new BMap.Marker(poi); //创建marker对象 marker.enableDragging(); //marker可拖拽 marker.addEventListener("click", function(e){ searchInfoWindow.open(marker); }) map.addOverlay(marker); //在地图中添加marker searchInfoWindow.open(marker); //在marker上打开检索信息串口 /*$("close").onclick = function(){ searchInfoWindow.close(); }* $("open").onclick = function(){ var enableSendToPhone = false; if ($("enableSendToPhone").checked) { enableSendToPhone = true; } searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, { title : "合肥贝杰口腔医院", //标题 width : 290, //宽度 height : 105, //高度 panel : "panel", //检索结果面板 enableAutoPan : true, //自动平移 enableSendToPhone: enableSendToPhone, //是否启用发送到手机 searchTypes :[ BMAPLIB_TAB_SEARCH, //周边检索 BMAPLIB_TAB_TO_HERE, //到这里去 BMAPLIB_TAB_FROM_HERE //从这里出发 ] }); if ($("enableAutoPan").checked) { searchInfoWindow.enableAutoPan(); } else { searchInfoWindow.disableAutoPan(); }; searchInfoWindow.open(marker); } $("show").onclick = function(){ searchInfoWindow.show(); } $("hide").onclick = function(){ searchInfoWindow.hide(); } $("getPosition").onclick = function(){ var position = searchInfoWindow.getPosition(); alert("经度:" + position.lng + ";纬度:" + position.lat); } $("setValue").onclick = function(){ searchInfoWindow.setPosition(new BMap.Point($("lng").value, $("lat").value)); searchInfoWindow.setTitle($("title").value); searchInfoWindow.setContent($("content").value); } $("getContent").onclick = function(){ alert(searchInfoWindow.getContent()); } $("getTitle").onclick = function(){ alert(searchInfoWindow.getTitle()); }*/ function $(id){ return document.getElementById(id); } /* var isPanelShow = false; //显示结果面板动作 $("showPanelBtn").onclick = function(){ if (isPanelShow == false) { isPanelShow = true; $("showPanelBtn").style.right = "300px"; $("panelWrap").style.width = "300px"; $("map").style.marginRight = "300px"; $("showPanelBtn").innerHTML = "隐藏检索结果面板
>"; } else { isPanelShow = false; $("showPanelBtn").style.right = "0px"; $("panelWrap").style.width = "0px"; $("map").style.marginRight = "0px"; $("showPanelBtn").innerHTML = "显示检索结果面板
<"; } }*/