| | |
| | | const lines: any[] = []; |
| | | |
| | | // 如果有多条路线且在未发单状态或修改目的地状态(allowSelectableRoutes === true),渲染所有路线 |
| | | if (deps.allowSelectableRoutes && allRoutePoints.length > 1) { |
| | | if (deps.shouldShowRoute && deps.allowSelectableRoutes && allRoutePoints.length > 1) { |
| | | allRoutePoints.forEach((points, index) => { |
| | | if (!points || points.length === 0) return; |
| | | |
| | |
| | | arrowLine: true, |
| | | }); |
| | | } |
| | | } else if (displayRoutePoints.length > 0) { |
| | | } else if (deps.shouldShowRoute && displayRoutePoints.length > 0) { |
| | | // 只有一条路线或非 tripStatus=1 的情况 |
| | | lines.push({ |
| | | id: 2001, |
| | |
| | | const nextKey = buildPolylineKey(displayRoutePoints); |
| | | if (nextKey === polylineKeyRef.current) return; |
| | | polylineKeyRef.current = nextKey; |
| | | const shouldDraw = deps.shouldShowRoute && (displayRoutePoints.length > 0 || (deps.statusRule.showWalking && walkingPoints.length > 0)); |
| | | const shouldDrawRoute = deps.shouldShowRoute && displayRoutePoints.length > 0; |
| | | const shouldDrawWalking = deps.statusRule.showWalking && walkingPoints.length > 0; |
| | | const shouldDraw = shouldDrawRoute || shouldDrawWalking; |
| | | if (shouldDraw) { |
| | | setPolyline(buildPolylineLines(displayRoutePoints)); |
| | | lastPolylineUpdateAtRef.current = Date.now(); |