显示加载本地文件
parent
ef9328dc59
commit
35c016bd06
|
@ -1,31 +1,34 @@
|
|||
import { app, BrowserWindow } from 'electron'
|
||||
import { join } from "path"
|
||||
|
||||
const URL = (process.env.NODE_ENV === 'development') ? 'http://localhost:3000/' : 'http://gnss.cesium.hwasmart.com/'
|
||||
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
fullscreen: true,
|
||||
frame: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
preload: join(__dirname, 'preload.js')
|
||||
}
|
||||
})
|
||||
const win = new BrowserWindow({
|
||||
fullscreen: true,
|
||||
frame: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
preload: join(__dirname, 'preload.js')
|
||||
}
|
||||
})
|
||||
|
||||
win.loadURL(URL)
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
win.loadURL('http://localhost:3000/')
|
||||
win.webContents.openDevTools()
|
||||
} else {
|
||||
win.loadFile('dist/render/index.html')
|
||||
}
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
|
|
@ -25,10 +25,10 @@ export default defineComponent({
|
|||
const token = '436ce7e50d27eede2f2929307e6b33c0'
|
||||
|
||||
const czml = ref('')
|
||||
const loadSatelliteOrbit = ss => czml.value = '/CZML/' + ss + '.czml'
|
||||
const loadSatelliteOrbit = ss => czml.value = './CZML/' + ss + '.czml'
|
||||
|
||||
const onViewerReady = ({ viewer }) => {
|
||||
viewer.scene.debugShowFramesPerSecond = true
|
||||
viewer.scene.debugShowFramesPerSecond = false
|
||||
// 移除默认的图层,提升加载速度
|
||||
const { imageryLayers } = viewer
|
||||
imageryLayers.remove(imageryLayers.get(0))
|
||||
|
|
|
@ -12,7 +12,7 @@ export default defineComponent({
|
|||
const show_flag = (flag_name) => {
|
||||
if (!flag_name) return
|
||||
|
||||
src.value = '/image/flag/' + flag_name + '.png'
|
||||
src.value = './image/flag/' + flag_name + '.png'
|
||||
}
|
||||
|
||||
let exit_timeout = null
|
||||
|
|
Loading…
Reference in New Issue