地图标注调整

master
Lee-1203 2022-02-16 16:28:14 +08:00
parent 739904fd44
commit e9b866220b
1 changed files with 9 additions and 9 deletions

View File

@ -98,14 +98,14 @@ document.write('<script type="text/javascript" src="https://api.map.baidu.com/ap
//显示标注时 //显示标注时
if (this._ismove=="0"){ 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'>"; //窗口内容 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;'>"; 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._addr !=""){infotxt += "<b>地址:</b>" + this._addr + "<br/>";};
if (this._tel !=""){infotxt += "<b>电话:</b>" + this._tel + "<br/>";}; if (this._tel !=""){infotxt += "<b>电话:</b>" + this._tel + "<br/>";};
if (this._user !=""){infotxt += "<b>联系人:</b>" + this._user + "<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); var infoWindow = new BMap.InfoWindow(infotxt,opts);
// marker.addEventListener("mouseover", function(){ marker.addEventListener("mouseover", function(){
// this.openInfoWindow(infoWindow); this.openInfoWindow(infoWindow);
// //图片加载完毕重绘infowindow。防止在网速较慢图片未加载时生成的信息框高度比图片的总高度小导致图片部分被隐藏 //图片加载完毕重绘infowindow。防止在网速较慢图片未加载时生成的信息框高度比图片的总高度小导致图片部分被隐藏
// document.getElementById('picid').onload = function (){infoWindow.redraw();} document.getElementById('picid').onload = function (){infoWindow.redraw();}
// }); });
} }
} }