| | |
| | | <template> |
| | | <el-row class="wrap"> |
| | | <el-col span="2"> |
| | | <!-- <div class="p-events-auto"> |
| | | <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | @click="previousGrid" |
| | | > |
| | | 上一个 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | class="el-button-custom" |
| | | size="small" |
| | | @click="nextGrid" |
| | | > |
| | | 下一个 |
| | | </el-button> |
| | | </div> --> |
| | | <el-row> |
| | | <SatelliteManage |
| | | v-show="show" |
| | |
| | | import marks from '@/utils/map/marks'; |
| | | import grid from '@/utils/map/grid'; |
| | | |
| | | import { ref } from 'vue'; |
| | | import { ref, onMounted } from 'vue'; |
| | | import gridApi from '@/api/gridApi'; |
| | | import SatelliteManage from './component/SatelliteManage.vue'; |
| | | import SatelliteDataMix from './component/SatelliteDataMix.vue'; |
| | |
| | | import { useFetchData } from '@/composables/fetchData'; |
| | | import { useSatelliteGridStore } from '@/stores/satellite-grid'; |
| | | |
| | | // onMounted(() => { |
| | | // initDistrict(); |
| | | // }); |
| | | // 查询长宁区行政区划 |
| | | let polygon; |
| | | function initDistrict() { |
| | | onMapMounted(() => { |
| | | if (polygon) { |
| | | map.remove(polygon); |
| | | map.add(polygon); |
| | | map.setFitView(); |
| | | return |
| | | } |
| | | // eslint-disable-next-line no-undef |
| | | var district = new AMap.DistrictSearch({ |
| | | extensions: 'all', //返回行政区边界坐标等具体信息 |
| | |
| | | for (var i = 0; i < bounds.length; i++) { |
| | | //生成行政区划 polygon |
| | | // eslint-disable-next-line no-undef |
| | | var polygon = new AMap.Polygon({ |
| | | polygon = new AMap.Polygon({ |
| | | map: map, //显示该覆盖物的地图对象 |
| | | strokeWeight: 3, //轮廓线宽度 |
| | | path: bounds[i], //多边形轮廓线的节点坐标数组 |
| | |
| | | // 查询网格信息和遥感数据组 |
| | | function onSearch(options) { |
| | | satelliteGridStore.fetchGridCell(options.id).then(() => { |
| | | SatelliteProxy.clearText(mapViews); |
| | | drawGrid(satelliteGridStore.gridInfo); |
| | | initDistrict(); |
| | | initDistrict() |
| | | }); |
| | | satelliteGridStore.fetchGridData(options.id).then(() => { |
| | | max = satelliteGridStore.gridDataList.length; |
| | |
| | | function drawGrid(gridInfo) { |
| | | SatelliteProxy.clearAll(mapViews); |
| | | mapViews = SatelliteProxy.drawPolyline(gridInfo); |
| | | // mapViews = SatelliteProxy.drawPolyline([gridInfo[0]]); |
| | | } |
| | | |
| | | let index = 0; |
| | | function previousGrid() { |
| | | index--; |
| | | if (index < 0) { |
| | | index = 0; |
| | | } |
| | | SatelliteProxy.clearAll(mapViews); |
| | | mapViews = SatelliteProxy.drawPolyline([satelliteGridStore.gridInfo[index]]); |
| | | } |
| | | |
| | | function nextGrid() { |
| | | index++; |
| | | if (index > satelliteGridStore.gridInfo.length - 1) { |
| | | index = satelliteGridStore.gridInfo.length - 1; |
| | | } |
| | | SatelliteProxy.clearAll(mapViews); |
| | | mapViews = SatelliteProxy.drawPolyline([satelliteGridStore.gridInfo[index]]); |
| | | } |
| | | |
| | | // 绘制网格遥感数据值和网格颜色 |
| | | function drawTextAndColor(gridData) { |
| | | // SatelliteProxy.clearText(mapViews); |
| | | // 文本标记 |
| | | const { textViews: dataTxt, labelsLayer: dataLayer } = |
| | | SatelliteProxy.drawDataText( |