Skip to content

Commit c2c8f2a

Browse files
committed
スポット詳細にGoogleの画像検索を足す
Googleの並び(マップ・経路・Gemini)の末尾に置く。文章より写真のほうが早い場面が あるため —— 見た目が分かれば「行くかどうか」も「着いたときにそれと分かるか」も 決められる。 画像タブはudm=2で開く(AIモードのudm=50と同じ渡し方)。検索語は名前と所在地で、 座標は入れない。画像検索は座標を地名として扱わないので、数字が混ざると関係のない 画像が並ぶため。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 855d24d commit c2c8f2a

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,11 @@ Microsoft Copilotは`?q=`が入力欄に入らなくなる回帰が報告され
421421
こちらは会話履歴を残さずに引けるWeb検索に近く、地図・経路と同じ「Googleで調べる」の一員。
422422
腰を据えて相手を選んで聞くほうがAskAiButtonの側。
423423

424+
**同じ並びにGoogleの画像検索も置いてある**(`udm=2`が画像タブ。AIモードの`udm=50`
425+
同じ渡し方)。文章より写真のほうが早い場面があるため —— 見た目が分かれば「行くかどうか」も
426+
「着いたときにそれと分かるか」も決められる。**検索語は名前と所在地で、座標は入れない**
427+
(画像検索は座標を地名として扱わないので、数字が混ざると関係のない画像が並ぶ)。
428+
424429
質問文は`buildSpotQuestion`が組み、**所在地と座標を添える** —— 「光明寺」のように同名の場所が
425430
各地にあるため、名前だけだと別のスポットについて答えられてしまう。
426431

components/SpotDetailModal.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ function GoogleMapsIcon({ className }: { className?: string }) {
7777
);
7878
}
7979

80+
/** 画像アイコン(Google Material Symbols「image」、Apache License 2.0) */
81+
function GoogleImagesIcon({ className }: { className?: string }) {
82+
return (
83+
<svg viewBox="0 0 24 24" fill="currentColor" className={className} aria-hidden="true">
84+
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z" />
85+
</svg>
86+
);
87+
}
88+
8089
/** 星アイコン(Google Material Symbols「star」/「star_border」、Apache License 2.0) */
8190
function StarIcon({ filled, className }: { filled: boolean; className?: string }) {
8291
return (
@@ -818,6 +827,24 @@ export default function SpotDetailModal({
818827
>
819828
<GeminiIcon className="size-5" />
820829
</a>
830+
{/* Google の画像検索(`udm=2`が画像タブ。AIモードの`udm=50`と同じ渡し方)。
831+
**文章より写真のほうが早い場面がある** —— 見た目が分かれば
832+
「行くかどうか」も「着いたときにそれと分かるか」も判断できる。
833+
**検索語に座標は入れない**(名前と所在地で引く) ——
834+
地図・経路と違って画像検索は座標を地名として扱わないため、
835+
数字が混ざるとかえって関係のない画像が並ぶ */}
836+
<a
837+
href={`https://www.google.com/search?udm=2&q=${encodeURIComponent(
838+
[spot.name, spot.region].filter(Boolean).join(" ")
839+
)}`}
840+
target="_blank"
841+
rel="noopener noreferrer"
842+
aria-label="Google 画像検索でこのスポットを見る"
843+
title="Google 画像検索でこのスポットを見る"
844+
className="rounded p-1 text-blue-600 hover:bg-blue-50"
845+
>
846+
<GoogleImagesIcon className="size-5" />
847+
</a>
821848
</div>
822849
</div>
823850

0 commit comments

Comments
 (0)