董国庆
2026-06-09 97223815f61e6560d0b0d282cd5c5483d28edf3b
修改bug--大头针吸附到点位但是没有显示名称(从列表页回到首页复现)
1个文件已修改
16 ■■■■■ 已修改文件
src/pages/robotaxi/home/hooks/use-location-flow.ts 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/home/hooks/use-location-flow.ts
@@ -206,10 +206,20 @@
          if (cityInfo?.code) {
            const { isInside, newMarkers, sites } = await mapState.updateMapData(res.latitude, res.longitude, cityInfo.code);
            const lockedManualStartSite = forceNearestSite ? null : resolveLockedManualStartSite(cityInfo.code);
            if (lockedManualStartSite) {
              siteState.setCurrentAddress(String(lockedManualStartSite?.name || ''));
              siteState.setCurrentSite(lockedManualStartSite);
              siteState.setIsAdsorbed(true);
              siteState.setShowToolTip(true);
              onLocationSettled(
                Number(lockedManualStartSite?.latitude || res.latitude),
                Number(lockedManualStartSite?.longitude || res.longitude),
                !!isInside
              );
              return;
            }
            const nearestCandidates = sites.length > 0 ? sites : newMarkers;
            const { adsorbed, marker } = lockedManualStartSite
              ? { adsorbed: false, marker: null }
              : siteState.tryAdsorb(res.latitude, res.longitude, nearestCandidates);
            const { adsorbed, marker } = siteState.tryAdsorb(res.latitude, res.longitude, nearestCandidates);
            const finalLat = adsorbed && marker ? marker.latitude : res.latitude; // 最终纬度
            const finalLng = adsorbed && marker ? marker.longitude : res.longitude; // 最终经度
            onLocationSettled(finalLat, finalLng, !!isInside);