Files
4.0/static/example/加载tileset.html

59 lines
1.3 KiB
HTML
Raw Normal View History

2025-07-03 17:39:09 +08:00
<!--
* @name:
* @author: zh
* @date: Do not edit
* @update: Do not edit
* @description:
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>加载tileset</title>
<script src="../sdk/YJEarth.min.js"></script>
<script src="vue.js"></script>
<style>
body {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="app" class="fullSize">
</div>
</body>
</html>
<script>
new Vue({
el: "#app",
data: {
sdk: null,
},
async mounted() {
await YJ.on({host: "http://localhost:8894"})
this.createEarth()
await this.addTileset()
},
methods: {
createEarth() {
window.sdk = new YJ.YJEarth("app")
},
async addTileset() {
let tileset = new YJ.Obj.Tileset(window.sdk, {
show: true,
url: "https://lab.earthsdk.com/model/8c5299e0ce5f11eab7a4adf1d6568ff7/tileset.json"
})
await tileset.on()
tileset.flyTo()
tileset.edit(true)
// tileset.rotationEditingCallBack = (params)=>{
// console.log(params)
// }
}
}
})
</script>