mayisheng
2022-08-11 3f2090824cbb38a846e4f3037efb323b8c176418
修改标签错乱等问题
3 files modified
104 ■■■■ changed files
src/api/pc/public/arc.js patch | view | raw | blame | history
src/components/map/components/dimension.vue 5 ●●●● patch | view | raw | blame | history
src/components/serviceNavBar/index.vue 99 ●●●● patch | view | raw | blame | history
src/api/pc/public/arc.js
src/components/map/components/dimension.vue
@@ -383,6 +383,7 @@
                    global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, that.mouseMoveEvent)
                    // 房屋轮廓对应的点击事件
                    global.viewer.on(global.DC.MouseEventType.CLICK, (e) => {
                        if (that.closeMapClick) {
                            return
@@ -873,15 +874,17 @@
            })
        },
        // 加载房屋轮廓服务地址
        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) => {
src/components/serviceNavBar/index.vue
@@ -97,13 +97,15 @@
                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)
                        })
                    }
                }
@@ -113,6 +115,14 @@
    },
    mounted () { },
    methods: {
        coordinate (item) {
            const arr = item.split(',')
            return {
                lng: arr[0],
                lat: arr[1]
            }
        },
        closeModel () {
            this.$parent.closeModel()
        },
@@ -151,13 +161,25 @@
            })
        },
        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">
@@ -185,6 +207,8 @@
                )
            }
            divIcon.attrParam = item
            // 订阅事件
            divIcon.on(global.DC.MouseEventType.CLICK, (e) => {
                // console.log(item, "see");
@@ -198,6 +222,18 @@
            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)
@@ -205,14 +241,7 @@
            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)
@@ -224,7 +253,40 @@
                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),
@@ -237,11 +299,20 @@
                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',