校园-江西科技师范大学-前端
shuishen
2023-12-05 30f4204ca6fb295d0f3d9cae41fbb4e62321beb4
src/components/map/index.vue
@@ -44,7 +44,6 @@
let architecturePolygon = null
let select = null
let campusLayers = [
    {
        key: 1,
@@ -59,7 +58,8 @@
        fullExtent: [
            112.51302281804038, -0.17416638494176828, 112.76131189483516,
            0.000004509395743004334,
        ]
        ],
        polygonUrl: 'https://fkxt.jxstnu.edu.cn/changjing/lkarcgisapp'
    },
    {
        key: 2,
@@ -73,7 +73,8 @@
        ],
        fullExtent: [
            115.76861782444642, 28.63584422760626, 115.82432471553928, 28.663308794331794,
        ]
        ],
        polygonUrl: ''
    }
]
@@ -159,7 +160,17 @@
                this.campusCut(newData)
                this.$nextTick(() => {
                    this.$store.commit('SET_DETAILSPOPUP', false)
                    this.$store.commit('SET_MONITORPOPUP', false)
                    this.$store.commit('SET_PANORAMAPOPUP', false)
                    this.$store.commit('SET_ARCNAVBARFLAG', false)
                    this.$store.commit('SET_SEARCHPOPUPFLAG', false)
                    this.$store.commit('SET_SEARCHPOPUPFLAG', false)
                    this.$refs.leftNav.initialize(newData)
                    this.createdLayers(newData)
                })
            }
        }
@@ -200,10 +211,6 @@
        const that = this
        this.map2D.setTarget('viewer-container')
        this.$nextTick(() => {
            this.$refs.leftNav.initialize()
            this.createdLayers()
            that.map2D.on('pointermove', that.mouseMoveEvent)
            this.map2D.on("singleclick", function (event) {
@@ -225,8 +232,13 @@
        })
    },
    methods: {
        createdLayers () {
        createdLayers (campusKey) {
            const that = this
            let curCampus = campusLayers.find(item => item.key == campusKey)
            if (architecturePolygon) {
                this.map2D.removeLayer(architecturePolygon)
            }
            architecturePolygon = new VectorLayer({
                // 图标图层
@@ -237,7 +249,7 @@
            axios
                .get(
                    'https://fkxt.jxstnu.edu.cn/changjing/lkarcgisapp?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'
                    curCampus.polygonUrl + '?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) => {