| | |
| | | |
| | | let overlayLayer |
| | | |
| | | let pathUrl = [ |
| | | { |
| | | key: 1, |
| | | url: "https://fkxt.jxstnu.edu.cn/changjing/arcgis155/rest/services/hjzlw/NAServer/%E8%B7%AF%E5%BE%84/solve", |
| | | }, |
| | | { |
| | | key: 2, |
| | | url: "https://fkxt.jxstnu.edu.cn/changjing/arcgis155/rest/services/fllw/NAServer/%E8%B7%AF%E5%BE%84/solve", |
| | | } |
| | | ] |
| | | |
| | | export default { |
| | | name: 'campusNav', |
| | | data () { |
| | |
| | | this.pathBoxList = [] |
| | | this.pathBoxShow = false |
| | | |
| | | if (CamPusNavLayer.campusStartLayer != null) { |
| | | CamPusNavLayer.campusStartLayer.getSource().clear() |
| | | } |
| | | |
| | | if (CamPusNavLayer.campusEndLayer != null) { |
| | | CamPusNavLayer.campusEndLayer.getSource().clear() |
| | | } |
| | | |
| | | if (CamPusNavLayer.campusRouteLayer != null) { |
| | | CamPusNavLayer.campusRouteLayer.getSource().clear() |
| | | this.isOverRouter = false |
| | |
| | | this.$store.commit('SET_GETTONAME', '') |
| | | this.$store.commit('SET_STARTINGPOINT', null) |
| | | this.$store.commit('SET_CAMPUSNAVFLAG', false) |
| | | that.$store.commit('set_closeMapClick', false) |
| | | this.$store.commit('set_closeMapClick', false) |
| | | }, |
| | | |
| | | tabClick (param) { |
| | |
| | | })) |
| | | |
| | | var routes = '' |
| | | |
| | | let curPath = pathUrl.find(item => item.key == this.layoutElement.campusValue) |
| | | |
| | | var startLog = Number(this.startingPoint[0]).toFixed(6) |
| | | var startLat = Number(this.startingPoint[1]).toFixed(6) |
| | |
| | | } else { |
| | | if (this.navigationWay == '步行') { |
| | | axios |
| | | .get('https://dev.jxpskj.com:8023/arcgis/rest/services/jglw/NAServer/%E8%B7%AF%E5%BE%84/solve', { |
| | | .get(curPath.url, { |
| | | params: { |
| | | stops: { features: [{ geometry: { x: startLog, y: startLat } }, { geometry: { x: endLog, y: endLat } }] }, |
| | | returnDirections: false, |
| | |
| | | |
| | | this.pathBoxList = [] |
| | | |
| | | res.data.routes.features[0].geometry.paths[0].forEach((item) => { |
| | | routes += `${item[0]},${item[1]};` |
| | | let polyLineData = res.data.routes.features[0].geometry.paths[0].map(item => { |
| | | return [item[0], item[1]] |
| | | }) |
| | | |
| | | this.pathBoxShow = true |
| | | |
| | | routes = |
| | | startLog + ',' + startLat + ';' + routes + endLog + ',' + endLat |
| | | |
| | | CamPusNavLayer.campusRouteLayer.getSource().addFeature(that.drawPolyline(routes)) |
| | | CamPusNavLayer.campusRouteLayer.getSource().addFeature(that.drawPolyline(polyLineData)) |
| | | |
| | | if (this.twoOrThree == '真三维') { |
| | | global.viewer.flyTo(CamPusNavLayer.campusRouteLayer) |