Explorar o código

fix: 数据地图标记点图标大小调整

zhangying hai 5 meses
pai
achega
f30693dcfe

+ 4 - 4
vue/src/views/dataMap/companyDataMap.vue

@@ -715,18 +715,18 @@ function setCompanyMarker(setCenter: boolean) {
 // 天地图按缩放基本计算图标与文本的大小与锚点偏移值
 function computeMarkerSize(zoomLevel: any) {
   // 计算新的icon大小
-  let newIconSize = Math.min(Math.max(zoomLevel * 2.5, 15), 30);
+  let newIconSize = Math.min(Math.max(zoomLevel * 2, 10), 15);
   // 计算新的icon锚点位置
   let iconAnchor = new T.Point(10 * (newIconSize / 15), 20 * (newIconSize / 15));
   // 计算新的偏移量,保持 label 居中且不超过初始值
-  let offsetX = -15 + ((newIconSize - 30) / 2.5);
-  let offsetY = 15 + ((newIconSize - 30) / 2.5);
+  let offsetX = -15 + ((newIconSize - 15) / 2);
+  let offsetY = 15 + ((newIconSize - 15) / 2);
   // 确保偏移量不超过初始值
   offsetX = Math.max(offsetX, -15);
   offsetY = Math.min(offsetY, 15);
   // 更新 label 的偏移量
   let newOffset = new T.Point(offsetX, offsetY);
-  let fontSize = Math.min(12, Math.max(8, 12 - (30 - newIconSize) / 2.5))
+  let fontSize = Math.min(12, Math.max(8, 12 - (15 - newIconSize) / 2))
 
   return {
     iconSize: newIconSize,

+ 4 - 4
vue/src/views/dataMap/jobUserDataMap.vue

@@ -438,12 +438,12 @@ function setMapMarker(setCenter: boolean) {
 // 天地图按缩放基本计算图标与文本的大小与锚点偏移值
 function computeMarkerSize(zoomLevel: any) {
   // 计算新的icon大小
-  let newIconSize = Math.min(Math.max(zoomLevel * 2.5, 15), 30);
+  let newIconSize = Math.min(Math.max(zoomLevel * 2, 10), 15);
   // 计算新的icon锚点位置
   let iconAnchor = new T.Point(10 * (newIconSize / 15), 20 * (newIconSize / 15));
   // 计算新的偏移量,保持 label 居中且不超过初始值
-  let offsetX = -27 + ((newIconSize - 30) / 2.5);
-  let offsetY = 2 + ((newIconSize - 30) / 2.5);
+  let offsetX = -27 + ((newIconSize - 15) / 2);
+  let offsetY = 2 + ((newIconSize - 15) / 2);
   // 确保偏移量不超过初始值
   offsetX = Math.max(offsetX, -30);
   offsetY = Math.min(offsetY, 10);
@@ -451,7 +451,7 @@ function computeMarkerSize(zoomLevel: any) {
   console.log(offsetY);
   // 更新 label 的偏移量
   let newOffset = new T.Point(offsetX, offsetY);
-  let fontSize = Math.min(12, Math.max(8, 12 - (30 - newIconSize) / 2.5))
+  let fontSize = Math.min(8, Math.max(6, 10 - (15 - newIconSize) / 2))
 
   return {
     iconSize: newIconSize,

+ 4 - 4
vue/src/views/dataMap/siteDataMap.vue

@@ -522,18 +522,18 @@ function delMapInfo() {
 // 天地图按缩放基本计算图标与文本的大小与锚点偏移值
 function computeMarkerSize(zoomLevel: any) {
   // 计算新的icon大小
-  let newIconSize = Math.min(Math.max(zoomLevel * 2.5, 15), 30);
+  let newIconSize = Math.min(Math.max(zoomLevel * 2, 10), 15);
   // 计算新的icon锚点位置
   let iconAnchor = new T.Point(10 * (newIconSize / 30), 20 * (newIconSize / 45));
   // 计算新的偏移量,保持 label 居中且不超过初始值
-  let offsetX = -20 + ((newIconSize - 30) / 2.5);
-  let offsetY = 28 + ((newIconSize - 30) / 2.5);
+  let offsetX = -20 + ((newIconSize - 15) / 2);
+  let offsetY = 28 + ((newIconSize - 15) / 2);
   // 确保偏移量不超过初始值
   offsetX = Math.max(offsetX, -20);
   offsetY = Math.min(offsetY, 28);
   // 更新 label 的偏移量
   let newOffset = new T.Point(offsetX, offsetY);
-  let fontSize = Math.min(12, Math.max(8, 12 - (30 - newIconSize) / 2.5))
+  let fontSize = Math.min(8, Math.max(6, 10 - (15 - newIconSize) / 2))
 
   return {
     iconSize: newIconSize,