提交
This commit is contained in:
82
example/加载BIM.html
Normal file
82
example/加载BIM.html
Normal file
@ -0,0 +1,82 @@
|
||||
<!--
|
||||
* @name:
|
||||
* @author: zh
|
||||
* @date: Do not edit
|
||||
* @update: Do not edit
|
||||
* @description:
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>加载BIM</title>
|
||||
<!-- <script src="https://cesium.com/downloads/cesiumjs/releases/1.96/Build/Cesium/Cesium.js"></script> -->
|
||||
<!-- <title>Title</title><script src="https://cesium.com/downloads/cesiumjs/releases/1.96/Build/Cesium/Cesium.js"></script> -->
|
||||
<!-- <script src="https://cesium.com/downloads/cesiumjs/releases/1.117/Build/Cesium/Cesium.js"></script> -->
|
||||
<script src="../sdk/YJEarth.min.js"></script>
|
||||
<script src="vue.js"></script>
|
||||
<style>
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.button {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
z-index: 9;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app" class="fullSize">
|
||||
<!-- <button class="button" @Click="pick">bim编辑</button> -->
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: {
|
||||
},
|
||||
async mounted() {
|
||||
await YJ.on({ host: "http://localhost:8888" })
|
||||
this.createEarth()
|
||||
await this.addTileset()
|
||||
},
|
||||
methods: {
|
||||
createEarth() {
|
||||
window.sdk = new YJ.YJEarth("app")
|
||||
this.sdk = window.sdk
|
||||
},
|
||||
async addTileset() {
|
||||
let Draw = await new YJ.Draw.DrawPoint(this.sdk)
|
||||
let openLeftClick = await new YJ.Global.openLeftClick(this.sdk)
|
||||
let openRightClick = await new YJ.Global.openRightClick(this.sdk)
|
||||
window.bin = new YJ.Obj.BIM(window.sdk, {
|
||||
show: true,
|
||||
name: 'xxx',
|
||||
id: '111111111111',
|
||||
url: "http://localhost:8891/yjearth4.0/data/bim/11e6ea0fe308d89620c095d0957339e8/tileset.json",
|
||||
// position: { lng: 100, lat: 30, alt: 5000 }
|
||||
},
|
||||
{
|
||||
confirmCallBack: (a)=>{
|
||||
console.log(a)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
await bin.on()
|
||||
// bin.picking = true
|
||||
bin.flyTo()
|
||||
bin.edit(true)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user