首页  编辑  

百度地图Label居中对齐

Tags: /计算机文档/网页制作/   Date Created:
var labelStyle = {color: "red", border: "0", backgroundColor :"0.05", transform: 'translate(calc(-50% + 12px), 120%)'};  // 文本标签居中
ar p = new BMap.Point(data[i][2], data[i][3]);
var label = new BMap.Label(data[i][1]);
label.setStyle(labelStyle);
var mark = new BMap.Marker(p, {icon: myicon});
mark['index'] = i;
mark.setTitle(data[i][0]);
mark.setLabel(label);