| | |
| | | navigationStartLngLat: "", //导航起点 |
| | | navigationEndLngLat: "", //导航终点 |
| | | drawALineLayer: null, //导航路径图层 |
| | | drawALineLayerIcon: null, //导航路径图层图标 |
| | | isOpenDrawALine: false, //是否开启路径 |
| | | endPosition: "", //传送终点经纬度-- |
| | | isendPosition: false, //传送终点经纬度--感应数据 |
| | |
| | | state.drawALineLayer.remove(); |
| | | state.drawALineLayer = null; |
| | | state.isOpenDrawALine = false; |
| | | } |
| | | }, |
| | | removerPolyLineIcon(state) { |
| | | if (state.drawALineLayerIcon) { |
| | | state.drawALineLayerIcon.remove(); |
| | | state.drawALineLayerIcon = null; |
| | | } |
| | | }, |
| | | removePolylineMany(state) { |
| | |
| | | color: color, |
| | | speed: 10, |
| | | }); |
| | | let drawALineLayer = new global.DC.VectorLayer("layer"); |
| | | state.mviewer.addLayer(drawALineLayer); |
| | | let polyline = new global.DC.Polyline(Str); //加入绘画点 |
| | | state.drawALineLayer = new global.DC.VectorLayer("lineLayer"); |
| | | state.mviewer.addLayer(state.drawALineLayer); |
| | | |
| | | //如果是添加 给第一个点加入图标 和事件 |
| | | if (value[1]) { |
| | | commit("removerPolyLineIcon"); |
| | | state.drawALineLayerIcon = new global.DC.VectorLayer("pointLayer"); |
| | | state.mviewer.addLayer(state.drawALineLayerIcon); |
| | | let post = Str.split(";")[0].split(","); |
| | | let position = new global.DC.Position(post[0], post[1]); |
| | | let billboard = new global.DC.Billboard( |
| | | position, |
| | | "img/dingwei/dingwei1.png" |
| | | ); //加入绘画点 |
| | | billboard.setStyle({ |
| | | pixelOffset: { x: 0, y: -17 }, //偏移像素 |
| | | }); |
| | | //订阅事件 |
| | | billboard.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | // console.log(e); |
| | | // return; |
| | | // 定制化窗体 |
| | | let position = e.position, |
| | | lntLat = [e.overlay._position._lng, e.overlay._position._lat]; |
| | | let windowData = { |
| | | position, |
| | | lntLat, |
| | | query: { ...(value[1] || {}), position, lntLat }, |
| | | useJWD: true, //仅使用经纬度 |
| | | }; |
| | | dispatch("setMobileWindows", windowData); |
| | | }); |
| | | state.drawALineLayerIcon.addOverlay(billboard); |
| | | } |
| | | let polyline = new global.DC.Polyline(Str); //加入线 |
| | | polyline.setStyle({ |
| | | width: 3, |
| | | material: material, |
| | | clampToGround: true, |
| | | }); |
| | | drawALineLayer.addOverlay(polyline); |
| | | //如果是添加 给第一个点加入图标 和事件 |
| | | // if (value[1]) { |
| | | // let post = Str.split(";")[0].split(","); |
| | | // let position = new global.DC.Position(post[0], post[1]); |
| | | // let billboard = new global.DC.Billboard( |
| | | // position, |
| | | // "img/dingwei/dingwei4.png" |
| | | // ); //加入绘画点 |
| | | // billboard.setStyle({ |
| | | // pixelOffset: { x: 0, y: -17 }, //偏移像素 |
| | | // }); |
| | | // //订阅事件 |
| | | // billboard.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | // // console.log(e); |
| | | // // return; |
| | | // // 定制化窗体 |
| | | // let position = e.position, |
| | | // lntLat = [e.overlay._position._lng, e.overlay._position._lat]; |
| | | // let windowData = { |
| | | // position, |
| | | // lntLat, |
| | | // query: { ...(value[1] || {}), position, lntLat }, |
| | | // useJWD: true, //仅使用经纬度 |
| | | // }; |
| | | // dispatch("setMobileWindows", windowData); |
| | | // }); |
| | | // drawALineLayer.addOverlay(billboard); |
| | | // } |
| | | state.drawALineLayer.addOverlay(polyline); |
| | | |
| | | state.drawALineLayer = drawALineLayer; |
| | | state.isOpenDrawALine = true; |
| | | // commit("cameraSetView", state.navigationStartLngLat); //移动 |
| | | }, |
| | |
| | | image: "img/icon/right.png", |
| | | repeat: { x: 320, y: 1 }, |
| | | }); |
| | | let drawALineLayerMany = new global.DC.VectorLayer("layer"); |
| | | let drawALineLayerMany = new global.DC.VectorLayer("manyLinePointLayer"); |
| | | state.mviewer.addLayer(drawALineLayerMany); |
| | | //多条线 |
| | | for (let k in Strs) { |