# qe-switch-online-map-type

这个组件主要用于切换在线地图的类型。


# 实例

隐藏代码
<template>

  <div style="height: 450px;">
    <div  style="height: 8%;">
      <button @click="switchOnlineMapType('satellite')" style="height: 30px;">satellite</button>
      <button @click="switchOnlineMapType('normal')" style="height: 30px;">normal</button>
      <button @click="switchOnlineMapType()" style="height: 30px;">循环</button>
    </div>
    <qe-viewer
      style="height: 90%;"
      :imagery-type="'TMap'"
      :fullscreen-button="true"
      :default-view="defaultView"
    >
      <qe-switch-online-map-type ref="somt" />
    </qe-viewer>
  </div>
</template>

<script>
import { QeViewer, QeSwitchOnlineMapType } from '@qycloud/vue-qearth';
import 'vue2qearth/vue2qearth.css'

export default {
  components: {
    QeViewer, 
    QeSwitchOnlineMapType
  },
  data () {
    return {
      defaultView: [
        118.7863,
        31.9087,
        801.6425,
        1.724684714172732,
        -53.783141852231246,
        0.008819224020548466
      ]
    };
  },
  methods: {
    switchOnlineMapType(type) {
      this.$refs.somt.switchOnlineMapType(type || null)
      console.log(this.$refs.somt.onlineMapType)
    }
  }
}
</script>
最后更新时间: 10/24/2023, 2:21:12 PM