var myIcon = new BMap.Icon("image/red.gif", new BMap.Size(23, 25), { offset: new BMap.Size(0, 0)});
var marker = new BMap.Marker(point,{icon:myIcon});
map.addOverlay(marker);
var label = new BMap.Label("公司名称:"+di.name,{offset:new BMap.Size(5,-40)});
label.setStyle({
paddingLeft:"12px", //给label设置样式,任意的CSS都是可以的
fontSize:"12px", //字号
border:"0", //边
height:"50px", //高度
"280px", //宽
textAlign:"top", //文字水平居中显示
lineHeight:"30px", //行高,文字垂直居中显示
background:"url(image/showbox.png) no-repeat", //背景图片
cursor:"pointer"
});
marker.setLabel(label);
百度地图 infoBox的用法
免责声明:文章转载自《百度地图 infoBox的用法》仅用于学习参考。如对内容有疑问,请及时联系本站处理。
上篇ElasticSearch安装拼音插件(pinyin)虚拟机WMware NAT方式共享物理主机IP地址上网设置方式下篇
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=