# qe-draw-shape

这个组件主要用于三维动态绘制元素。


# 实例

隐藏代码
<template>

  <div style="height: 450px;">
    <div  style="height: 8%;">
      <button @click="draw('rectangle')" style="height: 30px;">矩形</button>
      <button @click="draw('circle')" style="height: 30px;">圆形</button>
      <button @click="draw('InscribedEllipse')" style="height: 30px;">椭圆</button>
      <button @click="draw('polygon')" style="height: 30px;">多边形</button>
      <button @click="clear()" style="height: 30px;">清除</button>
    </div>
    <qe-viewer
      style="height: 90%;"
      :imagery-type="'TMap'"
      :fullscreen-button="true"
      :default-view="defaultView"
    >
      <qe-draw-shape ref="dr" />
    </qe-viewer>
  </div>
</template>

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

export default {
  components: {
    QeViewer, 
    QeDrawShape
  },
  data () {
    return {
      defaultView: [
        118.7863,
        31.9087,
        801.6425,
        1.724684714172732,
        -53.783141852231246,
        0.008819224020548466
      ]
    };
  },
  methods: {
    draw(type) {
      this.$refs.dr.drawShapes(type)
    },
    clear() {
      this.$refs.dr.clear()
    }
  }
}
</script>
最后更新时间: 10/24/2023, 2:21:12 PM