创建新仓库
This commit is contained in:
82
static/example/加载BIM.html
Normal file
82
static/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="../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: {
|
||||
sdk: null,
|
||||
tileset: null
|
||||
},
|
||||
async mounted() {
|
||||
await YJ.on({ host: "http://localhost:8894" })
|
||||
this.createEarth()
|
||||
await this.addTileset()
|
||||
},
|
||||
methods: {
|
||||
createEarth() {
|
||||
window.sdk = new YJ.YJEarth("app")
|
||||
this.sdk = window.sdk
|
||||
},
|
||||
pick() {
|
||||
this.tileset.picking = !this.tileset.picking
|
||||
},
|
||||
async addTileset() {
|
||||
let openLeftClick = await new YJ.Global.openLeftClick(this.sdk)
|
||||
let openRightClick = await new YJ.Global.openRightClick(this.sdk)
|
||||
let openMove = await new YJ.Global.openMove(this.sdk)
|
||||
|
||||
let tileset = new YJ.Obj.BIM(this.sdk, {
|
||||
show: true,
|
||||
url: "http://localhost:55110/data/bim/wQHsRPbnnfRX5K4ptmCGBYswPsME2zc5/tileset.json",
|
||||
position: {lng: 100, lat: 40, alt: 10}
|
||||
})
|
||||
|
||||
await tileset.on()
|
||||
tileset.picking = true
|
||||
tileset.onRightClick = (a,b,c)=>{
|
||||
tileset.edit(true)
|
||||
}
|
||||
tileset.flyTo()
|
||||
tileset.onClick = (movement,feature,cartesian) => {
|
||||
tileset.featureEdit(true, feature)
|
||||
}
|
||||
this.tileset = tileset
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user