1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- html,
- body {
- width: 100%;
- height: 100%;
- margin: 0;
- overflow: hidden;
- }
- .scene {
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="scene" class="scene"></div>
- <div class="map"></div>
- <script>
- const params = new URLSearchParams(location.search)
- const env = params.get('env')
- let host = 'http://192.168.0.25'
- if (env === 'prod') {
- host = ''
- }
- const $script1 = document.createElement('script')
- $script1.src = `${host}/sdk/kankan-sdk-deps.js`
- document.documentElement.appendChild($script1)
- const $script2 = document.createElement('script')
- $script2.src = `${host}/sdk/kankan-sdk.js`
- document.documentElement.appendChild($script2)
- let loadPackCount = 0
- $script1.onload = () => {
- ++loadPackCount
- init()
- }
- $script2.onload = () => {
- ++loadPackCount
- init()
- }
- const init = async () => {
- if (loadPackCount < 2) return;
- await setTimeout(() => {}, 1000)
- var kankan = new KanKan({
- dom: '#scene',
- num: params.get('m'),
- server: host,
- resource: host + '/oss/'
- })
- // kankan.Scene.on('loaded', () => {
- // const player = kankan.core.get('Player')
- // player.viewLinkManager.addEventListener('loaded', () => {
- // player.viewLinkManager.hideAllViews()
- // })
- // })
- kankan.render()
- }
- </script>
- <script>
- </script>
- </body>
- </html>
|