Skip to content

Commit

Permalink
保存再编辑
Browse files Browse the repository at this point in the history
  • Loading branch information
supermapliukaiyun committed Jul 7, 2023
1 parent 24a5c2b commit d60a758
Show file tree
Hide file tree
Showing 27 changed files with 754 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ function createAndSaveScene() {
getRootUrl() +
"apps/earth/v2/index.html?id=" +
response.data.newResourceID;
console.log("currentUrl:",currentUrl)
// window.open(currentUrl, "_self");
// console.log("currentUrl:",currentUrl)
window.open(currentUrl, "_self");
}, 1000);
})
.catch(function (error) {
Expand Down Expand Up @@ -465,8 +465,8 @@ function updateScene() {
message.success("场景更新成功!");
let currentUrl =
getRootUrl() + "apps/earth/v2/index.html?id=" + state.sceneID;
console.log("currentUrl:",currentUrl)
// window.open(currentUrl, "_self");
// console.log("currentUrl:",currentUrl)
window.open(currentUrl, "_self");
})
.catch(function (error) {
console.log(error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</div>
<!-- 分析等弹窗 -->
<div class="too-bar four-tool-bar">
<span class="icon-container" v-for="iconItem in panelStore.panelList.rightToolBarList" :key="iconItem.id"
<span class="icon-container" v-for="iconItem in state.rightToolBarList" :key="iconItem.id"
@click="changePanel(iconItem)" :class="iconItem.isSelected ? 'select-too-bar-bg' : ''">
<i class="iconfont" :class="iconItem.iconName" :title="iconItem.title"></i>
</span>
Expand Down Expand Up @@ -58,6 +58,11 @@ onMounted(() => {
init();
});
let state = reactive({
rightToolBarList:panelStore.panelList.rightToolBarList.slice(0,4)
})
// 初始化
function init() {
if (!viewer) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<span>剖面信息</span>
</div> -->
<div class="row-item" style="margin-right: 0.1rem">
<span>剖面信息展示</span>
<span>剖面截图展示</span>
<div class="check-box">
<n-checkbox v-model:checked="state.profileInfoShow"></n-checkbox>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class ProfileAnalysis {
text: "截面",
textStyle: {
fontSize: 15,
color: '#fff'
color: '#CAE6FF'
},
top: '3%',
left:'3%',
Expand All @@ -201,7 +201,7 @@ class ProfileAnalysis {
containLabel: true
},
axisLabel: {// 设置坐标轴字的颜色
color: '#fff'
color: 'color: rgba(255, 255, 255, 0.85);'
},
backgroundColor: "#000817",
tooltip: {
Expand Down Expand Up @@ -231,8 +231,12 @@ class ProfileAnalysis {
toolbox: {
show: true,
feature: {
restore: {},
saveAsImage: {}
restore: {
title:'刷新'
},
saveAsImage: {
title:"下载"
}
},
right: "3%",
iconStyle: {
Expand Down Expand Up @@ -276,7 +280,13 @@ class ProfileAnalysis {
data: this.LatAndLons.map(function (item) {
return item.height;
}),
areaStyle: {},
areaStyle: {
opacity: 0
},
lineStyle: {
color: '#3499E5'
},
showSymbol: false
},
};
this.myChart.setOption(option);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<n-slider v-model:value="state.timeArray" :max="96" :step="0.5" range :marks="state.marks"
:format-tooltip="formatTime" />
<i class="iconfont iconSize iconbofang btnImg" title="播放一天时间段内阳光和阴影动画" v-show="state.showStartTimeBtn" @click="sunLightForTime(true)"></i>
<i class="iconfont iconSize iconzanting btnImg" title="播放一年的阳光和阴影动画" v-show="!state.showStartTimeBtn" @click="sunLightForTime(false)"></i>
<i class="iconfont iconSize iconzanting btnImg" title="播放一天时间段内阳光和阴影动画" v-show="!state.showStartTimeBtn" @click="sunLightForTime(false)"></i>
</div>
<div class="itemBox-shadow">
<!-- <n-date-picker class="shadow-date-picker" v-model:value="currentTime" type="date" size="small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row-item">
<span>经度</span>
<n-input-number
style="width: 1.96rem;height: 0.32rem"
style="width: 1.96rem"
v-model:value="state.degreesArray[0]"
:show-button="false"
disabled
Expand All @@ -15,7 +15,7 @@
<div class="row-item">
<span>纬度</span>
<n-input-number
style="width: 1.96rem;height: 0.32rem;"
style="width: 1.96rem"
v-model:value="state.degreesArray[1]"
:show-button="false"
disabled
Expand All @@ -27,7 +27,7 @@
<div class="row-item">
<span>高程</span>
<n-input-number
style="width: 1.96rem;height: 0.32rem;"
style="width: 1.96rem"
v-model:value="state.degreesArray[2]"
:show-button="false"
disabled
Expand Down Expand Up @@ -67,7 +67,7 @@
@click="analysis"
>分析</n-button
>
<n-button class="btn-secondary" @click="clear">清除</n-button>
<n-button class="btn-secondary" @click="clear" >清除</n-button>
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
></n-color-picker>
</div>
</div>
<div class="row-item">
<div class="row-item" v-show="state.skylineMode ==='BODY'">
<span>天际体颜色</span>
<div class="check-color-pick">
<n-checkbox v-model:checked="state.displaySkyBody"></n-checkbox>
Expand Down
15 changes: 13 additions & 2 deletions SuperMap iEarth/src/package/analyse3d/analyse/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<SmAnalyseSightLine></SmAnalyseSightLine>
</n-tab-pane>
<!-- 可视域 -->
<n-tab-pane name="viewshed" tab="可视域">
<n-tab-pane name="viewshed" tab="可视域" class="use-scroll">
<SmAnalyseViewshed></SmAnalyseViewshed>
</n-tab-pane>
<!-- 阴影 -->
Expand Down Expand Up @@ -45,7 +45,18 @@ function tabsChange(value) {}
.analyse-box {
width: 100%;
height: 100%;
padding: 0 0.12rem;
// padding: 0 0.12rem;
box-sizing: border-box;
:deep(.n-tabs-nav){
padding:0 0.12rem;
};
:deep(.n-tab-pane) {
box-sizing: border-box;
padding-left: 0.12rem;
padding-right: 0.12rem;
}
.use-scroll{
padding-right: 0px;
}
}
</style>
26 changes: 24 additions & 2 deletions SuperMap iEarth/src/package/analyse3d/clip/clip-plane/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
</div>
</template>


<script lang="ts" setup>
import { reactive, watch, onBeforeUnmount } from "vue";
import ClipPlane from "./js/clip-plane.js";
Expand All @@ -43,12 +44,16 @@ type stateType = {
clipFaceShow: boolean; // 是否显示裁剪面
directionByNormal: boolean; // 是否沿法线
modeOptions: any[]; // 模式选项
pickPosition: any, // 存储当前裁剪平面拾取位置
normal: any, // 存储当前裁剪平面法线
};
let state = reactive<stateType>({
zoom: 1,
clipFaceShow: true,
directionByNormal: false,
pickPosition: null,
normal: null,
modeOptions: [
{
label: "截面前",
Expand Down Expand Up @@ -93,6 +98,8 @@ function clipPlaneStart() {
function left_click(e: any) {
let pickPosition = viewer.scene.pickPosition(e.message.position);
let normal = viewer.scene.pickNormal(e.message.position);
state.pickPosition = pickPosition;
state.normal = normal;
if (pickPosition) clipPlane.startClip(pickPosition, normal);
viewer.eventManager.removeEventListener("CLICK", left_click);
viewer.eventManager.removeEventListener("MOUSE_MOVE", mouse_move);
Expand All @@ -102,15 +109,27 @@ function left_click(e: any) {
//沿法线方向裁剪时实时显示参考平面
function mouse_move(e: any) {
if (state.directionByNormal) {
let cartesian = viewer.scene.pickPosition(e.message.endPosition);
let normal = viewer.scene.pickNormal(e.message.endPosition);
let cartesian = viewer.scene.pickPosition(e.message.position);
let normal = viewer.scene.pickNormal(e.message.position);
clipPlane.setReferencePlane(cartesian, normal);
}
}
// 更新平面裁剪模式
function updatePlane() {
clipPlane.clear();
if (state.directionByNormal) {
clipPlane.setReferencePlane(state.pickPosition, state.normal);
}
if (state.pickPosition) clipPlane.startClip(state.pickPosition, state.normal);
}
// 清除
function clear() {
clipPlane.clear();
state.pickPosition = null;
state.normal = null;
viewer.eventManager.removeEventListener("CLICK", left_click);
viewer.eventManager.removeEventListener("MOUSE_MOVE", mouse_move);
document.body.classList.remove("measureCur");
Expand All @@ -134,6 +153,9 @@ watch(
() => state.directionByNormal,
(val) => {
clipPlane.setDirectionByNormal = val;
if(state.pickPosition){
updatePlane();
}
}
);
Expand Down
5 changes: 3 additions & 2 deletions SuperMap iEarth/src/package/analyse3d/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:key="item.id"
:title="item.title"
>
<i class="iconfont" :class="item.iconName"></i>
<i class="iconfont" :class="item.iconName" style="font-size: 18px"></i>
</div>
</div>

Expand Down Expand Up @@ -88,6 +88,7 @@ function changeItem(iconItem: any) {
}
}
.select-bg {
background: #69798d;
background: rgba(255, 255, 255, 0.15);
color: #fff !important;
}
</style>
40 changes: 36 additions & 4 deletions SuperMap iEarth/src/package/layerList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import {
Trash
} from "@vicons/ionicons5";
import { h } from "vue";
import { usePanelStore } from "@/store";
const panelStore = usePanelStore();
const layerStore = useLayerStore();
let currentTerrainProvider: any; // 保存当前地形图层,方便控制其显隐
Expand Down Expand Up @@ -57,6 +59,7 @@ function renderSuffix({ option }: { option: TreeOption | any }) {
title: "显隐",
onClick: (e) => {
console.log(e)
console.log("option:",option)
if (!option.key) return;
let optionKey: any = option.key;
if (optionKey.indexOf("-") != -1) {
Expand Down Expand Up @@ -106,18 +109,37 @@ function renderSuffix({ option }: { option: TreeOption | any }) {
{
trigger: "click",
placement: "right-start",
options: [
options: option.type === 's3m' ? [
{
label: "快速定位",
key: 1,
icon: () => h("i", { class: "iconfont icondingwei" }, ""),
},
// {
// label: "图层操作",
// key: 2,
// icon: () => h("i", { class: "iconfont iconyidong" }, ""),
// },
// {
// label: "图层属性",
// key: 3,
// icon: () => h("i", { class: "iconfont icontishi" }, ""),
// },
// {
// label: "图层风格",
// key: 4,
// icon: () => h("i", { class: "iconfont icontuceng" }, ""),
// },
{
label: "移除",
key: 2,
key: 5,
icon: () => h("i", { class: "iconfont iconshanchu", style: "color: #DC5849"}, ""),
},
],
]:[{
label: "移除",
key: 5,
icon: () => h("i", { class: "iconfont iconshanchu", style: "color: #DC5849"}, ""),
}],
onSelect: (key: any) => {
// key为1:定位,key为2:删除图层
if (key === 1) {
Expand All @@ -141,7 +163,17 @@ function renderSuffix({ option }: { option: TreeOption | any }) {
},
});
}
} else if (key === 2) {
}
else if(key === 2){
panelStore.setRightToolBarList({id:7});
}
else if(key === 3){
panelStore.setRightToolBarList({id:8});
}
else if(key === 4){
panelStore.setRightToolBarList({id:9});
}
else if (key === 5) {
// 删除图层之后 再显隐会有问题,不通过id
let type = option.type;
let layerName = option.label;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import LayerAttribute from './index.vue';

export default LayerAttribute;
Loading

0 comments on commit d60a758

Please sign in to comment.