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

31 lines
967 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

//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>