diff --git a/SuperMap iEarth/public/locale/en.js b/SuperMap iEarth/public/locale/en.js index 33e9fe97..d6693358 100644 --- a/SuperMap iEarth/public/locale/en.js +++ b/SuperMap iEarth/public/locale/en.js @@ -658,7 +658,8 @@ const local_en = { wireframeColor: "Wireframe Color", chooseThenOffset: "Click to select the model, then offset it", fillColor: "Fill Color", - tree_darg_tip: 'Please drag and drop in the same level directory', + tree_darg_tip_level: 'Please drag and drop in the same level directory', + tree_darg_tip_img: 'Only supports image layer adjustment order', rename: 'Rename', bindMediaField: 'Bind media fields', // 媒体字段(地图查询)- start mediaField: 'Media fields', @@ -675,12 +676,21 @@ const local_en = { qxLayerDataUrl: 'Please enter the data service URL for this layer', qxLayerDataSource: 'Please enter the data source corresponding to this layer', qxLayerDataset: 'Please enter the data set corresponding to this layer', + skyLineDownLoadTip: '2D Skyline', + profileDownLoadTip: 'Profile information (section)', + raiseOne: 'Move one level up', + lowerOne: 'Move down one level', + raiseToTop: 'Move to top', + lowerToBottom: 'Move to bottom', qxCover: 'map overlay tilt', + mvtCover: 'Vector tile overlay tilt', selectQxLayer: 'Select the tilt layer', cover: 'Overlay', education: "SuperMap Education", urlChecedFail:"Url verification failed, please enter the correct address", appointSceneName:'Specify scene name', + customImgSupport:"Custom addition of images currently only supports SuperMapImageryProvider type services", + customTinSupport:"Custom terrain addition currently only supports SuperMapTerrainProvider type services", s3mNameRepeatTip:'The layer name is duplicated, please modify the current layer name', sceneNameRepeatTip:'This scene already exists, please do not add it again' } diff --git a/SuperMap iEarth/public/locale/ja.js b/SuperMap iEarth/public/locale/ja.js index 35d47e8b..1c7ae28c 100644 --- a/SuperMap iEarth/public/locale/ja.js +++ b/SuperMap iEarth/public/locale/ja.js @@ -658,7 +658,8 @@ const local_ja = { wireframeColor: "ワイヤフレームカラー", chooseThenOffset: "選択したモデルをクリックしてオフセットします", fillColor: "じゅうてんカラー", - tree_darg_tip: '兄弟ディレクトリの下でドラッグしてください', + tree_darg_tip_level: '同じ階層のディレクトリにドラッグ&ドロップしてください', + tree_darg_tip_img: '画像レイヤーの調整順序のみをサポートします', rename: '名前を変更', bindMediaField: 'メディアフィールドをバインドする', // 媒体字段(地图查询)- start mediaField: 'メディア分野', @@ -675,12 +676,21 @@ const local_ja = { qxLayerDataUrl: 'このレイヤーのデータ サービス URL を入力してください', qxLayerDataSource: 'このレイヤーに対応するデータ ソースを入力してください', qxLayerDataset: 'このレイヤーに対応するデータセットを入力してください', + skyLineDownLoadTip: '2D スカイライン', + profileDownLoadTip: 'プロフィール情報(セクション)', + raiseOne: '1 つ上のレベルに移動', + lowerOne: '1 つ下のレベルに移動', + raiseToTop: '先頭に移動', + lowerToBottom: '一番下に移動', qxCover: '地図オーバーレイの傾き', + mvtCover: 'ベクター タイル オーバーレイの傾き', selectQxLayer: '傾斜レイヤーを選択します', cover: 'かぶせる', education: "教育版", urlChecedFail:"Urlチェックに失敗しました。正しいアドレスを入力してください", appointSceneName:'シーン名の指定', + customImgSupport:"カスタム追加イメージは現在、SuperMapImageryProviderタイプサービスのみをサポートしています", + customTinSupport:"カスタム地形追加現在SuperMapTerrainProviderタイプサービスのみサポート", s3mNameRepeatTip:'レイヤー名が重複しています。現在のレイヤー名を変更してください', sceneNameRepeatTip:'このシーンはすでに存在します。再度追加しないでください' } diff --git a/SuperMap iEarth/public/locale/ru.js b/SuperMap iEarth/public/locale/ru.js index fc90b7cd..4c133a77 100644 --- a/SuperMap iEarth/public/locale/ru.js +++ b/SuperMap iEarth/public/locale/ru.js @@ -658,7 +658,8 @@ const local_ru = { wireframeColor: "Цвет рамки", chooseThenOffset: "Нажмите на выбранную модель, а затем переместите", fillColor: "Цвет заполнения", - tree_darg_tip: 'Перетащите в каталог того же уровня', + tree_darg_tip_level: 'Пожалуйста, перетащите в каталог того же уровня.', + tree_darg_tip_img: 'Поддерживается только порядок настройки слоев изображения.', rename: 'Переименовать', bindMediaField: 'Привязка медиа-полей', // 媒体字段(地图查询)- start mediaField: 'медиа-поля', @@ -675,12 +676,21 @@ const local_ru = { qxLayerDataUrl: 'Введите URL-адрес службы данных для этого слоя.', qxLayerDataSource: 'Пожалуйста, введите источник данных, соответствующий этому слою', qxLayerDataset: 'Пожалуйста, введите набор данных, соответствующий этому слою', + skyLineDownLoadTip: '2D горизонт', + profileDownLoadTip: 'Информация профиля (раздел)', + raiseOne: 'Переместиться на один уровень вверх', + lowerOne: 'Перейти на один уровень вниз', + raiseToTop: 'Перейти наверх', + lowerToBottom: 'Перейти вниз', qxCover: 'наклон наложения карты', + mvtCover: 'Наклон наложения векторной плитки', selectQxLayer: 'Выберите слой наклона', cover: 'Наложение', education: "обучать", urlChecedFail:"Ошибка проверки Url, введите правильный адрес", appointSceneName:'Укажите имя сцены', + customImgSupport:"В настоящее время поддерживаются только службы типов SuperMapImageryProvider", + customTinSupport:"В настоящее время поддерживаются только сервисы типа SuperMapTerrainProvider", s3mNameRepeatTip:'Имя слоя дублируется, измените имя текущего слоя.', sceneNameRepeatTip:'Эта сцена уже существует, пожалуйста, не добавляйте ее снова' } diff --git a/SuperMap iEarth/public/locale/zh.js b/SuperMap iEarth/public/locale/zh.js index e17d3913..e1018043 100644 --- a/SuperMap iEarth/public/locale/zh.js +++ b/SuperMap iEarth/public/locale/zh.js @@ -88,7 +88,7 @@ const local_zh = { clipMode: '裁剪模式', inner: '内部', outer: '外部', - boxclipTip: '点击鼠标左键绘制box底面,移动鼠标绘制box高度,点击鼠标右键结束绘制', + boxclipTip: '鼠标左键绘制矩形作为Box底面,移动鼠标绘制Box高度,右键结束', displayCilpPlane: '显示裁剪面', verticalNormal: '垂直法线', parallelNormal: '平行法线', @@ -311,7 +311,7 @@ const local_zh = { closeGroundMode: '贴地模式', closeS3MMode: '贴S3M模式', closeBoth: '贴地贴对象', - editLineTip: '鼠标左键开始添加,右键结束,选中对象编辑', + editLineTip: '鼠标左键添加,右键结束,选中对象编辑', editLineTip2: '鼠标左键选中绘制对象进行编辑', symbolType: '符号类型', symbolColor: '符号颜色', @@ -329,7 +329,7 @@ const local_zh = { singleDel: '单个删除', wholeDel: '线面删除', addSkitTip: '请选择符号', - delSkitTip: '请点选场景中添加的小品', + delSkitTip: '请选中场景中添加的小品', cylinder: '圆柱体', cube: '立方体', sphere: '球体', @@ -590,7 +590,7 @@ const local_zh = { // 倾斜模型单体化 featrueID: "要素ID", - singleTip_waring: '请输入与该倾斜摄影图层对应的:数据服务、数据源、数据集', + singleTip_waring: '请输入与该倾斜摄影图层对应的:数据服务、数据源、数据集', singleTip_success: '倾斜摄影图层与数据服务绑定成功,点击进行单体化查询', // 我的服务-iportal @@ -648,17 +648,18 @@ const local_zh = { // Tip qxModelTip: '该功能只支持倾斜摄影三维模型', repeatAddTip: "请勿重复添加!", - repeatAddWMTSTip: "该wmts图层已添加,请勿重复添加", + repeatAddWMTSTip: "该wmts图层已添加,请勿重复添加", // 新增 outLineColor: "轮廓线颜色", outLineWidth: "轮廓线宽度", - lightTip_edit: "请选中光源模型,再编辑属性", + lightTip_edit: "请选中光源模型,再编辑属性", lightTip_del: "请选中光源模型在删除", wireframeColor: "线框颜色", chooseThenOffset: "点击选中模型,再偏移", fillColor: "填充颜色", - tree_darg_tip: '请在同级目录下拖拽', + tree_darg_tip_level: '请在同级目录下拖拽', + tree_darg_tip_img: '仅支持影像图层调整顺序', rename: '重命名', bindMediaField: '绑定媒体字段', // 媒体字段(地图查询)- start mediaField: '媒体字段', @@ -675,14 +676,23 @@ const local_zh = { qxLayerDataUrl: '请输入该图层的数据服务URL', qxLayerDataSource: '请输入该图层对应的数据源', qxLayerDataset: '请输入该图层对应的数据集', + skyLineDownLoadTip: '二维天际线', + profileDownLoadTip: '剖面信息(截面)', + raiseOne: '上移一层', + lowerOne: '下移一层', + raiseToTop: '移至顶层', + lowerToBottom: '移至底层', qxCover: '地图叠加倾斜', + mvtCover: '矢量瓦片叠加倾斜', selectQxLayer: '选择倾斜图层', cover: '叠加', education: "教育版", urlChecedFail:"Url校验失败,请输入正确地址", appointSceneName:'指定场景名称', + customImgSupport:"自定义添加影像当前仅支持 SuperMapImageryProvider 类型服务", + customTinSupport:"自定义添加地形当前仅支持 SuperMapTerrainProvider 类型服务", s3mNameRepeatTip:'图层名重复,请修改当前图层名称', - sceneNameRepeatTip:'该场景已存在,请勿重复添加' + sceneNameRepeatTip:'该场景已存在,请勿重复添加', } window.local_zh = local_zh; \ No newline at end of file diff --git a/SuperMap iEarth/src/assets/icons/demo_index.html b/SuperMap iEarth/src/assets/icons/demo_index.html index ca75716b..8fc3cc0b 100644 --- a/SuperMap iEarth/src/assets/icons/demo_index.html +++ b/SuperMap iEarth/src/assets/icons/demo_index.html @@ -54,6 +54,18 @@
@font-face@font-face {
font-family: 'iconfont';
- src: url('iconfont.woff2?t=1713757391644') format('woff2'),
- url('iconfont.woff?t=1713757391644') format('woff'),
- url('iconfont.ttf?t=1713757391644') format('truetype');
+ src: url('iconfont.woff2?t=1716272877827') format('woff2'),
+ url('iconfont.woff?t=1716272877827') format('woff'),
+ url('iconfont.ttf?t=1716272877827') format('truetype');
}
第二步:定义使用 iconfont 的样式
@@ -1264,6 +1276,24 @@ 第三步:挑选相应图标并获取字体编码,应用于页面
+ -
+
+
+ 查询
+
+ .iconchaxun
+
+
+
+ -
+
+
+ 帮助
+
+ .iconbangzhu
+
+
+
-
@@ -1922,11 +1952,11 @@
第三步:挑选相应图标并获取字体编码,应用于页面
-
-
+
- 查询
+ 属性查询
- .iconchaxun
+ .iconshuxingchaxun
@@ -2336,11 +2366,11 @@
第三步:挑选相应图标并获取字体编码,应用于页面
-
-
+
- skin
+ 主题
- .iconskin
+ .iconzhuti
@@ -3037,6 +3067,22 @@
第二步:挑选相应图标并获取类名,应用于页面:
+ -
+
+ 查询
+ #iconchaxun
+
+
+ -
+
+ 帮助
+ #iconbangzhu
+
+
-
-
@@ -3991,10 +4037,10 @@
第二步:挑选相应图标并获取类名,应用于页面:
skin
- #iconskin
+ 主题
+ #iconzhuti
-
-
diff --git a/SuperMap iEarth/src/assets/icons/iconfont.css b/SuperMap iEarth/src/assets/icons/iconfont.css
index 7e5c52cd..d999fda4 100644
--- a/SuperMap iEarth/src/assets/icons/iconfont.css
+++ b/SuperMap iEarth/src/assets/icons/iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2397568 */
- src: url('iconfont.woff2?t=1713757391644') format('woff2'),
- url('iconfont.woff?t=1713757391644') format('woff'),
- url('iconfont.ttf?t=1713757391644') format('truetype');
+ src: url('iconfont.woff2?t=1716272877827') format('woff2'),
+ url('iconfont.woff?t=1716272877827') format('woff'),
+ url('iconfont.ttf?t=1716272877827') format('truetype');
}
.iconfont {
@@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
+.iconchaxun:before {
+ content: "\e8e6";
+}
+
+.iconbangzhu:before {
+ content: "\e8e5";
+}
+
.iconditudiejiaqingxie:before {
content: "\e8a4";
}
@@ -305,7 +313,7 @@
content: "\e892";
}
-.iconchaxun:before {
+.iconshuxingchaxun:before {
content: "\e89d";
}
@@ -489,7 +497,7 @@
content: "\e86d";
}
-.iconskin:before {
+.iconzhuti:before {
content: "\e86e";
}
diff --git a/SuperMap iEarth/src/assets/icons/iconfont.js b/SuperMap iEarth/src/assets/icons/iconfont.js
index b25472b4..cff9dcf0 100644
--- a/SuperMap iEarth/src/assets/icons/iconfont.js
+++ b/SuperMap iEarth/src/assets/icons/iconfont.js
@@ -1 +1 @@
-window._iconfont_svg_string_2397568='
',function(h){var a=(a=document.getElementsByTagName("script"))[a.length-1],l=a.getAttribute("data-injectcss"),a=a.getAttribute("data-disable-injectsvg");if(!a){var i,o,t,z,v,m=function(a,l){l.parentNode.insertBefore(a,l)};if(l&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}i=function(){var a,l=document.createElement("div");l.innerHTML=h._iconfont_svg_string_2397568,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?m(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(i,0):(o=function(){document.removeEventListener("DOMContentLoaded",o,!1),i()},document.addEventListener("DOMContentLoaded",o,!1)):document.attachEvent&&(t=i,z=h.document,v=!1,d(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,p())})}function p(){v||(v=!0,t())}function d(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(d,50)}p()}}(window);
\ No newline at end of file
+window._iconfont_svg_string_2397568=' ',function(h){var a=(a=document.getElementsByTagName("script"))[a.length-1],l=a.getAttribute("data-injectcss"),a=a.getAttribute("data-disable-injectsvg");if(!a){var i,o,t,z,v,m=function(a,l){l.parentNode.insertBefore(a,l)};if(l&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}i=function(){var a,l=document.createElement("div");l.innerHTML=h._iconfont_svg_string_2397568,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?m(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(i,0):(o=function(){document.removeEventListener("DOMContentLoaded",o,!1),i()},document.addEventListener("DOMContentLoaded",o,!1)):document.attachEvent&&(t=i,z=h.document,v=!1,d(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,p())})}function p(){v||(v=!0,t())}function d(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(d,50)}p()}}(window);
\ No newline at end of file
diff --git a/SuperMap iEarth/src/assets/icons/iconfont.json b/SuperMap iEarth/src/assets/icons/iconfont.json
index 935255f6..6a19b99f 100644
--- a/SuperMap iEarth/src/assets/icons/iconfont.json
+++ b/SuperMap iEarth/src/assets/icons/iconfont.json
@@ -5,6 +5,20 @@
"css_prefix_text": "icon",
"description": "",
"glyphs": [
+ {
+ "icon_id": "40252589",
+ "name": "查询",
+ "font_class": "chaxun",
+ "unicode": "e8e6",
+ "unicode_decimal": 59622
+ },
+ {
+ "icon_id": "40216611",
+ "name": "帮助",
+ "font_class": "bangzhu",
+ "unicode": "e8e5",
+ "unicode_decimal": 59621
+ },
{
"icon_id": "40001124",
"name": "地图叠加倾斜",
@@ -518,8 +532,8 @@
},
{
"icon_id": "38464193",
- "name": "查询",
- "font_class": "chaxun",
+ "name": "属性查询",
+ "font_class": "shuxingchaxun",
"unicode": "e89d",
"unicode_decimal": 59549
},
@@ -840,8 +854,8 @@
},
{
"icon_id": "36023465",
- "name": "skin",
- "font_class": "skin",
+ "name": "主题",
+ "font_class": "zhuti",
"unicode": "e86e",
"unicode_decimal": 59502
},
diff --git a/SuperMap iEarth/src/assets/icons/iconfont.ttf b/SuperMap iEarth/src/assets/icons/iconfont.ttf
index 59f71679..0ee2a9ea 100644
Binary files a/SuperMap iEarth/src/assets/icons/iconfont.ttf and b/SuperMap iEarth/src/assets/icons/iconfont.ttf differ
diff --git a/SuperMap iEarth/src/assets/icons/iconfont.woff b/SuperMap iEarth/src/assets/icons/iconfont.woff
index 1cda0b64..4ba8d202 100644
Binary files a/SuperMap iEarth/src/assets/icons/iconfont.woff and b/SuperMap iEarth/src/assets/icons/iconfont.woff differ
diff --git a/SuperMap iEarth/src/assets/icons/iconfont.woff2 b/SuperMap iEarth/src/assets/icons/iconfont.woff2
index b483ec16..29c9be6d 100644
Binary files a/SuperMap iEarth/src/assets/icons/iconfont.woff2 and b/SuperMap iEarth/src/assets/icons/iconfont.woff2 differ
diff --git a/SuperMap iEarth/src/package/layerTree/layerTree.vue b/SuperMap iEarth/src/package/layerTree/layerTree.vue
index 246edb62..d2a713dc 100644
--- a/SuperMap iEarth/src/package/layerTree/layerTree.vue
+++ b/SuperMap iEarth/src/package/layerTree/layerTree.vue
@@ -47,7 +47,8 @@ function renderSuffix({ option }: { option: TreeOption | any }) {
text: true,
title: $t("isShow"),
style: "margin-right:0.04rem",
- onClick: (e) => {
+ focusable: false, // 取消focus效果
+ onClick: () => {
setLayerShow(option);
},
},
@@ -90,8 +91,7 @@ function renderSuffix({ option }: { option: TreeOption | any }) {
bordered: false,
text: true,
title: "",
- focusable: false, // 不起作用
- class: "layer-tree-item",
+ focusable: false, // 取消focus效果
onClick: (e) => {},
},
{
@@ -161,6 +161,26 @@ function setOptionsByType(type: string) {
key: 1,
icon: () => h("i", { class: "iconfont icondingwei" }, ""),
},
+ {
+ label: $t("raiseOne"),
+ key: 66,
+ icon: () => h("i", { class: "iconfont iconshangyiyiceng" }, ""),
+ },
+ {
+ label: $t("lowerOne"),
+ key: 67,
+ icon: () => h("i", { class: "iconfont iconxiayiyiceng" }, ""),
+ },
+ {
+ label: $t("raiseToTop"),
+ key: 68,
+ icon: () => h("i", { class: "iconfont iconzhiding" }, ""),
+ },
+ {
+ label: $t("lowerToBottom"),
+ key: 69,
+ icon: () => h("i", { class: "iconfont iconzhidi" }, ""),
+ },
{
label: $t("mapQuery"),
key: 11,
@@ -194,6 +214,11 @@ function setOptionsByType(type: string) {
key: 1,
icon: () => h("i", { class: "iconfont icondingwei" }, ""),
},
+ // {
+ // label: $t("mvtCover"),
+ // key: 101,
+ // icon: () => h("i", { class: "iconfont icondingwei" }, ""),
+ // },
{
label: $t("rename"),
key: 0,
@@ -409,8 +434,38 @@ function setDropdownAction(option: any, key: number) {
panelStore.setRightToolBarList({ id: 11 });
} else if (key === 12) {
panelStore.setRightToolBarList({ id: 12 });
- }else if (key === 72) {
+ } else if (key === 66) {
+ let index = String(option.key).split("-")[1];
+ let imgLayer = viewer.imageryLayers._layers[Number(index)];
+ if (imgLayer) {
+ viewer.imageryLayers.raise(imgLayer);
+ layerStore.updateLayer({ type: "imagery" });
+ }
+ } else if (key === 67) {
+ let index = String(option.key).split("-")[1];
+ let imgLayer = viewer.imageryLayers._layers[Number(index)];
+ if (imgLayer) {
+ viewer.imageryLayers.lower(imgLayer);
+ layerStore.updateLayer({ type: "imagery" });
+ }
+ } else if (key === 68) {
+ let index = String(option.key).split("-")[1];
+ let imgLayer = viewer.imageryLayers._layers[Number(index)];
+ if (imgLayer) {
+ viewer.imageryLayers.raiseToTop(imgLayer);
+ layerStore.updateLayer({ type: "imagery" });
+ }
+ } else if (key === 69) {
+ let index = String(option.key).split("-")[1];
+ let imgLayer = viewer.imageryLayers._layers[Number(index)];
+ if (imgLayer) {
+ viewer.imageryLayers.lowerToBottom(imgLayer);
+ layerStore.updateLayer({ type: "imagery" });
+ }
+ } else if (key === 72) {
panelStore.setRightToolBarList({ id: 13 });
+ } else if (key === 101) {
+ panelStore.setRightToolBarList({ id: 14 });
}
}
@@ -431,18 +486,35 @@ function findSiblingsAndIndex(
// 拖拽相关事件
function handleDrop({ node, dragNode, dropPosition }) {
- let node_key,
- dragNode_key = undefined;
+ // node为目标节点,dragNode为当前拖拽节点
+ let target_level,
+ drag_level = undefined;
+ let target_index: number = -1;
+ let drag_index: number = -1;
if (node && node.key.indexOf("-") != -1) {
- node_key = node.key.split("-")[0];
+ let node_split_arr = node.key.split("-");
+ if (node_split_arr.length > 1) {
+ target_level = node_split_arr[0];
+ target_index = Number(node_split_arr[1]);
+ }
}
if (dragNode && dragNode.key.indexOf("-") != -1) {
- dragNode_key = dragNode.key.split("-")[0];
+ let dragNode_split_arr = dragNode.key.split("-");
+ if (dragNode_split_arr.length > 1) {
+ drag_level = dragNode_split_arr[0];
+ drag_index = Number(dragNode_split_arr[1]);
+ }
}
- if (node_key != dragNode_key) {
- message.warning($t("tree_darg_tip"));
+
+ if (target_level != "2" && drag_level != "2") {
+ message.warning($t("tree_darg_tip_img"));
+ return;
+ }
+ if (target_level != drag_level) {
+ message.warning($t("tree_darg_tip_level"));
return;
}
+
const [dragNodeSiblings, dragNodeIndex] = findSiblingsAndIndex(
dragNode,
layerTreeData
@@ -465,6 +537,9 @@ function handleDrop({ node, dragNode, dropPosition }) {
nodeSiblings.splice(nodeIndex + 1, 0, dragNode);
}
layerTreeData = Array.from(layerTreeData);
+
+ // 拖拽改变图层顺序
+ changeLayerOrderByDrag(drag_index, target_index);
}
//节点内容渲染函数
@@ -506,7 +581,7 @@ const nodelabel = ({ option }: { option: TreeOption }) => {
option.isedit = false;
},
})
- : h(NEllipsis,{
+ : h(NEllipsis,{
bordered: false,
text: true,
title: option.label,
@@ -529,6 +604,29 @@ const checkCamera = ({ option }: { option: TreeOption }) => {
},
};
};
+
+// 通过拖拽调整图层顺序
+function changeLayerOrderByDrag(drag_index: number, target_index: number) {
+ // 影像图层列表中index从下往上为:0 1 2 .. n,所以drag - target < 0,drag才是raise,反之则亦然
+ let gap: number = drag_index - target_index;
+ let change_count = Math.abs(gap);
+ let drag_imgLayer = viewer.imageryLayers._layers[drag_index];
+ if (gap > 0) {
+ //上 -> 下:lower
+ for (let i = 0; i < change_count; i++) {
+ viewer.imageryLayers.lower(drag_imgLayer);
+ }
+ } else if (gap < 0) {
+ // 下 -> 上:raise
+ for (let i = 0; i < change_count; i++) {
+ viewer.imageryLayers.raise(drag_imgLayer);
+ }
+ } else {
+ return;
+ }
+
+ layerStore.updateLayer({ type: "imagery" });
+}