From 393128c2ad3f31eba90b6190af6d15bc11c378d5 Mon Sep 17 00:00:00 2001 From: locphamtran Date: Thu, 11 Jun 2026 19:46:00 +0700 Subject: [PATCH] =?UTF-8?q?S=E1=BB=ADa=20tooltip=20c=E1=BB=A7a=20Tour=20hi?= =?UTF-8?q?=E1=BB=83n=20th=E1=BB=8B=20l=C3=A0=20t=C3=AAn=20c=E1=BB=A7a=20T?= =?UTF-8?q?our?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/js/main_map.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/js/main_map.js b/frontend/js/main_map.js index 68d9de7..25463c4 100644 --- a/frontend/js/main_map.js +++ b/frontend/js/main_map.js @@ -1005,7 +1005,10 @@ async function loadScenes(urlToken = null) { if (!assetId) return; // Bỏ qua nếu không có ảnh liên kết const sceneName = scene.name || scene.title || "Untitled Scene"; - console.log(`[Frontend] Đang thêm marker cho Scene: ${sceneName} (ID: ${scene._id}, Privacy: ${scene.privacy})`); + const tourName = (scene.tourId && typeof scene.tourId === 'object') ? scene.tourId.name : sceneName; + const tourDescription = (scene.tourId && typeof scene.tourId === 'object') ? scene.tourId.description : scene.description; + + console.log(`[Frontend] Đang thêm marker cho Tour: ${tourName} (Scene đại diện: ${sceneName})`); const isProcessing = scene.status === 'processing'; if (isProcessing) foundProcessing++; @@ -1037,15 +1040,15 @@ async function loadScenes(urlToken = null) { const marker = L.marker([latNum, lngNum], { icon: calloutIcon, - title: sceneName + title: tourName }); // Tạo nội dung thông tin khi Hover (Tooltip) const createdDate = formatSystemDate(scene.assetId?.createdAt); const tooltipContent = `
- ${sceneName}
- ${scene.description ? `${scene.description}
` : ''} + ${tourName}
+ ${tourDescription ? `${tourDescription}
` : ''} Người tạo: ${scene.createdBy ? scene.createdBy.username : 'Ẩn danh'}
Ngày tạo: ${createdDate}