地图添加 homeButton,单击时返回地图初始状态。
This commit is contained in:
parent
da9ce1566f
commit
a5240d66c9
|
|
@ -11,7 +11,8 @@
|
|||
<div class="left1">
|
||||
<div class="xiala">
|
||||
<el-select v-model="searchTypeValue" placeholder="">
|
||||
<el-option v-for="(item, index) in searchType" :key="index" :label="item.label" :value="item.label" :disabled="item.disabled" />
|
||||
<el-option v-for="(item, index) in searchType" :key="index" :label="item.label" :value="item.label"
|
||||
:disabled="item.disabled" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-input v-model="searchValue" placeholder="" />
|
||||
|
|
@ -27,25 +28,29 @@
|
|||
<div class="left4" v-if="searchTypeValue == '航次名称' && menuList1.length">
|
||||
<div class="list">
|
||||
<div class="list-title">请选择航次名称</div>
|
||||
<div class="list-value" v-for="(item,index) in menuList1" :key="index" @click="selectMenu1(item)">{{ item.name }}</div>
|
||||
<div class="list-value" v-for="(item, index) in menuList1" :key="index" @click="selectMenu1(item)">{{
|
||||
item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left4" v-if="searchTypeValue == '平台类型' && menuList2.length">
|
||||
<div class="list">
|
||||
<div class="list-title">请选择平台类型</div>
|
||||
<div class="list-value" v-for="(item,index) in menuList2" :key="index" @click="selectMenu2(item)">{{ item.name + '(' + item.value + ')' }}</div>
|
||||
<div class="list-value" v-for="(item, index) in menuList2" :key="index" @click="selectMenu2(item)">{{
|
||||
item.name + '(' + item.value + ')' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left4" v-if="searchTypeValue == '设备类型' && menuList3.length">
|
||||
<div class="list">
|
||||
<div class="list-title">请选择设备类型</div>
|
||||
<div class="list-value" v-for="(item,index) in menuList3" :key="index" @click="selectMenu3(item)">{{ item.name + '(' + item.value + ')' }}</div>
|
||||
<div class="list-value" v-for="(item, index) in menuList3" :key="index" @click="selectMenu3(item)">{{
|
||||
item.name + '(' + item.value + ')' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left4" v-if="searchTypeValue == '数据样品类型' && menuList4.length">
|
||||
<div class="list">
|
||||
<div class="list-title">请选择数据样品类型</div>
|
||||
<div class="list-value" v-for="(item,index) in menuList4" :key="index" @click="selectMenu4(item)">{{ item.name + '(' + item.value + ')' }}</div>
|
||||
<div class="list-value" v-for="(item, index) in menuList4" :key="index" @click="selectMenu4(item)">{{
|
||||
item.name + '(' + item.value + ')' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left4" v-if="radio == '数据样品集'">
|
||||
|
|
@ -449,7 +454,7 @@ export default {
|
|||
baseLayerPicker: false,
|
||||
fullscreenButton: false,
|
||||
selectionIndicator: false,
|
||||
homeButton: false,
|
||||
homeButton: true,
|
||||
animation: false,
|
||||
infoBox: false,
|
||||
geocoder: false,
|
||||
|
|
@ -468,10 +473,20 @@ export default {
|
|||
this.viewer.scene.globe.showGroundAtmosphere = false
|
||||
this.viewer.scene.postProcessStages.fxaa.enabled = true
|
||||
|
||||
this.viewer.camera.setView({
|
||||
// 单击 homeButton 返回初始位置
|
||||
this.viewer.homeButton.viewModel.command.beforeExecute.addEventListener((e) => {
|
||||
e.cancel = true;
|
||||
this.viewer.camera.flyTo({
|
||||
// 指定相机初始位置
|
||||
destination: Cesium.Cartesian3.fromDegrees(110, 18, 10000000)
|
||||
destination: Cesium.Cartesian3.fromDegrees(112, 18, 4000000),
|
||||
duration: 0.5
|
||||
});
|
||||
});
|
||||
|
||||
this.viewer.camera.setView({
|
||||
// 指定相机初始位置
|
||||
destination: Cesium.Cartesian3.fromDegrees(112, 18, 4000000)
|
||||
});
|
||||
|
||||
// 不显示底图
|
||||
this.viewer.imageryLayers.get(0).show = false
|
||||
|
|
@ -857,7 +872,7 @@ export default {
|
|||
.tag {
|
||||
color: #333333;
|
||||
padding: 5px;
|
||||
background-color: rgb(249,249,249);
|
||||
background-color: rgb(249, 249, 249);
|
||||
margin: 0 15px 15px 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ export default {
|
|||
baseLayerPicker: false,
|
||||
fullscreenButton: false,
|
||||
selectionIndicator: false,
|
||||
homeButton: false,
|
||||
homeButton: true,
|
||||
animation: false,
|
||||
infoBox: false,
|
||||
geocoder: false,
|
||||
|
|
@ -372,10 +372,20 @@ export default {
|
|||
this.viewer.scene.globe.showGroundAtmosphere = false
|
||||
this.viewer.scene.postProcessStages.fxaa.enabled = true
|
||||
|
||||
this.viewer.camera.setView({
|
||||
// 单击 homeButton 返回初始位置
|
||||
this.viewer.homeButton.viewModel.command.beforeExecute.addEventListener((e) => {
|
||||
e.cancel = true;
|
||||
this.viewer.camera.flyTo({
|
||||
// 指定相机初始位置
|
||||
destination: Cesium.Cartesian3.fromDegrees(110, 18, 10000000)
|
||||
destination: Cesium.Cartesian3.fromDegrees(112, 18, 4000000),
|
||||
duration: 0.5
|
||||
});
|
||||
});
|
||||
|
||||
this.viewer.camera.setView({
|
||||
// 指定相机初始位置
|
||||
destination: Cesium.Cartesian3.fromDegrees(112, 18, 4000000)
|
||||
});
|
||||
|
||||
// 改写 Cesium 原生鼠标滚轮事件,地图缩放改为按下 Ctrl + 鼠标滚轮
|
||||
modifyCesiumMouseWheel(this.viewer);
|
||||
|
|
|
|||
Loading…
Reference in New Issue