|
@@ -10,11 +10,15 @@
|
|
|
import CityGis from '../../unit/map/CityGis.Bridge.js';
|
|
|
import {myBridge} from "@/unit/map/map.js";
|
|
|
import {watch ,onMounted} from "vue";
|
|
|
+import {serviceGHLayer,serviceCXLayer,serviceGLLayer} from "@/data/all-layers.js";
|
|
|
import {AddSingleLayer, invokeParams, MapClickByType, SetBackground} from "@/unit/map/addLayer.js";
|
|
|
let bridge;
|
|
|
export default {
|
|
|
name: "Map",
|
|
|
props: {
|
|
|
+ type: {
|
|
|
+ default: () => '' // 默认值为空数组
|
|
|
+ },
|
|
|
serviceNos: {
|
|
|
type: Array,
|
|
|
default: () => [] // 默认值为空数组
|
|
@@ -32,23 +36,60 @@ export default {
|
|
|
})
|
|
|
|
|
|
|
|
|
- console.log("地图创建完成")
|
|
|
- watch(() => props.serviceNos, (newServiceNos) => {
|
|
|
- loadServices(newServiceNos);
|
|
|
- }, { immediate: true });
|
|
|
- function loadServices(serviceNos) {
|
|
|
- serviceNos.forEach(serviceNo => {
|
|
|
+ console.log("地图创建完成");
|
|
|
+ if(props.type == 'plan'){
|
|
|
+ debugger
|
|
|
+ serviceGHLayer.forEach(data => {
|
|
|
AddSingleLayer({
|
|
|
- id: 0,
|
|
|
- title: "dynamic",
|
|
|
+ id: data.labelId,
|
|
|
+ title: data.label,
|
|
|
visible: true,
|
|
|
wkid: 1,
|
|
|
- url: `https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/${serviceNo}`,
|
|
|
- type: "动态地图"
|
|
|
+ url: data.ADDRESS,
|
|
|
+ type: "切片地图"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }else if(props.type =='project'){
|
|
|
+ serviceGLLayer.forEach(data => {
|
|
|
+ AddSingleLayer({
|
|
|
+ id: data.labelId,
|
|
|
+ title: data.label,
|
|
|
+ visible: true,
|
|
|
+ wkid: 1,
|
|
|
+ url: data.ADDRESS,
|
|
|
+ type: "切片地图"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }else if(props.type =='effect'){
|
|
|
+ serviceCXLayer.forEach(data => {
|
|
|
+ AddSingleLayer({
|
|
|
+ id: data.labelId,
|
|
|
+ title: data.label,
|
|
|
+ visible: true,
|
|
|
+ wkid: 1,
|
|
|
+ url: data.ADDRESS,
|
|
|
+ type: "切片地图"
|
|
|
});
|
|
|
});
|
|
|
- MapClickByType(true);
|
|
|
}
|
|
|
+ MapClickByType(true);
|
|
|
+ // watch(() => props.serviceNos, (newServiceNos) => {
|
|
|
+ // loadServices(newServiceNos);
|
|
|
+ // }, { immediate: true });
|
|
|
+ // function loadServices(serviceNos) {
|
|
|
+ // debugger
|
|
|
+ // serviceNos.forEach(serviceNo => {
|
|
|
+ // AddSingleLayer({
|
|
|
+ // id:"serviceNo",
|
|
|
+ // title: "默认服务",
|
|
|
+ // visible: true,
|
|
|
+ // wkid: 1,
|
|
|
+ // url: `https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/${serviceNo}`,
|
|
|
+ // type: "切片地图"
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // MapClickByType(true);
|
|
|
+ // }
|
|
|
});
|
|
|
}
|
|
|
}
|