tsg-app/pages/skInfo/detail/myMap.vue

31 lines
967 B
Vue
Raw Normal View History

2024-11-22 17:44:00 +08:00
//MyVideo组件
//自行封装一个组件利用iframe实现
<template>
<iframe :onload="onloadCode" style="width:100%;height:100%;border:1px solid #fff;background: #000;"></iframe>
</template>
<script>
export default {
props: {
src: {}
},
data() {
return {
onloadCode: '',
lnglat: [114.76, 31.52],
markers: [{
latitude: 31.52,
longitude: 114.76,
iconPath: '../../../static/tabs/add.png',
width: 25,
height: 25
}]
}
},
created() {
this.onloadCode =
`this.contentWindow.document.body.innerHTML = '<map style="width: 100%;" id="container" latitude="${this.lnglat[1]}" longitude="${this.lnglat[0]}" markers="${this.markers}" ></map>';`
},
}
</script>
<style lang="scss">
</style>