import Vue from 'vue' import App from './App.vue' import ElementUI from 'element-ui' import echarts from 'echarts' // import 'element-ui/lib/theme-chalk/index.css' import '../static/css/index.css' import '../static/css/fonts.css' import Enlocale from '../node_modules/element-ui/lib/locale/lang/en' import Zhlocale from '../node_modules/element-ui/lib/locale/lang/zh-CN' import router from './router/index.js' import 'echarts-gl' 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 }) Vue.prototype.$axios = axios Vue.prototype.$qs = qs Vue.prototype.$echarts = echarts Vue.config.productionTip = false new Vue({ el: '#app', router, store, components: { App }, template: '' }) // 定义部分全局变量 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"]; 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); }); } window.mapboxgl.accessToken = 'pk.eyJ1IjoicWRod2kiLCJhIjoiY2xiaXppcjEyMGNhMjNwbzVrcHl4d20zOSJ9.0ETMJM3-zllFh2GRrRVUZg' Vue.config.tiles = { "world_horizon_1": `${Vue.config.baseUrl}/geoserver/gwc/service/wmts/rest/ougp:world_horizon_1/EPSG:900913/EPSG:900913:{z}/{y}/{x}?format=image/jpeg`, "World_Imagery": "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", "GEBCO_basemap_NCEI": "https://tiles.arcgis.com/tiles/C8EMgrsFcRFL6LrL/arcgis/rest/services/GEBCO_basemap_NCEI/MapServer/tile/{z}/{y}/{x}", "gaode":"https://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&scl=2&style=8&x={x}&y={y}&z={z}" };