From 0f3db8b232b0dbad5cb64bb4d839c42211f0cd49 Mon Sep 17 00:00:00 2001 From: yms Date: Wed, 4 Dec 2024 20:01:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.ts | 6 +- src/components/BMapView/index.tsx | 40 ++--- .../modals/DistrictIndex/StreetMap/index.tsx | 2 +- .../components/Map/index.tsx | 139 +++++++++--------- 4 files changed, 92 insertions(+), 95 deletions(-) diff --git a/config/config.ts b/config/config.ts index 4997af40..c2f8a6ed 100644 --- a/config/config.ts +++ b/config/config.ts @@ -37,9 +37,9 @@ export default defineConfig({ ? 'http://10.1.214.174:8090/example/CooGL/CooGL.js' : 'http://123.157.223.158:30010/CooGL/version/v1.4/CooGL.js', }, - { - src: '//api.map.baidu.com/api?type=webgl&v=1.0&ak=U5XoaKW8QCNaROPQ96oh5a7NlVP9N4hW"', - }, + // { + // src: '//api.map.baidu.com/api?type=webgl&v=1.0&ak=U5XoaKW8QCNaROPQ96oh5a7NlVP9N4hW"', + // }, ], base: '/cd-comprehensive/', publicPath: '/cd-comprehensive/', diff --git a/src/components/BMapView/index.tsx b/src/components/BMapView/index.tsx index 4be926bd..b8caf1ea 100644 --- a/src/components/BMapView/index.tsx +++ b/src/components/BMapView/index.tsx @@ -1,23 +1,23 @@ -import { forwardRef, PropsWithChildren } from 'react'; -import { Map } from 'react-bmapgl'; -import type { MapProps } from 'react-bmapgl/dist/Map/Map'; -import mapStyle from './mapStyle.json'; +// import { forwardRef, PropsWithChildren } from 'react'; +// import { Map } from 'react-bmapgl'; +// import type { MapProps } from 'react-bmapgl/dist/Map/Map'; +// import mapStyle from './mapStyle.json'; -interface PropsType extends MapProps {} +// interface PropsType extends MapProps {} -/** 封装地图 */ -const MapView = forwardRef>((props, ref) => { - const { children, ...reset } = props; - return ( - - {children} - - ); -}); +// /** 封装地图 */ +// const MapView = forwardRef>((props, ref) => { +// const { children, ...reset } = props; +// return ( +// +// {children} +// +// ); +// }); -export default MapView; +// export default MapView; diff --git a/src/pages/GlobalModalServices/modals/DistrictIndex/StreetMap/index.tsx b/src/pages/GlobalModalServices/modals/DistrictIndex/StreetMap/index.tsx index be79867e..fc393c80 100644 --- a/src/pages/GlobalModalServices/modals/DistrictIndex/StreetMap/index.tsx +++ b/src/pages/GlobalModalServices/modals/DistrictIndex/StreetMap/index.tsx @@ -16,7 +16,7 @@ import React, { useRef, useState, } from 'react'; -import { CustomOverlay, Polygon, Polyline } from 'react-bmapgl'; +// import { CustomOverlay, Polygon, Polyline } from 'react-bmapgl'; import PopoverCard from '../PopoverCard'; import styles from './index.less'; diff --git a/src/pages/TheOperationOfTheDistrictCityAndCounty/components/Map/index.tsx b/src/pages/TheOperationOfTheDistrictCityAndCounty/components/Map/index.tsx index 688d65d2..0120dad2 100644 --- a/src/pages/TheOperationOfTheDistrictCityAndCounty/components/Map/index.tsx +++ b/src/pages/TheOperationOfTheDistrictCityAndCounty/components/Map/index.tsx @@ -1,11 +1,10 @@ -import BMapView from '@/components/BMapView'; +// import BMapView from '@/components/BMapView'; import CooglMap from '@/components/CooglMap'; import BMapService from '@/utils/mapService'; import { getColorByIndex } from '@/utils/ui'; import { useModel } from '@umijs/max'; import { Space, Switch } from 'antd'; import React, { CSSProperties, Fragment, useRef, useState } from 'react'; -import { CustomOverlay, Polygon } from 'react-bmapgl'; import DistrictDetailBar from '../DIstrictDetailBar'; import styles from './index.less'; @@ -37,7 +36,7 @@ const DistrictMap: React.FC = () => { return (
- {isBmap ? ( + {/* {isBmap ? ( { )} - ) : ( - - {!selectDistrict ? ( - - {areaListDto.map((item, index) => { - return ( - - ); - })} - {areaListDto.map((item, index) => { - const point = [Number(item.centerX), Number(item.centerY)]; + ) : ( */} + + {!selectDistrict ? ( + + {areaListDto.map((item, index) => { + return ( + + ); + })} + {areaListDto.map((item, index) => { + const point = [Number(item.centerX), Number(item.centerY)]; - return ( - -
- {Number(item.qualitySign)} -
-
- ); - })} -
- ) : ( - <> - +
+ {Number(item.qualitySign)} +
+ + ); + })} +
+ ) : ( + <> + + +
- -
- {Number(selectDistrict?.qualitySign)} -
-
- - )} - - )} + {Number(selectDistrict?.qualitySign)} +
+
+ + )} +
+ {/* )} */} {selectDistrict && (
{selectDistrict.objectName}
-- GitLab