fix(map): globe 모드 zones-fill 숨김 + 라벨 가드
- globe tessellation에서 수역 fill polygon vertex 65535 초과 (해안선 2100 vertex → globe에서 108890+로 폭증) → 노란 막대 - globe 모드에서 zones-fill visibility: none으로 설정 - guardedSetVisibility 적용으로 수역 라벨 사라짐 방지 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
부모
95d9ea8aef
커밋
99d714582b
@ -10,6 +10,7 @@ import type { ZonesGeoJson } from '../../../entities/zone/api/useZones';
|
|||||||
import type { MapToggleState } from '../../../features/mapToggles/MapToggles';
|
import type { MapToggleState } from '../../../features/mapToggles/MapToggles';
|
||||||
import type { BaseMapId, MapProjectionId } from '../types';
|
import type { BaseMapId, MapProjectionId } from '../types';
|
||||||
import { kickRepaint, onMapStyleReady } from '../lib/mapCore';
|
import { kickRepaint, onMapStyleReady } from '../lib/mapCore';
|
||||||
|
import { guardedSetVisibility } from '../lib/layerHelpers';
|
||||||
|
|
||||||
export function useZonesLayer(
|
export function useZonesLayer(
|
||||||
mapRef: MutableRefObject<maplibregl.Map | null>,
|
mapRef: MutableRefObject<maplibregl.Map | null>,
|
||||||
@ -48,22 +49,13 @@ export function useZonesLayer(
|
|||||||
|
|
||||||
const ensure = () => {
|
const ensure = () => {
|
||||||
if (projectionBusyRef.current) return;
|
if (projectionBusyRef.current) return;
|
||||||
const visibility = overlays.zones ? 'visible' : 'none';
|
const visibility: 'visible' | 'none' = overlays.zones ? 'visible' : 'none';
|
||||||
try {
|
// globe 모드에서 fill polygon은 tessellation으로 vertex 65535 초과 → 숨김
|
||||||
if (map.getLayer(fillId)) map.setLayoutProperty(fillId, 'visibility', visibility);
|
// (해안선 디테일 2100+ vertex가 globe에서 100,000+로 폭증하여 노란 막대 아티팩트 발생)
|
||||||
} catch {
|
const fillVisibility: 'visible' | 'none' = projection === 'globe' ? 'none' : visibility;
|
||||||
// ignore
|
guardedSetVisibility(map, fillId, fillVisibility);
|
||||||
}
|
guardedSetVisibility(map, lineId, visibility);
|
||||||
try {
|
guardedSetVisibility(map, labelId, visibility);
|
||||||
if (map.getLayer(lineId)) map.setLayoutProperty(lineId, 'visibility', visibility);
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
if (map.getLayer(labelId)) map.setLayoutProperty(labelId, 'visibility', visibility);
|
|
||||||
} catch {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!zones) return;
|
if (!zones) return;
|
||||||
if (!map.isStyleLoaded()) return;
|
if (!map.isStyleLoaded()) return;
|
||||||
@ -160,7 +152,7 @@ export function useZonesLayer(
|
|||||||
] as unknown as number)
|
] as unknown as number)
|
||||||
: 0.12,
|
: 0.12,
|
||||||
},
|
},
|
||||||
layout: { visibility },
|
layout: { visibility: fillVisibility },
|
||||||
} as unknown as LayerSpecification,
|
} as unknown as LayerSpecification,
|
||||||
before,
|
before,
|
||||||
);
|
);
|
||||||
|
|||||||
불러오는 중...
Reference in New Issue
Block a user