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