| | |
| | | }; |
| | | |
| | | // 计算 includePoints 使用的底部 padding |
| | | const computeBottomPadding = useCallback((points: any[], viewportType: string) => { |
| | | const basePadding = viewportType === 'order_detail' ? Math.max(200, mapBottomPadding) : mapBottomPadding; |
| | | const computeBottomPadding = useCallback((points: any[], viewportType: string, tripStatus: TripStatus) => { |
| | | let basePadding = viewportType === 'order_detail' ? Math.max(200, mapBottomPadding) : mapBottomPadding; |
| | | if(tripStatus === TripStatus.VehicleApproaching) { |
| | | // 车辆接驾时,底部卡片里面有空调按钮,卡片会比较高,做一下兜底 |
| | | basePadding += basePadding < 300 ? 48 : 32 |
| | | } |
| | | return computeAdaptiveBottomPadding(points, basePadding); |
| | | }, [mapBottomPadding]); |
| | | |
| | |
| | | return d.toFixed(0) + 'm'; |
| | | } |
| | | |
| | | /** |
| | | * 背景:这个方法是让ai写的[新月脸] 当时是因为全览路线时下面老是会被卡片挡住 所以加的这个方法 |
| | | * 搞不懂为什么要这么做 |
| | | */ |
| | | export const computeAdaptiveBottomPadding = ( |
| | | points: any[], |
| | | basePadding: number, |