| | |
| | | class="el-button-custom p-events-auto" |
| | | > |
| | | 场景标注 |
| | | <el-icon class="el-icon--right"><arrow-down /></el-icon> |
| | | </el-button> |
| | | </template> |
| | | <OptionLocation v-model="districtCode"></OptionLocation> |
| | |
| | | v-for="item in options" |
| | | :key="item.label" |
| | | :value="item.value" |
| | | :disabled="item.disabled" |
| | | >{{ item.label }}</el-checkbox |
| | | > |
| | | </div> |
| | |
| | | import sceneInfoApi from '@/api/sceneInfoApi'; |
| | | import marks from '@/utils/map/marks'; |
| | | import MapUtil from '@/utils/map/util'; |
| | | import { useToolboxStore } from '@/stores/toolbox'; |
| | | import { mapStores } from 'pinia'; |
| | | |
| | | const lableMarkMap = new Map(); |
| | | |
| | |
| | | options: sceneTypes(), |
| | | sceneMap: new Map() |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapStores(useToolboxStore) |
| | | }, |
| | | watch: { |
| | | // 当切换区县时,清空所有选项 |
| | | districtCode(nV, oV) { |
| | | if (nV != oV) { |
| | | this.toolboxStore.selectedDistrict = nV; |
| | | this.handelCheckAllChange(false); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | fetchScene(sceneType) { |
| | |
| | | |
| | | // 根据选项,将未打开的图层开启 |
| | | types.forEach((t) => { |
| | | if (!lableMarkMap.has(t)) { |
| | | const key = this.districtCode + t; |
| | | if (!lableMarkMap.has(key)) { |
| | | this.fetchScene(t).then((res) => { |
| | | const layer = marks.createLabelMarks(sceneIcon(t), res); |
| | | lableMarkMap.set(t, { show: true, layer }); |
| | | lableMarkMap.set(key, { show: true, layer }); |
| | | }); |
| | | } else { |
| | | const m = lableMarkMap.get(t); |
| | | const m = lableMarkMap.get(key); |
| | | if (!m.show) { |
| | | MapUtil.addViews(m.layer); |
| | | m.show = true; |
| | |
| | | |
| | | // 根据选项,将开启中的未选中图层关闭 |
| | | for (const [key, value] of lableMarkMap) { |
| | | if (!types.includes(key)) { |
| | | if (!types.map((t) => this.districtCode + t).includes(key)) { |
| | | if (value.show) { |
| | | MapUtil.removeViews(value.layer); |
| | | value.show = false; |