diff --git a/src/components/earth/Earth.js b/src/components/earth/Earth.js index d86ca24..327b75c 100644 --- a/src/components/earth/Earth.js +++ b/src/components/earth/Earth.js @@ -16,7 +16,7 @@ class Earth { const viewer = new Cesium.Viewer(elementId, { ...configs, infoBox: false, // 关闭信息展示 - navigation: false, // 指南针 + navigation: true, // 指南针 animation: false, // 原生左下角动画空间 timeline: true, // 时间线 // 右上角按钮 diff --git a/src/components/earth/layerManager/layerManager.js b/src/components/earth/layerManager/layerManager.js index da9ef6d..7166ab2 100644 --- a/src/components/earth/layerManager/layerManager.js +++ b/src/components/earth/layerManager/layerManager.js @@ -55,6 +55,7 @@ class LayerManager { }, props: point }) + return entity }) } diff --git a/src/components/mapUI/baseMapManager/baseMapManager.vue b/src/components/mapUI/baseMapManager/baseMapManager.vue index 0510cc1..0c46544 100644 --- a/src/components/mapUI/baseMapManager/baseMapManager.vue +++ b/src/components/mapUI/baseMapManager/baseMapManager.vue @@ -121,5 +121,8 @@ watch(() => checked.value, newV => { width: 30px; } } + :deep(.n-checkbox__label){ + color: white; + } diff --git a/src/components/mapUI/mapTools/img/birdEye.png b/src/components/mapUI/mapTools/img/birdEye.png new file mode 100644 index 0000000..ee36445 Binary files /dev/null and b/src/components/mapUI/mapTools/img/birdEye.png differ diff --git a/src/components/mapUI/mapTools/img/export.png b/src/components/mapUI/mapTools/img/export.png new file mode 100644 index 0000000..c702d34 Binary files /dev/null and b/src/components/mapUI/mapTools/img/export.png differ diff --git a/src/components/mapUI/mapTools/img/fullScreen.png b/src/components/mapUI/mapTools/img/fullScreen.png new file mode 100644 index 0000000..6c92fc4 Binary files /dev/null and b/src/components/mapUI/mapTools/img/fullScreen.png differ diff --git a/src/components/mapUI/mapTools/img/left.png b/src/components/mapUI/mapTools/img/left.png new file mode 100644 index 0000000..db04957 Binary files /dev/null and b/src/components/mapUI/mapTools/img/left.png differ diff --git a/src/components/mapUI/mapTools/img/right.png b/src/components/mapUI/mapTools/img/right.png new file mode 100644 index 0000000..3198d14 Binary files /dev/null and b/src/components/mapUI/mapTools/img/right.png differ diff --git a/src/components/mapUI/mapTools/img/zoomIn.png b/src/components/mapUI/mapTools/img/zoomIn.png new file mode 100644 index 0000000..8b50439 Binary files /dev/null and b/src/components/mapUI/mapTools/img/zoomIn.png differ diff --git a/src/components/mapUI/mapTools/img/zoomOut.png b/src/components/mapUI/mapTools/img/zoomOut.png new file mode 100644 index 0000000..1f2b073 Binary files /dev/null and b/src/components/mapUI/mapTools/img/zoomOut.png differ diff --git a/src/components/mapUI/mapTools/mapTools.vue b/src/components/mapUI/mapTools/mapTools.vue index 3610cb5..89627df 100644 --- a/src/components/mapUI/mapTools/mapTools.vue +++ b/src/components/mapUI/mapTools/mapTools.vue @@ -1,6 +1,8 @@ @@ -16,12 +18,90 @@ import { ref, reactive, toRefs, watch, onMounted, getCurrentInstance } from 'vue // }, // }) // const { } = toRefs(props); +const toolsList = reactive([ + { + title: '放大', + func: zoomIn, + icon: new URL('./img/zoomIn.png', import.meta.url) + }, + { + title: '缩小', + func: zoomOut, + icon: new URL('./img/zoomOut.png', import.meta.url) + }, + { + title: '向左旋转', + func: left, + icon: new URL('./img/left.png', import.meta.url) + }, + { + title: '向右旋转', + func: right, + icon: new URL('./img/right.png', import.meta.url) + }, + { + title: '全屏', + func: fullScreen, + icon: new URL('./img/fullScreen.png', import.meta.url) + }, + { + title: '鸟瞰', + func: birdEye, + icon: new URL('./img/birdEye.png', import.meta.url) + }, + { + title: '导出', + func: exportMap, + icon: new URL('./img/export.png', import.meta.url) + } +]) +function zoomIn() { + // viewer.camera.height -= 100 + const position = viewer.camera.positionCartographic + viewer.camera.moveForward(position.height * 0.5) +} + +function zoomOut() { + const position = viewer.camera.positionCartographic + viewer.camera.moveBackward(position.height * 0.5) +} +function left() { + viewer.camera.twistLeft(Cesium.Math.toDegrees(0.005).toFixed(2)) +} +function right() { + viewer.camera.twistRight(Cesium.Math.toDegrees(0.005).toFixed(2)) +} +function fullScreen() { + Cesium.Fullscreen.requestFullscreen(scene.canvas) +} +function birdEye() { +// const position = viewer.camera.positionWC +// const heading = Cesium.Math.toRadians(50)// 水平旋转 -正北方向 +// const pitch = Cesium.Math.toRadians(-90) // 上下旋转 --俯视朝向 +// const range = 0 // 目标点高度 +// viewer.camera.lookAt(position, new Cesium.HeadingPitchRange(heading, pitch, range)) +} +function exportMap() { + +}