diff --git a/src/main/resources/static/assets/js/baidu-map-0.0.1.min.js b/src/main/resources/static/assets/js/baidu-map-0.0.1.min.js index 7cd3bbd..2f42195 100644 --- a/src/main/resources/static/assets/js/baidu-map-0.0.1.min.js +++ b/src/main/resources/static/assets/js/baidu-map-0.0.1.min.js @@ -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对象 diff --git a/src/main/resources/static/assets/js/baidu-map/baidu-map-1.0.0.min.js b/src/main/resources/static/assets/js/baidu-map/baidu-map-1.0.0.min.js index 1750b20..9ec4c79 100644 --- a/src/main/resources/static/assets/js/baidu-map/baidu-map-1.0.0.min.js +++ b/src/main/resources/static/assets/js/baidu-map/baidu-map-1.0.0.min.js @@ -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));