Skip to content

Commit

Permalink
缺陷修改:扫描线平面场景下奔溃
Browse files Browse the repository at this point in the history
  • Loading branch information
supermap123 committed Jun 18, 2024
1 parent 4f31f42 commit 7a76423
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions SuperMap iEarth/public/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ const local_en = {
s3mNameRepeatTip:'The layer name is duplicated, please modify the current layer name',
sceneNameRepeatTip:'This scene already exists, please do not add it again',
refresh:"refresh",
scanNotSupportPlane:'Scanlines currently do not support flat scenes'
}

window.local_en = local_en;
1 change: 1 addition & 0 deletions SuperMap iEarth/public/locale/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ const local_ja = {
s3mNameRepeatTip:'レイヤー名が重複しています。現在のレイヤー名を変更してください',
sceneNameRepeatTip:'このシーンはすでに存在します。再度追加しないでください',
refresh:'リフレッシュ',
scanNotSupportPlane:'スキャンラインは平面シーンをサポートしていません'
}

window.local_ja = local_ja;
1 change: 1 addition & 0 deletions SuperMap iEarth/public/locale/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ const local_ru = {
s3mNameRepeatTip:'Имя слоя дублируется, измените имя текущего слоя.',
sceneNameRepeatTip:'Эта сцена уже существует, пожалуйста, не добавляйте ее снова',
refresh:'Обновить',
scanNotSupportPlane:'Линия сканирования пока не поддерживает плоские сцены'
}

window.local_ru = local_ru;
1 change: 1 addition & 0 deletions SuperMap iEarth/public/locale/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ const local_zh = {
s3mNameRepeatTip:'图层名重复,请修改当前图层名称',
sceneNameRepeatTip:'该场景已存在,请勿重复添加',
refresh:"刷新",
scanNotSupportPlane:'扫描线暂不支持平面场景'
}

window.local_zh = local_zh;
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
text-color="#fff"
@click="addScans"
style="margin-right: 0.1rem"
:disabled="isPlane"
>{{ $t("add") }}</n-button
>
<n-button
Expand All @@ -141,10 +142,11 @@

<script lang="ts" setup>
import { reactive, onMounted, onBeforeUnmount, watch } from "vue";
import { useNotification } from "naive-ui";
import { useNotification,useMessage } from "naive-ui";
import initHandler from "@/tools/drawHandler";
const notification = useNotification();
const message = useMessage();
type stateType = {
scanMode: number; // 扫描模式
Expand Down Expand Up @@ -227,6 +229,9 @@ function init() {
}
onMounted(() => {
if(viewer.scene.mode == 1){
message.warning($t('scanNotSupportPlane'));
}
init();
setTexturesByProps();
});
Expand All @@ -239,6 +244,8 @@ onBeforeUnmount(() => {
}
});
let isPlane = viewer.scene.mode == 1 ? true : false;
// 设置纹理
function setTexturesByProps() {
defaultLineTextrues = defaultLineTextrues.slice(0, 1);
Expand Down Expand Up @@ -279,13 +286,15 @@ function addCircleScans(e) {
viewer.enableCursorStyle = true;
document.body.classList.remove("measureCur");
let centerPosition = viewer.scene.pickPosition(e.message.position);
if (state.scanShow) {
viewer.scene.scanEffect.add(centerPosition);
return;
if (centerPosition) {
if (state.scanShow) {
viewer.scene.scanEffect.add(centerPosition);
return;
}
viewer.scene.scanEffect.centerPostion = centerPosition;
state.scanShow = true;
viewer.eventManager.removeEventListener("CLICK", addCircleScans);
}
viewer.scene.scanEffect.centerPostion = centerPosition;
state.scanShow = true;
viewer.eventManager.removeEventListener("CLICK", addCircleScans);
}
// 扫描
Expand Down

0 comments on commit 7a76423

Please sign in to comment.