| | |
| | | import { useSatelliteGridStore } from '@/stores/satellite-grid'; |
| | | |
| | | // 查询长宁区行政区划 |
| | | onMapMounted(()=>{ |
| | | // eslint-disable-next-line no-undef |
| | | var district = new AMap.DistrictSearch({ |
| | | extensions: "all", //返回行政区边界坐标等具体信息 |
| | | level: "district", //设置查询行政区级别为区 |
| | | }); |
| | | district.search("长宁区", function (status, result) { |
| | | var bounds = result.districtList[0].boundaries; //获取朝阳区的边界信息 |
| | | if (bounds) { |
| | | for (var i = 0; i < bounds.length; i++) { |
| | | //生成行政区划 polygon |
| | | // eslint-disable-next-line no-undef |
| | | var polygon = new AMap.Polygon({ |
| | | map: map, //显示该覆盖物的地图对象 |
| | | strokeWeight: 3, //轮廓线宽度 |
| | | path: bounds[i], //多边形轮廓线的节点坐标数组 |
| | | fillOpacity: 0.1, //多边形填充透明度 |
| | | fillColor: "#CCF3FF", //多边形填充颜色 |
| | | // strokeColor: "#CC66CC", //线条颜色 |
| | | strokeColor: "#0066ff", //线条颜色 |
| | | }); |
| | | function initDistrict() { |
| | | onMapMounted(() => { |
| | | // eslint-disable-next-line no-undef |
| | | var district = new AMap.DistrictSearch({ |
| | | extensions: 'all', //返回行政区边界坐标等具体信息 |
| | | level: 'district' //设置查询行政区级别为区 |
| | | }); |
| | | district.search('长宁区', function (status, result) { |
| | | var bounds = result.districtList[0].boundaries; //获取朝阳区的边界信息 |
| | | if (bounds) { |
| | | for (var i = 0; i < bounds.length; i++) { |
| | | //生成行政区划 polygon |
| | | // eslint-disable-next-line no-undef |
| | | var polygon = new AMap.Polygon({ |
| | | map: map, //显示该覆盖物的地图对象 |
| | | strokeWeight: 3, //轮廓线宽度 |
| | | path: bounds[i], //多边形轮廓线的节点坐标数组 |
| | | fillOpacity: 0.1, //多边形填充透明度 |
| | | fillColor: '#CCF3FF', //多边形填充颜色 |
| | | // strokeColor: '#ffffff' //线条颜色 |
| | | strokeColor: '#0077ff' //线条颜色 |
| | | }); |
| | | } |
| | | map.setFitView(); //将覆盖物调整到合适视野 |
| | | } |
| | | map.setFitView(); //将覆盖物调整到合适视野 |
| | | } |
| | | }); |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | const satelliteGridStore = useSatelliteGridStore(); |
| | | const { loading, fetchData } = useFetchData(10000); |
| | |
| | | function onSearch(options) { |
| | | satelliteGridStore.fetchGridCell(options.id).then(() => { |
| | | drawGrid(satelliteGridStore.gridInfo); |
| | | initDistrict(); |
| | | }); |
| | | satelliteGridStore.fetchGridData(options.id).then(()=>{ |
| | | max = satelliteGridStore.gridDataList.length |
| | | fetchGridDataDetail(satelliteGridStore.gridDataList) |
| | | satelliteGridStore.fetchGridData(options.id).then(() => { |
| | | max = satelliteGridStore.gridDataList.length; |
| | | // fetchGridDataDetail(satelliteGridStore.gridDataList); |
| | | }); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | function handleRankClick(rankVisible) { |
| | | rankVisible ? map.add(mapViews.rankLayer) : map.remove(mapViews.rankLayer); |
| | | // rankVisible ? map.add(mapViews.rankLayer) : map.remove(mapViews.rankLayer); |
| | | rankVisible ? map.add(mapViews.rankTxt) : map.remove(mapViews.rankTxt); |
| | | } |
| | | |
| | | function handleDataClick(dataVisible) { |
| | | dataVisible ? map.add(mapViews.dataLayer) : map.remove(mapViews.dataLayer); |
| | | // dataVisible ? map.add(mapViews.dataLayer) : map.remove(mapViews.dataLayer); |
| | | dataVisible ? map.add(mapViews.dataTxt) : map.remove(mapViews.dataTxt); |
| | | } |
| | | |
| | | function handleColorClick(isStandardColor) { |
| | |
| | | bottom: 10px; |
| | | left: 0; |
| | | right: 0; |
| | | color: #0066ff; |
| | | color: #0077ff; |
| | | } |
| | | |
| | | .data-mix { |