提交
This commit is contained in:
56
example/导入kml.html
Normal file
56
example/导入kml.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!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>
|
Reference in New Issue
Block a user