Skip to content

Commit

Permalink
解决缺陷:天地图、必应地图保存后打不开,图层列表文字过长、GPU剖面分析崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
supermap123 committed Apr 19, 2024
1 parent def9156 commit f3040d5
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"liveServer.settings.port": 5502
"liveServer.settings.port": 5505
}
30 changes: 15 additions & 15 deletions SuperMap iEarth/public/config/serviceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,21 @@ const layerServiceData = {
thumbnail: './images/baseMap/grad.png',
type: 'GRIDIMAGERY',
chooseType: false,
},
{
url: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
name: "japanStand",
thumbnail: './images/baseMap/standard_jp.png',
type: 'UrlTemplateImageryProvider',
chooseType: false,
},
{
url: 'https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png',
name: "japanPale",
thumbnail: './images/baseMap/tinge_jp.png',
type: 'UrlTemplateImageryProvider',
chooseType: false,
},
}
// {
// url: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
// name: "japanStand",
// thumbnail: './images/baseMap/standard_jp.png',
// type: 'UrlTemplateImageryProvider',
// chooseType: false,
// },
// {
// url: 'https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png',
// name: "japanPale",
// thumbnail: './images/baseMap/tinge_jp.png',
// type: 'UrlTemplateImageryProvider',
// chooseType: false,
// },
// {
// url: 'https://cyberjapandata.gsi.go.jp/xyz/blank/{z}/{x}/{y}.png',
// name: "japanBlank",
Expand Down
7 changes: 7 additions & 0 deletions SuperMap iEarth/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,13 @@ const overridesTheme = {
line-height: 0.34rem;
}
/* 图层列表选项 内容 避免过长 */
.n-tree .n-tree-node-content .n-tree-node-content__text div{
width: 140px;
overflow: hidden;
text-overflow: ellipsis; // 文字过长后使用省略号
}
// echarts图表样式
#echartsProfile > div {
left: 0.1rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ function setDataForGpuProFile(result: any) {
//分析
function analysis() {
// 解决缺陷【8035】GPU剖面分析下报错崩溃问题
profile.clear();
if (ctx) ctx.clearRect(0, 0, canvas.width, canvas.height);
profile_GPU.destroy();
profile_GPU = new SuperMap3D.Profile(scene);
let interValID = setInterval(() => {
if (!handlerPolyline.positions) return;
Expand Down Expand Up @@ -264,7 +270,12 @@ function analysis() {
state.show = false;
}
});
if (state.infoShowMode === "canvas") getCanvasImage();
if (state.infoShowMode === "canvas") {
// getCanvasImage();
setTimeout(()=>{ // 通过定时器延迟执行获取,还是不对,接口问题?
getCanvasImage();
},1000)
}
handlerPolyline.polylineTransparent.show = false;
},
(err) => {
Expand Down
12 changes: 10 additions & 2 deletions SuperMap iEarth/src/package/layerTree/layerTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<script setup lang="ts">
import { h, ref, nextTick, onMounted } from "vue";
import { TreeOption, NButton, NDropdown, NInput, useMessage } from "naive-ui";
import { TreeOption, NButton, NDropdown, NInput, useMessage, NEllipsis } from "naive-ui";
import { usePanelStore } from "@/store";
import { useLayerStore } from "@/store/index";
Expand Down Expand Up @@ -443,6 +443,7 @@ const nodelabel = ({ option }: { option: TreeOption }) => {
autofocus: true,
ref: inputRef,
size: "small",
title: option.label,
value: option.label,
onUpdateValue: (v) => {
option.label = v;
Expand Down Expand Up @@ -471,7 +472,14 @@ const nodelabel = ({ option }: { option: TreeOption }) => {
option.isedit = false;
},
})
: option.label
: h(NEllipsis,{
bordered: false,
text: true,
title: option.label,
focusable: false, // 取消focus效果
},
{ default: () => option.label }
)
);
};
Expand Down
10 changes: 5 additions & 5 deletions SuperMap iEarth/src/views/viewer/openScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ let state = reactive({
sceneID: '',
updateTime: undefined,
isNewVersion: true,
key: layerStore.configToken.BingMapKey, // 必应地图key
TiandituToken: layerStore.configToken.TiandituToken, // 天地图token
// key: layerStore.configToken.BingMapKey, // 必应地图key
// TiandituToken: layerStore.configToken.TiandituToken, // 天地图token
})

// 打开已保存的场景
Expand Down Expand Up @@ -270,14 +270,14 @@ function openImagery(content: any) {
case "BingMapsImageryProvider":
imageryProvider = new SuperMap3D.BingMapsImageryProvider({
url: content.layers.imageryLayer[i].url,
key: state.key
key: layerStore.configToken.BingMapKey
// key: "Aq0D7MCY5ErORA9vrwFtfE9aancUq5J6uNjw0GieF0ostaIrVuJZ8ScXxNHHvEwS",
});
break;
case "TiandituImageryProvider":
imageryProvider = new SuperMap3D.TiandituImageryProvider({
url: content.layers.imageryLayer[i].url,
token: state.TiandituToken
token: layerStore.configToken.TiandituToken
// token: content.layers.imageryLayer[i].token
});
break;
Expand Down Expand Up @@ -345,7 +345,7 @@ function openTerrain(content: any) {
break;
case "tianDiTuTerrain":
viewer.terrainProvider = new SuperMap3D.TiandituTerrainProvider({
token: state.TiandituToken
token: layerStore.configToken.TiandituToken
});
break;
case "supermapOnlineTerrain":
Expand Down
6 changes: 5 additions & 1 deletion SuperMap iEarth/src/views/viewer/viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ window.EarthGlobal = {};
let viewer: any;
onMounted(() => {
getCreateOrEditScene();
// getCreateOrEditScene();
initViewer();
});
Expand All @@ -34,6 +34,10 @@ onBeforeUnmount(() => {
// 获取token和key相关配置
getConfig().then((res) => {
if (window.iEarthConsole) console.log("当前configToken配置:", res);
getCreateOrEditScene();
},(err) => {
console.log(err);
getCreateOrEditScene(); // 确保无论如何都能打开场景
});
// 获取当前环境:创建 || 编辑 or 非iportal环境(普通环境)
Expand Down

0 comments on commit f3040d5

Please sign in to comment.