56 lines
967 B
HTML
56 lines
967 B
HTML
<!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%;
|
|
margin: 0;
|
|
}
|
|
|
|
#app {
|
|
width: 100%;
|
|
height: 100vh;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app" class="fullSize">
|
|
<button class="button" @Click="importKml">导入kml</button>
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<script>
|
|
new Vue({
|
|
el: "#app",
|
|
data: {
|
|
PointObject: null,
|
|
PolylineObject: null
|
|
},
|
|
async mounted() {
|
|
await YJ.on()
|
|
this.createEarth()
|
|
},
|
|
methods: {
|
|
async createEarth() {
|
|
window.sdk = await new YJ.YJEarth("app")
|
|
},
|
|
|
|
importKml() {
|
|
this.PolylineObject = new YJ.Obj.KML(window.sdk, {
|
|
id: '235346546',
|
|
url: './kml/1748250107948.kml'
|
|
})
|
|
this.PolylineObject.on()
|
|
}
|
|
}
|
|
})
|
|
</script> |