This commit is contained in:
BianLzhaoMin 2025-07-04 18:21:59 +08:00
parent e2f586ad35
commit 5e657625ea
1 changed files with 18 additions and 18 deletions

View File

@ -359,10 +359,10 @@ function addAllMapPoints() {
const iconUrl = iconTypeList[12]; // 默认使用第一个图标 const iconUrl = iconTypeList[12]; // 默认使用第一个图标
const myIcon = new BMapGL.Icon( const myIcon = new BMapGL.Icon(
iconUrl, iconUrl,
new BMapGL.Size(14, 14), new BMapGL.Size(20, 20),
{ {
anchor: new BMapGL.Size(7, 14), // 修正锚点位置为中心底部 anchor: new BMapGL.Size(10, 20), // 修正锚点位置为中心底部
imageSize: new BMapGL.Size(14, 14), // 与实际图片尺寸一致 imageSize: new BMapGL.Size(20, 20), // 与实际图片尺寸一致
} }
); );
@ -455,9 +455,9 @@ function addAllMapPoints() {
const point = new BMapGL.Point(intLng, intLat); const point = new BMapGL.Point(intLng, intLat);
bounds.push(point); bounds.push(point);
const iconUrl = iconTypeList[20]; const iconUrl = iconTypeList[20];
const myIcon = new BMapGL.Icon(iconUrl, new BMapGL.Size(14, 14), { const myIcon = new BMapGL.Icon(iconUrl, new BMapGL.Size(20, 20), {
anchor: new BMapGL.Size(14, 14), // 修正锚点位置为中心底部 anchor: new BMapGL.Size(10, 20), // 修正锚点位置为中心底部
imageSize: new BMapGL.Size(14, 14), // 与实际图片尺寸一致 imageSize: new BMapGL.Size(20, 20), // 与实际图片尺寸一致
}); });
const marker = new BMapGL.Marker(point, { icon: myIcon }); const marker = new BMapGL.Marker(point, { icon: myIcon });
@ -540,10 +540,10 @@ function addAllMapPoints() {
// 1. 创建主标记点 // 1. 创建主标记点
const iconUrl = iconTypeList[parseInt(pointData.towerProgress)]; const iconUrl = iconTypeList[parseInt(pointData.towerProgress)];
let X = 14; let X = 20;
let Y = 14; let Y = 20;
let anchorX = 7; let anchorX = 10;
let anchorY = 14; let anchorY = 20;
// if ([1, 2, 3, 4, 5, 6, 0].includes(pointData.towerProgress)) { // if ([1, 2, 3, 4, 5, 6, 0].includes(pointData.towerProgress)) {
// X = 14; // X = 14;
// Y = 33.75; // Y = 33.75;
@ -754,9 +754,9 @@ function addAllMapPoints() {
// 4. 添加标签 // 4. 添加标签
let offset = new BMapGL.Size(-8, -18); let offset = new BMapGL.Size(-8, -18);
if (index % 2 == 0) { if (index % 2 == 0) {
offset = new BMapGL.Size(-10, -28); offset = new BMapGL.Size(-12, -58);
} else { } else {
offset = new BMapGL.Size(-10, 4); offset = new BMapGL.Size(-12, 24);
} }
const label = new BMapGL.Label(pointData.towerName, { const label = new BMapGL.Label(pointData.towerName, {
position: point, position: point,
@ -766,13 +766,13 @@ function addAllMapPoints() {
overlays.push(label); overlays.push(label);
label.setStyle({ label.setStyle({
color: "#fff", color: "#fff",
fontSize: "6px", fontSize: "8px",
backgroundColor: "rgba(0, 0, 0, 0.5)", backgroundColor: "rgba(0, 0, 0, 0.5)",
border: "none", border: "none",
padding: "0 1px", padding: "0 1px",
border: "1px solid #ccc", // border: "1px solid #ccc",
boxShadow: "0 0 2px 0 rgba(0, 0, 0, 0.5)", boxShadow: "0 0 2px 0 rgba(0, 0, 0, 0.5)",
borderRadius: "4px", // borderRadius: "4px",
}); });
}); });
@ -804,9 +804,9 @@ function addAllMapPoints() {
// 检查图标是否存在,不存在则使用默认图标 // 检查图标是否存在,不存在则使用默认图标
const iconUrl = iconTypeList[21]; // 默认使用第一个图标 const iconUrl = iconTypeList[21]; // 默认使用第一个图标
const myIcon = new BMapGL.Icon(iconUrl, new BMapGL.Size(14, 14), { const myIcon = new BMapGL.Icon(iconUrl, new BMapGL.Size(20, 20), {
anchor: new BMapGL.Size(7, 14), // 修正锚点位置为中心底部 anchor: new BMapGL.Size(10, 20), // 修正锚点位置为中心底部
imageSize: new BMapGL.Size(14, 14), // 与实际图片尺寸一致 imageSize: new BMapGL.Size(20, 20), // 与实际图片尺寸一致
}); });
const marker = new BMapGL.Marker(point, { icon: myIcon }); const marker = new BMapGL.Marker(point, { icon: myIcon });