This commit is contained in:
Teo
2025-09-16 16:38:55 +08:00
parent 9d7a53c0c3
commit d8702ab4af
3 changed files with 11 additions and 11 deletions

View File

@ -15,9 +15,9 @@ const videoDialogRef = ref(null);
const token = getToken();
const urlParams = new URLSearchParams(new URL(window.location.href).search);
const projectIdTwo = urlParams.get('projectId');
let ws = new ReconnectingWebSocket(
import.meta.env.VITE_APP_BASE_WS_API + '?Authorization=' + token + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID + '&projectId=' + projectIdTwo
);
// let ws = new ReconnectingWebSocket(
// import.meta.env.VITE_APP_BASE_WS_API + '?Authorization=' + token + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID + '&projectId=' + projectIdTwo
// );
// 连接ws
const connectWs = () => {
ws.onopen = (e) => {
@ -139,7 +139,7 @@ function entityClickHandler(entity, item) {
}
// 初始化地球
async function initEarth() {
let earth = new YJ.YJEarth('earth');
let earth = new YJ.YJEarth('earthqqqq');
window.Earth1 = earth;
// 加载底图
@ -166,7 +166,7 @@ async function initEarth() {
window.roamingController = roamingController;
}
async function loadTiltData(item) {
let tileset = new YJ.Obj.Tileset(window.Earth1, { id: item.source_id });
let tileset = new YJ.Obj.Tileset(window.Earth1, { id: item.source_id, host: import.meta.env.VITE_APP_BASE_EARTH_API });
ModelList.set(item.source_id, tileset);
await tileset.on();
tileset.flyTo();
@ -259,7 +259,7 @@ function stopRoaming() {
onMounted(async () => {
// 连接ws
connectWs();
// connectWs();
// 获取选中节点
getCheckedNode();
// 获取GPS数据
@ -268,7 +268,7 @@ onMounted(async () => {
await YJ.on({
username: 'admin',
password: md5('admin_admin123'),
host: 'http://192.168.110.2:8895/'
host: 'http://xny.yj-3d.com:8895'
}).then((res) => {
initEarth();
modelList.value.forEach((item) => {
@ -287,7 +287,7 @@ onUnmounted(() => {
</script>
<template>
<div class="earth-container-big">
<div class="earth" id="earth"></div>
<div class="earth" id="earthqqqq"></div>
<!-- <div v-show="isHide" class="left">
<div style="width: 100%;height: 100%;">
<el-button type="primary" @click="startRoaming">开始漫游</el-button>