字体问题

This commit is contained in:
wanggeng 2022-09-27 12:06:04 +08:00
parent 5e1fb34846
commit c9c269b5bd
2 changed files with 7 additions and 1 deletions

View File

@ -296,6 +296,9 @@ BaiduMap.prototype.setLabelFontSize = function (size) {
for (var i = 0, label; label = this.labelArray[i++];) {
label.show();
label.setOffset(new BMap.Size(-label.content.length * size / 2, -size / 2));
label.setStyle({
fontSize: size + 'px'
})
}
}
// 获得Map对象

View File

@ -302,6 +302,9 @@ BaiduMap.prototype.setLabelFontSize = function (size) {
}
label.show();
label.setOffset(new BMap.Size(-label.content.length * size / 2, -size / 2));
label.setStyle({
fontSize: size + 'px'
})
}
}
// 获得Map对象
@ -764,7 +767,7 @@ BaiduMap.prototype.initBackgroundGrid = function (option) {
border: 'none',
backgroundColor: 'transparent',
textShadow: '1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff',
fontSize: fontSize: '0px'
fontSize: '0px'
});
label.setOffset(new BMap.Size(-backgroundGrid.label.length * self.gridOption.const.LABEL_FONT_SIZE / 2, -self.gridOption.const.LABEL_FONT_SIZE / 2));
label.setPosition(self.getCenterPoint(backgroundGrid.pointArray));