方位角对应不上问题修改
parent
1e06ed87ca
commit
baf0200b0b
|
|
@ -2150,49 +2150,59 @@
|
||||||
childElement.style.backgroundSize = '43px 57px';
|
childElement.style.backgroundSize = '43px 57px';
|
||||||
childElement.style.position = "relative";
|
childElement.style.position = "relative";
|
||||||
arrowElement.appendChild(childElement);
|
arrowElement.appendChild(childElement);
|
||||||
pictureArrowElementArray.value?.push(childElement);
|
|
||||||
pictureParentArrowElementArray.value?.push(arrowElement);
|
let childElementObj = {
|
||||||
let arrowMark = new mapboxgl.Marker(arrowElement)
|
id:item.id,
|
||||||
.setLngLat([item.lng, item.lat])
|
element:childElement
|
||||||
.addTo(map);
|
}
|
||||||
|
pictureArrowElementArray.value?.push(childElementObj);
|
||||||
|
|
||||||
|
let arrowElementObj = {
|
||||||
|
id:item.id,
|
||||||
|
element:arrowElement
|
||||||
|
}
|
||||||
|
pictureParentArrowElementArray.value?.push(arrowElementObj);
|
||||||
|
|
||||||
|
let arrowMark = new mapboxgl.Marker(arrowElement).setLngLat([item.lng, item.lat]).addTo(map);
|
||||||
pictureArrowMarker.value?.push(arrowMark);
|
pictureArrowMarker.value?.push(arrowMark);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
currentPictureZIndex.value = list?.length;
|
currentPictureZIndex.value = list?.length;
|
||||||
|
|
||||||
// setTimeout(function(){
|
// setTimeout(function(){
|
||||||
// handlerCurrentImageChange(0);
|
// handlerCurrentImageChange(0);
|
||||||
// },10000)
|
// },10000)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handlerCurrentImageChange(fileName) {
|
function handlerCurrentImageChange(fileName) {
|
||||||
// 根据图片名检索标签
|
// 根据图片名检索标签
|
||||||
let currentIndex = null;
|
let currentIndex = null;
|
||||||
|
let currentId = null;
|
||||||
imageList.value?.forEach((item, index) => {
|
imageList.value?.forEach((item, index) => {
|
||||||
if (item.filePath?.match(fileName)) {
|
if (item.filePath?.match(fileName)) {
|
||||||
currentIndex = index;
|
currentIndex = index;
|
||||||
|
currentId = item.id;
|
||||||
currentPictureIndex.value = index;
|
currentPictureIndex.value = index;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
pictureArrowElementArray.value?.forEach((itme, index) => {
|
pictureArrowElementArray.value?.forEach((itme, index) => {
|
||||||
pictureArrowElementArray.value[index].style.backgroundImage = 'url(/map/arrow.png)';
|
pictureArrowElementArray.value[index]['element'].style.backgroundImage = 'url(/map/arrow.png)';
|
||||||
if(isShowPicture.value){
|
if(isShowPicture.value){
|
||||||
pictureArrowElementArray.value[index].style.display = 'block';
|
pictureArrowElementArray.value[index]['element'].style.display = 'block';
|
||||||
}else{
|
}else{
|
||||||
pictureArrowElementArray.value[index].style.display = 'none';
|
pictureArrowElementArray.value[index]['element'].style.display = 'none';
|
||||||
}
|
}
|
||||||
});
|
if(itme.id == currentId){
|
||||||
|
pictureArrowElementArray.value[index]['element'].style.backgroundImage = 'url(/map/arrow-a.png)';
|
||||||
pictureArrowElementArray.value[currentIndex].style.backgroundImage = 'url(/map/arrow-a.png)';
|
pictureArrowElementArray.value[index]['element'].style.display = 'block';
|
||||||
pictureArrowElementArray.value[currentIndex].style.display = 'block';
|
|
||||||
|
|
||||||
// 设置显示在最上层
|
// 设置显示在最上层
|
||||||
currentPictureZIndex.value = currentPictureZIndex.value + 1;
|
currentPictureZIndex.value = currentPictureZIndex.value + 1;
|
||||||
pictureParentArrowElementArray.value[currentIndex].style.zIndex = currentPictureZIndex.value;
|
pictureParentArrowElementArray.value[index]['element'].style.zIndex = currentPictureZIndex.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue