@@ -1123,6 +1123,29 @@ export default function MapView({
11231123 // 重ね表示が無効の間は使われない(現在種別の値を返すだけ)
11241124 const overlaySeriesStyles = useSeriesStyles ( overlayTypeKey ?? spotTypeKey ) ;
11251125 const overlayCategories = useCategories ( overlayTypeKey ?? spotTypeKey ) ;
1126+
1127+ // 重ね表示(別種別)のピンのタップ: 作成モード中は本体ピンと同じく追加確認へ回す。
1128+ // それ以外は従来どおり読み取り専用の詳細を開く。ハンドラはレイヤー生成時に一度だけ
1129+ // 束縛されるため、buildModeRef を見て呼び出し時に分岐する(handleSpotSelectと同じ理由)
1130+ const handleOverlaySpotSelect = useCallback ( ( id : string ) => {
1131+ if ( buildModeRef . current ) setAddCandidate ( id ) ;
1132+ else setOverlayDetailSpotId ( id ) ;
1133+ } , [ ] ) ;
1134+
1135+ // 重ね表示スポットのID→Spot。作成中パネルや追加確認で別種別スポットの名前を解決する
1136+ const overlaySpotById = useMemo ( ( ) => {
1137+ const m = new Map < string , Spot > ( ) ;
1138+ if ( overlaySpots ) for ( const s of overlaySpots ) m . set ( s . id , s ) ;
1139+ return m ;
1140+ } , [ overlaySpots ] ) ;
1141+
1142+ // 作成中パネルに渡す解決用マップ。本体スポットに重ね表示スポットを足したもの
1143+ // (IDが被ったら本体を優先)。これで別種別スポットも名前つきで一覧表示できる
1144+ const buildPanelSpotById = useMemo ( ( ) => {
1145+ const m = new Map ( overlaySpotById ) ;
1146+ for ( const [ id , s ] of spotById ) m . set ( id , s ) ;
1147+ return m ;
1148+ } , [ overlaySpotById , spotById ] ) ;
11261149 // 重ね表示の絞り込み変更をその種別のlocalStorageへ保存しつつstateへ反映する
11271150 // (overlayFiltersが変わると重ね表示の描画effectが再実行され、地図に即反映される)
11281151 const setOverlayFiltersAndSave = useCallback (
@@ -1890,7 +1913,7 @@ export default function MapView({
18901913 ) ;
18911914
18921915 const render = async ( ) => {
1893- ensureOverlayLayers ( map , setOverlayDetailSpotId , setOverlayDetailRouteId ) ;
1916+ ensureOverlayLayers ( map , handleOverlaySpotSelect , setOverlayDetailRouteId ) ;
18941917 // クラスタは重ね先の種別の先頭シリーズの色で塗り、本体の青いクラスタと
18951918 // 見分けられるようにする(シリーズ設定が空の種別は未知シリーズのピンと同系のグレー)
18961919 const clusterColor = overlaySeriesStyles [ 0 ] ?. color ?? "#9ca3af" ;
@@ -1933,6 +1956,7 @@ export default function MapView({
19331956 overlaySeriesStyles ,
19341957 visitedIds ,
19351958 runWhenMapReady ,
1959+ handleOverlaySpotSelect ,
19361960 ] ) ;
19371961
19381962 // 今回のセッションで送信した承認待ち/非公開スポットの仮ピン(破線)を表示
@@ -2378,7 +2402,7 @@ export default function MapView({
23782402 title = { buildDraft . title }
23792403 editing = { buildDraft . editingId !== null }
23802404 spotIds = { buildDraft . spotIds }
2381- spotsById = { spotById }
2405+ spotsById = { buildPanelSpotById }
23822406 seriesStyles = { seriesStyles }
23832407 saving = { savingList }
23842408 onReorder = { ( spotIds ) =>
@@ -2411,7 +2435,8 @@ export default function MapView({
24112435 className = "w-full max-w-xs space-y-3 rounded-2xl bg-white p-4"
24122436 >
24132437 { ( ( ) => {
2414- const spot = spotById . get ( addCandidate ) ;
2438+ const spot =
2439+ spotById . get ( addCandidate ) ?? overlaySpotById . get ( addCandidate ) ;
24152440 const already = buildDraft . spotIds . includes ( addCandidate ) ;
24162441 return (
24172442 < >
0 commit comments