# qe-set-locationbar
这个组件主要用于切换坐标栏的显示隐藏。
# 实例
隐藏代码
<template>
<div style="height: 450px;">
<div style="height: 8%;">
<button @click="show()" style="height: 30px;">显示</button>
<button @click="hide()" style="height: 30px;">隐藏</button>
<button @click="getLocationbar()" style="height: 30px;">获取信息</button>
</div>
<qe-viewer
style="height: 90%;"
:imagery-type="'TMap'"
:fullscreen-button="true"
:default-view="defaultView"
>
<qe-set-locationbar ref="smv" />
</qe-viewer>
</div>
</template>
<script>
import { QeViewer, QeSetLocationbar } from '@qycloud/vue-qearth';
import 'vue2qearth/vue2qearth.css'
export default {
components: {
QeViewer,
QeSetLocationbar
},
data () {
return {
defaultView: [
118.7863,
31.9087,
801.6425,
1.724684714172732,
-53.783141852231246,
0.008819224020548466
]
};
},
methods: {
hide() {
this.$refs.smv.setLocationbar(false)
},
show() {
this.$refs.smv.setLocationbar(true)
},
getLocationbar(){
console.log(this.$refs.smv.getLocationbar())
},
readyHandler(e) {
// e.removeDefaultLayers()
},
}
}
</script>