提交
This commit is contained in:
71
example/添加椭圆.html
Normal file
71
example/添加椭圆.html
Normal file
@ -0,0 +1,71 @@
|
||||
<!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 = new YJ.YJEarth("app")
|
||||
window.sdk = this.sdk
|
||||
YJ.Global.flyTo(this.sdk, {
|
||||
position: {
|
||||
lng: 110,
|
||||
lat: 25,
|
||||
alt: 100
|
||||
}
|
||||
})
|
||||
let layer = new YJ.Obj.ArcgisWXImagery(this.sdk, {
|
||||
id: 123,
|
||||
show: true,
|
||||
layer_index: 1
|
||||
})
|
||||
|
||||
|
||||
let Draw = new YJ.Draw.DrawElliptic(sdk)
|
||||
|
||||
Draw.start((a, options) => {
|
||||
options.center.alt = options.center.alt
|
||||
console.log('options', options)
|
||||
let EllipseObject = new YJ.Obj.EllipseObject(sdk, {
|
||||
center: options.center, //中心坐标
|
||||
bearing: options.bearing, //旋转角度
|
||||
semiMinorAxis: options.semiMinorAxis, // 短轴长度
|
||||
semiMajorAxis: options.semiMajorAxis, // 长轴长度
|
||||
heightMode: 2, // 高度模式 0:海拔高度;1:相对地表;2:依附模式
|
||||
})
|
||||
EllipseObject.edit(true)
|
||||
window.EllipseObject = EllipseObject
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user