From 7978bd3a61789a482c0ecb9a228e62cf5824b5c7 Mon Sep 17 00:00:00 2001 From: hym Date: Thu, 25 Dec 2025 16:45:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=9B=BE=E5=B1=82=E8=BE=B9?= =?UTF-8?q?=E7=95=8C=EF=BC=8C=E7=94=A8=E4=BA=8E=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=9B=BE=E5=B1=82=E6=97=B6=E6=8C=87=E5=AE=9A=E8=BE=B9=E7=95=8C?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E8=BF=87=E5=A4=9A=E6=97=A0=E6=95=88?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 69b32de..f0a23ef 100644 --- a/src/main.js +++ b/src/main.js @@ -15,6 +15,7 @@ import axios from 'axios' import qs from 'qs' import store from './store/index' +import { extractWMTSBoundsInfo } from '@/utils/mapbox-utils' window.sessionStorage.setItem('webInfo', 'ASOS') Vue.use(ElementUI, { locale: Zhlocale }) @@ -34,6 +35,17 @@ new Vue({ // 定义部分全局变量 Vue.config.maps = {}; +Vue.config.firstRender = true; +Vue.config.boundsInfoList = []; Vue.config.baseUrl = process.env.NODE_ENV === 'development' ? 'http://124.222.8.13:9801' : `${window.location.protocol}//${window.location.hostname}:${window.location.port}` Vue.config.wwwrootBaseUrl = "_content/IDSSE.OceanExplorer.Shared"; -Vue.config.sprites = ["go.png", "ship.png", "ship1.png", "ship2.png", "ship3.png", "fdz.png", "shys.png", "auv.png", "aircraft.png", "aircraft-r.png", "arrow.png", "dot.png", "dot_red.png", "default.png", "info-dark.png", "warning-dark.png", "warning-red.png", "slow_sog.png", "stop_sog.png", "海底主基站.png", "石油平台.png", "岸基站.png", "circle-red.png", "circle-green.png", "circle-blue.png", "circle-yellow.png", "circle-purple.png", "circle-black.png", "circle-white.png"]; \ No newline at end of file +Vue.config.sprites = ["go.png", "ship.png", "ship1.png", "ship2.png", "ship3.png", "fdz.png", "shys.png", "auv.png", "aircraft.png", "aircraft-r.png", "arrow.png", "dot.png", "dot_red.png", "default.png", "info-dark.png", "warning-dark.png", "warning-red.png", "slow_sog.png", "stop_sog.png", "海底主基站.png", "石油平台.png", "岸基站.png", "circle-red.png", "circle-green.png", "circle-blue.png", "circle-yellow.png", "circle-purple.png", "circle-black.png", "circle-white.png"]; + +if (Vue.config.firstRender) { + Vue.config.firstRender = !Vue.config.firstRender; + fetch(`${Vue.config.baseUrl}/geoserver/gwc/service/wmts?service=WMTS&acceptVersions=1.0.0&request=GetCapabilities`) + .then(response => response.text()) + .then(async (xmlContent) => { + Vue.config.boundsInfoList = await extractWMTSBoundsInfo(xmlContent); + }); +} \ No newline at end of file