| | |
| | | const shouldWaitArrivedDirection = deps.tripStatus === TripStatus.ArrivedDestination && !deps.arrivedMarkerReady; |
| | | const effectiveShowCar = deps.statusRule.showCar && !shouldWaitArrivedDirection; |
| | | const carMarker = createCarMarker(); |
| | | const currentCarMarker = markersRef.current.find((item: any) => item.id === deps.vehicleMarkerId); |
| | | const nextMarkers: any[] = []; |
| | | if (deps.statusRule.showPickup && pickupMarker) nextMarkers.push(pickupMarker); |
| | | if (effectiveShowCar && carMarker) nextMarkers.push(carMarker); |
| | |
| | | const nextMarkersSignature = buildMarkersSignature(nextMarkers, deps.vehicleMarkerId, shouldUsePureTranslateCarMarker); |
| | | const hasDropoffMarker = markersRef.current.some((m: any) => m.id === 2); |
| | | const shouldHoldMarkerByTranslate = [TripStatus.VehicleApproaching, TripStatus.InService].includes(deps.tripStatus) && carMarkerInitialized.current && deps.statusRule.showCar && (!deps.statusRule.showDropoff || hasDropoffMarker); |
| | | const shouldSkipUpdate = shouldHoldMarkerByTranslate && (deps.isAndroid || tripStatus6MarkerRefreshedRef.current); |
| | | const shouldRefreshInServiceRotate = deps.tripStatus === TripStatus.InService |
| | | && !!carMarker |
| | | && !!currentCarMarker |
| | | && currentCarMarker.rotate !== carMarker.rotate; |
| | | const shouldSkipUpdate = !shouldRefreshInServiceRotate |
| | | && shouldHoldMarkerByTranslate |
| | | && (deps.isAndroid || tripStatus6MarkerRefreshedRef.current); |
| | | if (deps.tripStatus === TripStatus.InService && carMarker) { |
| | | console.log('[开始行程][送驾方向][Marker]', { |
| | | 车辆方向: deps.vehicleDirection, |
| | | 当前Marker角度: currentCarMarker?.rotate, |
| | | 下一次Marker角度: carMarker.rotate, |
| | | 是否触发角度刷新: shouldRefreshInServiceRotate, |
| | | 是否跳过Marker更新: shouldSkipUpdate, |
| | | 车辆位置: deps.vehicleLocation, |
| | | 车辆标记ID: deps.vehicleMarkerId, |
| | | }); |
| | | } |
| | | applyMarkerState(nextMarkers, nextMarkersSignature, shouldSkipUpdate, carMarker); |
| | | }, [deps.tripStatus, deps.startSite?.name, deps.startSite?.latitude, deps.startSite?.longitude, deps.endSite?.name, deps.endSite?.latitude, deps.endSite?.longitude, deps.beforeUserEndSite?.latitude, deps.beforeUserEndSite?.longitude, deps.vehicleLocation, deps.vehicleDirection, deps.vehicleMarkerId, deps.isAndroid, deps.statusRule.showPickup, deps.statusRule.showCar, deps.statusRule.showDropoff]); |
| | | |