shuishen
2022-03-25 62f4cdbb9f714692015c3643fa453cca5bafcd00
src/pcviews/specialmap/welcome.vue
@@ -73,6 +73,16 @@
                </div>
            </div>
        </div>
        <!-- <div v-show="layerList.length > 0" class="layer-manage-container">
            <div class="header">图层管理</div>
            <ul class="content">
                <li v-for="(item, index) in layerList" :key="index">
                    {{item.name}}:
                    <el-switch v-model="item.flag" @change="switchChange(item)"></el-switch>
                </li>
            </ul>
        </div>-->
    </div>
</template>
@@ -86,6 +96,8 @@
export default {
    data () {
        return {
            url: '',
            layerList: [],
            time: '',
            sponsor: '',
            undertake: '',
@@ -155,6 +167,26 @@
        ])
    },
    methods: {
        switchChange (item) {
            if (item.flag == true) {
            } else {
            }
        },
        addArcgisLayer (url) {
            global.viewer.imageryLayers.addImageryProvider(
                new global.DC.Namespace.Cesium.ArcGisMapServerImageryProvider({
                    url: url
                })
            )
        },
        removeArcgisLayer () {
        },
        getData () {
            getWelcome({ hdname: this.urlDataName }).then((res) => {
                var result = res.data.data
@@ -172,6 +204,17 @@
                this.list = result.tpurl.split(',')
                this.pointNameList = result.addressname.split(',')
                this.pointList = result.address.split(';')
                this.layerList = []
                if (result.mapname != '' && result.mapname != null && result.mapname != undefined) {
                    var mapname = result.mapname.split(',')
                    var url = result.url.split(',')
                    mapname.forEach((item, index) => {
                        this.layerList.push({ flag: false, name: item, url: url[index] })
                    })
                    this.layerList[0].flag = true
                    this.addArcgisLayer(this.layerList[0].url)
                }
                var a = result.lx.split(';')
@@ -202,6 +245,7 @@
                this.pointList.forEach((item, index) => {
                    this.drawPoint(item.split(','), this.pointNameList[index])
                })
                if (this.pointList.length > 0) {
                    this.$store.dispatch('pcMoveView', {
                        viewer: global.viewer,
@@ -529,4 +573,28 @@
        }
    }
}
.layer-manage-container {
    padding: 0 10px 10px 10px;
    position: fixed;
    right: 10px;
    bottom: 240px;
    width: 120px;
    background: rgba(40, 187, 240, 0.7);
    border-radius: 10px;
    color: #fff;
    border: 1px solid #29baf1;
    box-shadow: 0 0 10px 2px #29baf1;
    .header {
        line-height: 36px;
        text-align: center;
    }
    .content {
        max-height: calc(180px - 36px);
        overflow-y: auto;
        text-align: center;
    }
}
</style>