Files
sdk4_demo/example/添加圆弧.html

71 lines
1.6 KiB
HTML
Raw Normal View History

2025-07-03 15:12:58 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</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: {
PolylineObject: null,
PolygonObject: null
},
async mounted() {
await YJ.on()
this.createEarth()
},
methods: {
async createEarth() {
this.sdk = await new YJ.YJEarth("app")
window.sdk = this.sdk
let openLeftClick = await new YJ.Global.openLeftClick(this.sdk)
let openRightClick = await new YJ.Global.openRightClick(this.sdk)
YJ.Global.MouseRightMenu(sdk, true, (text, object) => {
console.log(text, object)
switch (text) {
case '绕中心点旋转':
YJ.Global.rotateAround(sdk, object.position)
break
case '属性':
break
}
})
let Draw = new YJ.Draw.DrawSector(this.sdk)
Draw.start((a, options) => {
window.SectorObject = new YJ.Obj.SectorObject(this.sdk, {
center: options.center, //中心坐标
radius: options.radius, //半径
startAngle: options.startAngle, //起始角度
endAngle: options.endAngle, //结束角度
})
SectorObject.edit(true)
SectorObject.onClick = (a,b,c)=>{
console.log(a,b,c)
}
})
}
}
})
</script>