From d0f8deb1a1071ad1d7eab069bff043fcbd7f3361 Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Tue, 27 Sep 2022 11:57:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=BD=91=E6=A0=BC=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E5=AD=97=E4=BD=93=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/assets/js/baidu-map-0.0.1.min.js | 13 ++----------- .../assets/js/baidu-map/baidu-map-1.0.0.min.js | 10 ++-------- 2 files changed, 4 insertions(+), 19 deletions(-) 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 9fabbfb..8c30fa3 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,9 +296,6 @@ 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对象 @@ -356,16 +353,10 @@ BaiduMap.prototype.setDefaultConfig = function () { // 缩放结束 self.map.addEventListener('zoomend', function (event) { var zoom = this.getZoom(); - if (zoom < 13) { + if (zoom < 15) { self.setLabelFontSize(0); - } else if (zoom < 15) { - self.setLabelFontSize(12); - } else if (zoom < 16) { - self.setLabelFontSize(14); - } else if (zoom < 17) { - self.setLabelFontSize(16); } else { - self.setLabelFontSize(18); + self.setLabelFontSize(12); } }) } 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 4d14554..ca6d1b4 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 @@ -359,16 +359,10 @@ BaiduMap.prototype.setDefaultConfig = function () { // 缩放结束 self.map.addEventListener('zoomend', function (event) { var zoom = this.getZoom(); - if (zoom < 13) { + if (zoom < 15) { self.setLabelFontSize(0); - } else if (zoom < 15) { - self.setLabelFontSize(12); - } else if (zoom < 16) { - self.setLabelFontSize(14); - } else if (zoom < 17) { - self.setLabelFontSize(16); } else { - self.setLabelFontSize(18); + self.setLabelFontSize(12); } }) }