|
|
@ -60,13 +60,13 @@ function Map (props) { |
|
|
|
} |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (!delay && alarmList?.length > 0 && emergencyList['xfjy']) { |
|
|
|
if (!delay && (alarmList?.length > 0 || emergencyList['xfjy'])) { |
|
|
|
map.clearMap() |
|
|
|
map && renderMarkers() |
|
|
|
map && renderAlarms() |
|
|
|
setMapInitFit() |
|
|
|
} |
|
|
|
}, [delay, alarmList, emergencyList]) |
|
|
|
}, [delay, alarmList, emergencyList, propTab]) |
|
|
|
|
|
|
|
const renderMarkers = () => { |
|
|
|
const data = emergencyList['xfjy'] |
|
|
@ -219,11 +219,8 @@ function Map (props) { |
|
|
|
if (result.routes && result.routes.length) { |
|
|
|
// 绘制第一条路线,也可以按需求绘制其它几条路线
|
|
|
|
drawRoute(result.routes[0]) |
|
|
|
props.routeCallback({ routes: result.routes[0] }) |
|
|
|
|
|
|
|
props.alarmOk({ |
|
|
|
alarmInfo: { ...alarmInfo, routes: result.routes[0] }, |
|
|
|
rescueInfo: rescueInfo |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
} |
|
|
@ -300,7 +297,8 @@ function Map (props) { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div className='alarm_confirm'> |
|
|
|
{ |
|
|
|
propTab == 'overview' && <div className='alarm_confirm'> |
|
|
|
<div className='hande_button' |
|
|
|
onClick={() => { |
|
|
|
map.clearInfoWindow(); |
|
|
@ -314,10 +312,18 @@ function Map (props) { |
|
|
|
)) |
|
|
|
const location = list[0]?.location |
|
|
|
drawDrivings([x.longitude, x.latitude], location.split(','), x, list[0]) |
|
|
|
|
|
|
|
props.alarmOk({ |
|
|
|
alarmInfo: { ...x }, |
|
|
|
rescueInfo: list[0] |
|
|
|
}) |
|
|
|
setTimeout(() => { |
|
|
|
drawDrivings([x.longitude, x.latitude], location.split(','), x, list[0]) |
|
|
|
}, 200); |
|
|
|
} |
|
|
|
}} |
|
|
|
>一键护航</div> |
|
|
|
</div> |
|
|
|
</div>} |
|
|
|
</div>, |
|
|
|
document.getElementById(`alarmcontentid${x.location}`)); |
|
|
|
} |
|
|
|