|
@@ -2,9 +2,10 @@
|
|
|
* 图层加载工具类
|
|
|
*/
|
|
|
import {setBoat} from '@/utils/map/Boat'
|
|
|
-import {addLayer} from "@/utils/map/ArcgisUtil";
|
|
|
+import {addLayer,setOpacity} from "@/utils/map/ArcgisUtil";
|
|
|
+import {setCenter,setSxdxCamera} from '@/utils/map/Common'
|
|
|
|
|
|
-let layerList = ['cb','mt','jjq','dtq','md','sszh','hb','hd','sxdx','2022.1','2022.2','2021.1','2021.2','2020.1','2020.2']
|
|
|
+let layerList = ['cb','mt','jjq','dtq','md','sszh','hb','hd','sxdx','2023.1','2022.1','2022.2','2021.1','2021.2','2020.1','2020.2']
|
|
|
|
|
|
export function closeAllLayer() {
|
|
|
for (let i = 0; i < layerList.length;i++) {
|
|
@@ -13,6 +14,26 @@ export function closeAllLayer() {
|
|
|
}
|
|
|
|
|
|
export function addLayerByName(name,isShow){
|
|
|
+ // 存储到打开图层列表
|
|
|
+ // if(isShow){
|
|
|
+ // let isExist = false
|
|
|
+ // for(let i = layerList.length-1; i >=0;i--){
|
|
|
+ // if(layerList[i] == name){
|
|
|
+ // isExist = true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if(!isExist){
|
|
|
+ // layerList.push(name)
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+ // for(let i = layerList.length-1; i >=0;i--){
|
|
|
+ // if(layerList[i] == name){
|
|
|
+ // layerList.slice()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // console.log(layerList)
|
|
|
+
|
|
|
switch (name) {
|
|
|
// 船舶
|
|
|
case 'cb':
|
|
@@ -121,11 +142,18 @@ export function addLayerByName(name,isShow){
|
|
|
token: '',
|
|
|
is_goto: true
|
|
|
})
|
|
|
+ // if(isShow){
|
|
|
+ // setOpacity(0.4)
|
|
|
+ // setSxdxCamera()
|
|
|
+ // }else{
|
|
|
+ // setOpacity(1)
|
|
|
+ // setCenter()
|
|
|
+ // }
|
|
|
break
|
|
|
case '2023.1':
|
|
|
addLayer({
|
|
|
- id: 'dbsLayer',
|
|
|
- title: 'dbsLayer',
|
|
|
+ id: 'deepthLayer202301',
|
|
|
+ title: 'deepthLayer202301',
|
|
|
type: 'scene',
|
|
|
url: 'https://geoscene.geosceneonline.cn/server/rest/services/Hosted/多波束/SceneServer',
|
|
|
visible: isShow,
|