feat: nhấn nút toggle status để chuyển đến bản đồ di chuyển
This commit is contained in:
@@ -748,6 +748,18 @@ export const TourDetailPage = ({
|
||||
};
|
||||
}, [routes, selectedRouteIndex]);
|
||||
|
||||
const handleNavigateToLocation = (location: any) => {
|
||||
setViewMode('map');
|
||||
setMapCenter([location.latitude, location.longitude]);
|
||||
setLocateTrigger(prev => prev + 1);
|
||||
|
||||
notify({
|
||||
title: 'Bắt đầu chỉ đường',
|
||||
message: `Đang hiển thị lộ trình từ vị trí của bạn đến ${location.name}`,
|
||||
type: 'info'
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (initialViewState) {
|
||||
setMapCenter(initialViewState.center);
|
||||
@@ -1378,6 +1390,7 @@ export const TourDetailPage = ({
|
||||
onQuickNote={(locName: string) => handleQuickNote(locName)}
|
||||
onSuccess={() => fetchTour(tourId)}
|
||||
isPublicView={isPublicView}
|
||||
onNavigate={handleNavigateToLocation}
|
||||
/>
|
||||
) : (
|
||||
<div className="h-[60vh] w-full rounded-3xl overflow-hidden shadow-xl border-4 border-white relative">
|
||||
|
||||
Reference in New Issue
Block a user