校园-江西科技师范大学-前端
shuishen
2023-12-06 919596422fd359e62a8b224d1321c13d843c2fae
src/components/map/index.vue
@@ -61,6 +61,7 @@
        ],
        polygonUrl: 'https://fkxt.jxstnu.edu.cn/changjing/lkarcgisapp'
    },
    {
        key: 2,
        tileUrl: "https://dev.jxpskj.com:8023/arcgis156/rest/services/cc/MapServer/tile/{z}/{y}/{x}",
@@ -203,7 +204,8 @@
            'orgNavBarFlag',
            'arcNavBarFlag',
            'searchPopupFlag',
            'calenderShow'
            'calenderShow',
            'closeMapClick'
        ])
    },
@@ -214,14 +216,17 @@
            that.map2D.on('pointermove', that.mouseMoveEvent)
            this.map2D.on("singleclick", function (event) {
                if (that.closeMapClick) return
                let flag = true
                that.map2D.forEachFeatureAtPixel(
                    event.pixel,
                    (feature) => {
                        if (flag == false) {
                            return
                        }
                        if (feature.values_.type == 'point') {
                        if (feature.values_.type == 'point' || feature.values_.type == 'navigationPoint') {
                            flag = false
                        }
@@ -279,6 +284,8 @@
            let flag = true
            var that = this
            if (that.closeMapClick) return
            if (select != null && select.values_.type == 'polygon') {
                select.setStyle(new Style({
@@ -298,13 +305,13 @@
                        return
                    }
                    if (feature.values_.type == 'point') {
                    if (feature.values_.type == 'point' || feature.values_.type == 'navigationPoint') {
                        flag = false
                        return
                    }
                    if (select != null) {
                        if (feature != select) {
                    if (feature.values_.type == 'polygon') {
                        if (select != null && feature != select) {
                            select.setStyle(new Style({
                                fill: new Fill({
@@ -315,26 +322,27 @@
                            select = null
                        }
                        if (select == null) {
                            select = feature
                            select.setStyle(
                                new Style({
                                    fill: new Fill({
                                        color: 'rgba(108, 245, 113, 0.6)'
                                    }),
                                    stroke: new Stroke({
                                        color: 'rgba(3, 255, 13, 1)',
                                        width: 1,
                                    }),
                                })
                            )
                        }
                    }
                    if (select == null) {
                        select = feature
                        select.setStyle(
                            new Style({
                                fill: new Fill({
                                    color: 'rgba(108, 245, 113, 0.6)'
                                }),
                                stroke: new Stroke({
                                    color: 'rgba(3, 255, 13, 1)',
                                    width: 1,
                                }),
                            })
                        )
                    }
                }
            )
        },