创建新仓库
This commit is contained in:
55
static/example/添加折线.html
Normal file
55
static/example/添加折线.html
Normal file
@ -0,0 +1,55 @@
|
||||
<!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">
|
||||
<button class="button" @Click="ExportKml">导出kml</button>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: {
|
||||
sdk: null,
|
||||
PolylineObject: null
|
||||
},
|
||||
async mounted() {
|
||||
await YJ.on()
|
||||
this.createEarth()
|
||||
},
|
||||
methods: {
|
||||
createEarth() {
|
||||
this.sdk = new YJ.YJEarth("app")
|
||||
let Draw = new YJ.Draw.DrawPolyline(this.sdk)
|
||||
Draw.start((a, positions) => {
|
||||
let PolylineObject = new YJ.Obj.PolylineObject(this.sdk, { type: 1, positions: positions })
|
||||
PolylineObject.edit(true)
|
||||
this.PolylineObject = PolylineObject
|
||||
// YJ.Obj.RichText.open('8')
|
||||
// PolylineObject.flyTo()
|
||||
})
|
||||
// this.PolylineObject.edit(true)
|
||||
},
|
||||
|
||||
ExportKml() {
|
||||
YJ.Global.ExportKml([this.PolylineObject])
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user