| | |
| | | |
| | | global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, that.mouseMoveEvent) |
| | | |
| | | // 房屋轮廓对应的点击事件 |
| | | global.viewer.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | if (that.closeMapClick) { |
| | | return |
| | |
| | | }) |
| | | }, |
| | | |
| | | // 加载房屋轮廓服务地址 |
| | | createdLayers () { |
| | | layerGroup = new global.DC.LayerGroup('modelBox') |
| | | global.viewer.addLayerGroup(layerGroup) |
| | | |
| | | DefaultAreaLayer = new global.DC.VectorLayer('DefaultAreaLayer') |
| | | layerGroup.addLayer(DefaultAreaLayer) |
| | | |
| | | axios |
| | | .get( |
| | | 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/lxxqwxq/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson' |
| | | 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/shidalk/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson' |
| | | ) |
| | | .then((resultData) => { |
| | | resultData.data.features.forEach((item) => { |
| | |
| | | if (newData == '三 维') { |
| | | if (ourLayer != null) { |
| | | ourLayer.eachOverlay((item) => { |
| | | item.position = new global.DC.Position(Number(item.position.lng), Number(item.position.lat), 0) |
| | | const position = this.coordinate(item.attrParam.x) |
| | | |
| | | item.position = new global.DC.Position(Number(position.lng), Number(position.lat), 0) |
| | | }) |
| | | } |
| | | } else { |
| | | if (ourLayer != null) { |
| | | ourLayer.eachOverlay((item) => { |
| | | item.position = new global.DC.Position(Number(item.position.lng), Number(item.position.lat), 50) |
| | | item.position = new global.DC.Position(Number(item.attrParam.jd), Number(item.attrParam.wd), 50) |
| | | }) |
| | | } |
| | | } |
| | |
| | | }, |
| | | mounted () { }, |
| | | methods: { |
| | | coordinate (item) { |
| | | const arr = item.split(',') |
| | | |
| | | return { |
| | | lng: arr[0], |
| | | lat: arr[1] |
| | | } |
| | | }, |
| | | closeModel () { |
| | | this.$parent.closeModel() |
| | | }, |
| | |
| | | }) |
| | | }, |
| | | addDivIcon (item, mylayer) { |
| | | let obj = {} |
| | | |
| | | if (item.x && item.x != '') { |
| | | const position = this.coordinate(item.x) |
| | | obj = { |
| | | lng: position.lng, lat: position.lat |
| | | } |
| | | } else { |
| | | obj = { |
| | | lng: item.jd, lat: item.wd |
| | | } |
| | | } |
| | | const that = this |
| | | |
| | | let divIcon = null |
| | | |
| | | if (this.twoOrThree == '三 维') { |
| | | divIcon = new global.DC.DivIcon( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), 0), |
| | | ` |
| | | <div class="tag-entitys-box"> |
| | | <div class="tag-content"> |
| | |
| | | ) |
| | | } |
| | | |
| | | divIcon.attrParam = item |
| | | |
| | | // 订阅事件 |
| | | divIcon.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | // console.log(item, "see"); |
| | |
| | | mylayer.addOverlay(divIcon) |
| | | }, |
| | | mapPopup (param) { |
| | | let obj = {} |
| | | |
| | | if (param.x && param.x != '') { |
| | | const position = this.coordinate(param.x) |
| | | obj = { |
| | | lng: position.lng, lat: position.lat |
| | | } |
| | | } else { |
| | | obj = { |
| | | lng: param.jd, lat: param.wd |
| | | } |
| | | } |
| | | var result = param |
| | | this.$store.commit('CLEAR_ALL', null) |
| | | |
| | |
| | | |
| | | this.$store.commit('SET_POPUPBGURL', imgArr[0]) |
| | | this.$store.commit('SET_POPUPQRURL', result.codeurl) |
| | | this.$store.commit('SET_POINTPOSITION', [ |
| | | Number(result.jd), |
| | | Number(result.wd), |
| | | Number(result.gd), |
| | | Number(result.heading), |
| | | Number(result.pitch), |
| | | Number(result.roll) |
| | | ]) |
| | | |
| | | this.$store.commit('SET_STATENAME', result.mechanismname) |
| | | this.$store.commit('SET_SITENAME', result.address) |
| | | this.$store.commit('SET_TELEPHONE', result.telephone) |
| | |
| | | this.$store.commit('SET_MONITORURL', result.videourl) |
| | | } |
| | | |
| | | this.newPopup(result) |
| | | this.newPopup(result, obj) |
| | | |
| | | if (this.twoOrThree == '三 维') { |
| | | this.$store.commit('SET_POINTPOSITION', [ |
| | | Number(obj.lng), |
| | | Number(obj.lat), |
| | | Number(result.gd), |
| | | Number(result.heading), |
| | | Number(result.pitch), |
| | | Number(result.roll) |
| | | ]) |
| | | |
| | | global.viewer.flyToPosition( |
| | | new global.DC.Position( |
| | | Number(obj.lng), |
| | | Number(obj.lat), |
| | | 300, |
| | | Number(result.heading), |
| | | Number(result.pitch), |
| | | Number(result.roll) |
| | | ), |
| | | function () { }, |
| | | 3 |
| | | ) |
| | | } else { |
| | | this.$store.commit('SET_POINTPOSITION', [ |
| | | Number(result.jd), |
| | | Number(result.wd), |
| | | Number(result.gd), |
| | | Number(result.heading), |
| | | Number(result.pitch), |
| | | Number(result.roll) |
| | | ]) |
| | | |
| | | global.viewer.flyToPosition( |
| | | new global.DC.Position( |
| | | Number(result.jd), |
| | |
| | | function () { }, |
| | | 3 |
| | | ) |
| | | } |
| | | }, |
| | | newPopup (item) { |
| | | const position = global.DC.Transform.transformWGS84ToCartesian( |
| | | newPopup (item, obj) { |
| | | let position |
| | | if (this.twoOrThree == '三 维') { |
| | | position = global.DC.Transform.transformWGS84ToCartesian( |
| | | new global.DC.Position(Number(obj.lng), Number(obj.lat), Number(item.gd)) |
| | | ) |
| | | } else { |
| | | position = global.DC.Transform.transformWGS84ToCartesian( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), Number(item.gd)) |
| | | ) |
| | | } |
| | | |
| | | // eslint-disable-next-line no-unused-vars |
| | | var popup = new global.DC.DivForms(global.viewer, { |
| | | domId: 'divFormsDomBox', |