轨迹功能
parent
d58bdc4e48
commit
753d06948c
|
@ -3,22 +3,22 @@
|
||||||
<div id="container" />
|
<div id="container" />
|
||||||
<div class="input-card">
|
<div class="input-card">
|
||||||
<h4>轨迹回放控制</h4>
|
<h4>轨迹回放控制</h4>
|
||||||
<div class="input-item">
|
<!-- <div class="input-item">-->
|
||||||
<input id="start" type="button" class="btn" value="开始动画" @click="startAnimation()">
|
<!-- <input id="start" type="button" class="btn" value="开始动画" @click="startAnimation()">-->
|
||||||
<input id="pause" type="button" class="btn" value="暂停动画" @click="pauseAnimation()">
|
<!-- <input id="pause" type="button" class="btn" value="暂停动画" @click="pauseAnimation()">-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="input-item">
|
<!-- <div class="input-item">-->
|
||||||
<input id="resume" type="button" class="btn" value="继续动画" @click="resumeAnimation()">
|
<!-- <input id="resume" type="button" class="btn" value="继续动画" @click="resumeAnimation()">-->
|
||||||
<input id="stop" type="button" class="btn" value="停止动画" @click="stopAnimation()">
|
<!-- <input id="stop" type="button" class="btn" value="停止动画" @click="stopAnimation()">-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<!-- <div class="input-item">-->
|
<!-- <div class="input-item">-->
|
||||||
<!-- <el-button type="primary" round plain id="start" @click="startAnimation">开始动画</el-button>-->
|
<!-- <el-button type="primary" round plain id="start" @click="startAnimation">开始动画</el-button>-->
|
||||||
<!-- <el-button type="primary" round plain id="pause" @click="pauseAnimation">暂停动画</el-button>-->
|
<!-- <el-button type="primary" round plain id="pause" @click="pauseAnimation">暂停动画</el-button>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- <div class="input-item">-->
|
<!-- <div class="input-item">-->
|
||||||
<!-- <el-button type="primary" round plain id="resume" @click="resumeAnimation">继续动画</el-button>-->
|
<!-- <el-button type="primary" round plain id="resume" @click="resumeAnimation">继续动画</el-button>-->
|
||||||
<!-- <el-button type="primary" round plain id="stop" @click="send">实时轨迹</el-button>-->
|
<!-- <el-button type="primary" round plain id="stop" @click="send">实时轨迹</el-button>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -45,16 +45,15 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.socket = new WebSocket('ws://10.100.1.8:9802/websocket/12345')
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.socket = new WebSocket('ws://localhost:9804/websocket/vin123123123')
|
||||||
|
setTimeout(() => {
|
||||||
|
this.initAMap()
|
||||||
|
}, 500)
|
||||||
this.socket.onopen = this.handleOpen
|
this.socket.onopen = this.handleOpen
|
||||||
this.socket.onmessage = this.handleMessage
|
this.socket.onmessage = this.handleMessage
|
||||||
this.socket.onerror = this.handleError
|
this.socket.onerror = this.handleError
|
||||||
setTimeout(() => {
|
|
||||||
this.send()
|
|
||||||
this.initAMap()
|
|
||||||
}, 500)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
send() {
|
send() {
|
||||||
|
@ -114,7 +113,7 @@ export default {
|
||||||
this.marker.setPosition(this.arr)
|
this.marker.setPosition(this.arr)
|
||||||
this.marker.on('moving', (e) => {
|
this.marker.on('moving', (e) => {
|
||||||
this.passedPolyline.setPath(e.passedPath)
|
this.passedPolyline.setPath(e.passedPath)
|
||||||
this.map.setCenter(e.target.getPosition(), true)
|
this.$AMap.setCenter(e.target.getPosition(), true)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.marker.moveAlong(this.lineArr,
|
this.marker.moveAlong(this.lineArr,
|
||||||
|
|
Loading…
Reference in New Issue