更新地图组件
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" href="./fonts/iconfont.css" />
|
||||
<script>
|
||||
window.$config = {
|
||||
api: "./api.vgomap.com/",
|
||||
api: "/api.vgomap.com/",
|
||||
offline: true,
|
||||
mapTheme: "home",
|
||||
tenantId: "1958120048849719296",
|
||||
|
BIN
public/api.vgomap.com/MapData/1977947221534052352.zip
Normal file
BIN
public/api.vgomap.com/MapData/1977947221534052352.zip
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -7,7 +7,7 @@ const map = inject("map")
|
||||
|
||||
const {
|
||||
pathIdList,
|
||||
addPathId,
|
||||
addPath,
|
||||
startNavi,
|
||||
pauseNavi,
|
||||
restoreNavi,
|
||||
@@ -18,11 +18,11 @@ map.value.on('click', (e) => {
|
||||
const polygon = e.object?.userData?.polygonData // 获取点位数据
|
||||
if(!polygon?.isNavi) return
|
||||
|
||||
addPathId(polygon.id)
|
||||
addPath(polygon)
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
addPathId,
|
||||
addPath,
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@@ -53,8 +53,8 @@ const markerStatus = ref({});
|
||||
const checkedStatus = ref({})
|
||||
watch(checkedStatus, (checked) => {
|
||||
for (let key in checked) {
|
||||
markerStatus.value[key].forEach((marker) => {
|
||||
marker.visible = checked[key]
|
||||
markerStatus.value?.[key]?.forEach((marker) => {
|
||||
marker.visible = !checked[key]
|
||||
})
|
||||
}
|
||||
}, {
|
||||
@@ -67,7 +67,8 @@ function createDivMarker(content, polygon) {
|
||||
contentNode.className = "marker"
|
||||
contentNode.textContent = content
|
||||
contentNode.onclick = (e) => {
|
||||
routeLineRef.value.addPathId(polygon.id)
|
||||
if(!polygon?.isNavi) return
|
||||
routeLineRef.value.addPath(polygon)
|
||||
}
|
||||
|
||||
wrapper.appendChild(contentNode)
|
||||
|
@@ -3,8 +3,19 @@ import { ref, watch } from "vue"
|
||||
export function useNavi(map) {
|
||||
const pathIdList = ref([])
|
||||
|
||||
function addPath(polygon) {
|
||||
if(polygon?.id && pathIdList.value[pathIdList.value.length - 1] === polygon?.id) return // 不连续添加相同的项
|
||||
|
||||
const modelId = polygon.extrasModelId;
|
||||
const model = map.value.getModelById(modelId)
|
||||
const modelName = model.userData.modelData.name
|
||||
console.log(modelName, 'model.name')
|
||||
|
||||
addPathId(polygon.id)
|
||||
}
|
||||
|
||||
function addPathId(id) {
|
||||
if(pathIdList.value[pathIdList.value.length - 1] === id) return
|
||||
if(id && pathIdList.value[pathIdList.value.length - 1] === id) return
|
||||
|
||||
pathIdList.value.push(id)
|
||||
}
|
||||
@@ -70,6 +81,7 @@ export function useNavi(map) {
|
||||
|
||||
return {
|
||||
pathIdList,
|
||||
addPath,
|
||||
addPathId,
|
||||
startNavi,
|
||||
pauseNavi,
|
||||
|
@@ -290,6 +290,10 @@ onMounted(() => {
|
||||
backdrop-filter: blur(5px);
|
||||
}
|
||||
|
||||
:deep(.el-table tr){
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__header th) {
|
||||
background: rgba(12, 43, 77, 0.7) !important;
|
||||
border-bottom: 1px solid #68c9ff !important;
|
||||
|
@@ -41,12 +41,13 @@
|
||||
</div>
|
||||
|
||||
<!-- 地图展示区域 -->
|
||||
<!--建立 一个全局变量用于存放用户点击的设备名称列表,同步到编辑框的点位设备列表中-->
|
||||
<div class="mb-6">
|
||||
<h3 class="text-lg font-medium text-blue-300 mb-4">路径地图</h3>
|
||||
<div class="border border-blue-400 rounded-lg overflow-hidden relative">
|
||||
<!-- 地图容器,设置固定高度 -->
|
||||
<div class="path-map-container">
|
||||
<Map />
|
||||
<Map el-id="etsfs"/>
|
||||
</div>
|
||||
<!-- 地图操作提示 -->
|
||||
<div class="map-tip">
|
||||
|
Reference in New Issue
Block a user