|
@@ -5,34 +5,35 @@ import {setBoat} from '@/utils/map/Boat'
|
|
|
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','2023.1','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']
|
|
|
+let layerList = []
|
|
|
|
|
|
export function closeAllLayer() {
|
|
|
- for (let i = 0; i < layerList.length;i++) {
|
|
|
+ for (let i = layerList.length-1; i >=0;i--) {
|
|
|
addLayerByName(layerList[i],false)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
+ 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.splice(i,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(layerList)
|
|
|
|
|
|
switch (name) {
|
|
|
// 船舶
|