使用的是超图的cesium
先上代码,代码里面都有注释
和超图官网的量算例子有一丢丢不一样,这里没有顶点捕捉(因为我不知道是啥玩意,所以去掉了);只有空间量算和贴地量算。剩下三种我也不知道是啥就不写。如有bug望各位大佬指正。
<template>
<div class="container">
<secen-view @already="already"></secen-view>
<div id="toolbar" class="tool-bar">
<div>
<Select
v-model="selOpt"
style="width: 200px"
@on-change="handlerOptionChange"
>
<Option
v-for="item in optionList"
:value="item.value"
:key="item.value"
>{
{ item.label }}</Option
>
</Select>
</div>
<div class="loaction">
<button id="flytoMountain" class="button" @click="flytoMountain">
定位至山区
</button>
</div>
<button
type="button"
id="distance"
class="button"
@click="handlerMeasure('distance')"
>
测距
</button>
<button
type="button"
id="area"
class="button"
@click="handlerMeasure('area')"
>
测面
</button>
<button
type="button"
id="height"
class="button"
@click="handlerMeasure('height')"
>
测高
</button>
<button type="button" id="clear" class="button" @click="handlerClear">
清除
</button>
<div class="isoheight">
<Checkbox v-model="isShowLine" @on-change="handlerIoslineChange"
>等高线</Checkbox
>
</div>
</div>
</div>
</template>
<script>
export default {
name: "Measure",
data() {
return {
viewer: "",
optionList: [
{
value: "空间量算",
label: "空间量算",
},
{