地图标注调整
parent
739904fd44
commit
e9b866220b
18
js/bdmap.js
18
js/bdmap.js
|
@ -98,14 +98,14 @@ document.write('<script type="text/javascript" src="https://api.map.baidu.com/ap
|
|||
|
||||
//显示标注时
|
||||
if (this._ismove=="0"){
|
||||
//marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
|
||||
marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
|
||||
|
||||
//显示窗口设置
|
||||
var opts = {width:250,height:110,title : "<font color=green size=3>" + this._title + "</font>"} //窗口标题
|
||||
var opts = {width:250,height:110,title : "<font color=#de0011 size=3>" + this._title + "</font>"} //窗口标题
|
||||
var infotxt="<table border='0'><tr><td valign='top'>"; //窗口内容
|
||||
if (this._pic != ""){infotxt += "<img src='"+this._pic+"' id='picid' style='float:left;margin-right:5px;padding-top:8px;' width=50>";}
|
||||
if (this._pic != ""){infotxt += "<img src='"+this._pic+"' id='picid' style='float:left;margin-right:5px;padding-top:8px; width=50>";}
|
||||
infotxt += "</td><td><p style='font-size:12px;line-height:16px;padding-top:8px;'>";
|
||||
if (this._lawfirm !=""){infotxt += "<b>公司:</b>" + this._lawfirm + "<br/>";};
|
||||
// if (this._lawfirm !=""){infotxt += "<b>公司:</b>" + this._lawfirm + "<br/>";};
|
||||
if (this._addr !=""){infotxt += "<b>地址:</b>" + this._addr + "<br/>";};
|
||||
if (this._tel !=""){infotxt += "<b>电话:</b>" + this._tel + "<br/>";};
|
||||
if (this._user !=""){infotxt += "<b>联系人:</b>" + this._user + "<br/>";};
|
||||
|
@ -118,11 +118,11 @@ document.write('<script type="text/javascript" src="https://api.map.baidu.com/ap
|
|||
|
||||
//创建信息窗口
|
||||
var infoWindow = new BMap.InfoWindow(infotxt,opts);
|
||||
// marker.addEventListener("mouseover", function(){
|
||||
// this.openInfoWindow(infoWindow);
|
||||
// //图片加载完毕重绘infowindow。防止在网速较慢,图片未加载时,生成的信息框高度比图片的总高度小,导致图片部分被隐藏
|
||||
// document.getElementById('picid').onload = function (){infoWindow.redraw();}
|
||||
// });
|
||||
marker.addEventListener("mouseover", function(){
|
||||
this.openInfoWindow(infoWindow);
|
||||
//图片加载完毕重绘infowindow。防止在网速较慢,图片未加载时,生成的信息框高度比图片的总高度小,导致图片部分被隐藏
|
||||
document.getElementById('picid').onload = function (){infoWindow.redraw();}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue