Skip to content
Snippets Groups Projects
Commit fdfd5465 authored by 1437862981's avatar 1437862981
Browse files

安全一张图图标修改

parent 7966f4b6
Branches
Tags
No related merge requests found
...@@ -210,6 +210,8 @@ const SafetyMap = () => { ...@@ -210,6 +210,8 @@ const SafetyMap = () => {
return {}; return {};
} }
}; };
return ( return (
<div className={styles.container}> <div className={styles.container}>
<div style={{ width: '100%', height: '100%' }}> <div style={{ width: '100%', height: '100%' }}>
...@@ -222,6 +224,8 @@ const SafetyMap = () => { ...@@ -222,6 +224,8 @@ const SafetyMap = () => {
<Fragment> <Fragment>
{facility?.data?.records?.map((item: any, index: number) => { {facility?.data?.records?.map((item: any, index: number) => {
const point = [Number(item?.longitude), Number(item?.latitude)]; const point = [Number(item?.longitude), Number(item?.latitude)];
return ( return (
<CooglMap.Marker <CooglMap.Marker
key={index} key={index}
......
import { useEffect, useRef, useState } from 'react'; import { useEffect, useRef } from 'react';
// import { CustomOverlay, Polygon } from 'react-bmapgl'; // import { CustomOverlay, Polygon } from 'react-bmapgl';
import CooglMap from '@/components/CooglMap'; import CooglMap from '@/components/CooglMap';
import styles from './index.less';
import { colorConfig } from '@/pages/SecurityServiceOverview/SafetyMap'; import { colorConfig } from '@/pages/SecurityServiceOverview/SafetyMap';
import styles from './index.less';
const DetMap = ({ data }: { data: any }) => { const DetMap = ({ data }: { data: any }) => {
console.log(data, '44');
const MapRef = useRef<any>(); const MapRef = useRef<any>();
// const [searchParams, setSearchParams] = useState({ useEffect(() => {
// parentTypeCode: 'dlql', if (data) {
// lat: 30.680193,
// lon: 104.075555,
// distance: 1000,
// page: 1,
// count: 100,
// });
// // 事件详情弹窗
// const [detailModalOpt, setDetailModalOpt] = useState<any>({
// open: false,
// title: '',
// eventId: '',
// });
// const [wayModalOpt, setWayModalOpt] = useState<{
// open: boolean;
// title: string;
// }>({
// open: false,
// title: '道路桥梁情况',
// });
useEffect(()=>{
if(data){
MapRef?.current?.flyTo({ MapRef?.current?.flyTo({
destination: { destination: {
x: Number(data?.longitude), x: Number(data?.longitude),
y: Number(data?.latitude), y: Number(data?.latitude),
z: 239, z: 239,
}, },
// orientation: { // orientation: {
// heading: 6.283185307179586, // heading: 6.283185307179586,
// pitch: -1.568627330287271, // pitch: -1.568627330287271,
...@@ -46,40 +23,38 @@ const DetMap = ({ data }: { data: any }) => { ...@@ -46,40 +23,38 @@ const DetMap = ({ data }: { data: any }) => {
// }, // },
}); });
} }
}, [data]);
},[data]) if (!data) {
return;
}
return ( return (
<div className={styles.container}> <div className={styles.container}>
<CooglMap.MapView
<CooglMap.MapView zoom={13}
zoom={13} ref={MapRef}
ref={MapRef} center={{ x: 104, y: 30.75 }}
center={{ x: 104, y: 30.75 }} showCustomComponent={false}
showCustomComponent={false} >
> <>
<> <CooglMap.CustomOverlay
<CooglMap.CustomOverlay position={[Number(data?.longitude), Number(data?.latitude)]}
position={[Number(data?.longitude), Number(data?.latitude)]} onSet={() => {
onSet={() => { // setDetailModalOpt({
// setDetailModalOpt({ // open: true,
// open: true, // eventId: item?.riskId,
// eventId: item?.riskId, // ...item,
// ...item, // });
// }); }}
}} >
> <img
<img data-event-key="set"
data-event-key="set" src={colorConfig[data?.risklevel!]?.icon}
src={colorConfig[data?.risklevel!]?.icon} alt=""
alt="" style={{ width: 52, height: 52, zIndex: 999 }}
style={{ width: 52, height: 52, zIndex: 999 }} />
/> </CooglMap.CustomOverlay>
</CooglMap.CustomOverlay> </>
</> </CooglMap.MapView>
</CooglMap.MapView>
</div> </div>
); );
}; };
......
...@@ -139,7 +139,10 @@ const BaseInfo: React.FC<{ ...@@ -139,7 +139,10 @@ const BaseInfo: React.FC<{
</Flex> */} </Flex> */}
</div> </div>
</div> </div>
<DetMap data={data?.data?.records?.[0]}/> <DetMap data={data?.data?.records?.[0]}/>
<div className={styles.right}> <div className={styles.right}>
<Casecirculation <Casecirculation
casecirculationRecordData={data?.recordList?.map((item: any) => ({ casecirculationRecordData={data?.recordList?.map((item: any) => ({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment