|
@@ -8,6 +8,58 @@ 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 = []
|
|
|
|
|
|
+let defaultLayerList = [
|
|
|
+ {
|
|
|
+ // 水上客运
|
|
|
+ id: 'waterPassenger',
|
|
|
+ title: 'waterPassenger',
|
|
|
+ type: 'feature',
|
|
|
+ url:'http://10.83.68.109:6080/arcgis/rest/services/water_passenger_3857/MapServer',
|
|
|
+ visible: false,
|
|
|
+ opacity: 1,
|
|
|
+ token: '',
|
|
|
+ is_goto: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 数字孪生图层
|
|
|
+ id: 'digitalTwain',
|
|
|
+ title: 'digitalTwain',
|
|
|
+ type: 'feature',
|
|
|
+ url:'http://10.83.68.109:6080/arcgis/rest/services/digitalTwain_3857/MapServer',
|
|
|
+ visible: false,
|
|
|
+ opacity: 1,
|
|
|
+ token: '',
|
|
|
+ is_goto: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // 地图查询图层
|
|
|
+ id: 'ghjgCxall',
|
|
|
+ title: 'ghjgCxall',
|
|
|
+ type: 'shc_map',
|
|
|
+ url:'http://10.83.68.109:6080/arcgis/rest/services/ghjg_cxall/MapServer',
|
|
|
+ visible: false,
|
|
|
+ opacity: 1,
|
|
|
+ token: '',
|
|
|
+ is_goto: false
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
+export function addDefaultServer(){
|
|
|
+ for (let i = 0; i < defaultLayerList.length; i++) {
|
|
|
+ let layerObject = defaultLayerList[i];
|
|
|
+ addLayer({
|
|
|
+ id: layerObject.id,
|
|
|
+ title: layerObject.title,
|
|
|
+ type: layerObject.type,
|
|
|
+ url: layerObject.url,
|
|
|
+ visible: layerObject.visible,
|
|
|
+ opacity: layerObject.opacity,
|
|
|
+ token: layerObject.token,
|
|
|
+ is_goto: layerObject.is_goto
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
export function closeAllLayer() {
|
|
|
for (let i = layerList.length-1; i >=0;i--) {
|
|
|
addLayerByName(layerList[i],false)
|
|
@@ -276,4 +328,4 @@ export function addLayerByName(name,isShow){
|
|
|
})
|
|
|
break
|
|
|
}
|
|
|
-}
|
|
|
+}
|