This commit is contained in:
lcw
2025-11-22 21:59:58 +08:00
parent ea3022c3f6
commit 93c49dff27
661 changed files with 195357 additions and 2160 deletions

View File

@ -84,7 +84,8 @@ export function MapUtil(map) {
el.style.width = size ? size : "25px";
if (flag.includes('jczMap_')) el.style.width = '45px';
if (showTitle) _that.makerShowTitle(item, [item.jd, item.wd], flag, '', offset) //展示标题
const marker = map.Marker(el, [item.jd, item.wd], { anchor: 'bottom', offset: [0, 0] })
// 确保坐标格式正确,使用对象格式传递坐标
const marker = map.Marker(el, { lng: item.jd, lat: item.wd }, { anchor: 'bottom', offset: [0, 0] })
el.addEventListener("click", () => {
_that.openInfoDetail(flag, item) //点击打开详情
})
@ -131,7 +132,7 @@ export function MapUtil(map) {
let offset = isShoeCar ? [-10, 0] : [0, 0];
if (cllxList.includes('08')) offset = [-12, -10]
const marker = map.Marker(el, [item.jd, item.wd], { anchor: 'bottom', offset: offset })
const marker = map.Marker(el, { lng: item.jd, lat: item.wd }, { anchor: 'bottom', offset: offset })
el.addEventListener("click", () => {
_that.openInfoDetail(flag, item) //点击打开详情
})
@ -140,6 +141,24 @@ export function MapUtil(map) {
});
}
// 信息框展示
MapUtil.prototype.makerShowTitle = (item, points, flag, text, offset) => {
@ -179,7 +198,7 @@ export function MapUtil(map) {
// 渲染
el.innerHTML = textTitle;
const marker = map.Marker(el, points, { anchor: 'bottom', offset: offset ? offset : [0, -50] })
const marker = map.Marker(el, Array.isArray(points) ? { lng: points[0], lat: points[1] } : points, { anchor: 'bottom', offset: offset ? offset : [0, -50] })
_that._self[flagT].push(marker)
}
@ -639,6 +658,9 @@ export function MapUtil(map) {
if (!_that._self[flag]) _that._self[flag] = [];
if (isClear && _that._self[flag]) _that.removeElement(flag); //destroy 移除,start 播放,pause 暂停
let lineString = getUUid().slice(3, 5)
console.log("1");
const data = [
{
position: coords,
@ -647,6 +669,9 @@ export function MapUtil(map) {
userData: { name: '测试1' }
}
]
console.log("2");
console.log(data);
// const s=data[0].
const track = map.trajectoryRealtime(data, {
color: '#28F', //轨迹背景颜色
width: 8,
@ -658,6 +683,7 @@ export function MapUtil(map) {
isAgain: false,//轨迹运动是否重复,
traveledColor: '#32b1fb' //运动轨迹颜色
})
console.log("3");
track.start()
track.on('length', (data) => {
@ -790,21 +816,20 @@ export function MapUtil(map) {
switch (flag) {
case 'home_yj_map':
console.log(data);
emitter.emit("showHomeYJ", data);
break;
case 'home_yj_detail':
console.log(data);
emitter.emit("showHomeWarning", data);
break;
case 'jczMap_hm':
console.log(data);
emitter.emit("showJcz", data);
break;
case 'sp':
console.log(data);
emitter.emit("showGzyInfo", data);
break;
case 'yj':
emitter.emit('yjShow', data);
break;
}
}
}