refactor(map): 지도 항상 라이트 모드로 고정
useBaseMapStyle에서 테마 구독 제거, 항상 LIGHT_STYLE 반환. MapView lightMode를 true로 고정하여 앱 다크 모드와 무관하게 지도는 라이트 모드로 표시. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
부모
7921bfef96
커밋
e4b9c3e5dd
@ -17,8 +17,8 @@ import { MeasureOverlay } from './MeasureOverlay'
|
|||||||
import { useMeasureTool } from '@common/hooks/useMeasureTool'
|
import { useMeasureTool } from '@common/hooks/useMeasureTool'
|
||||||
import { hexToRgba } from './mapUtils'
|
import { hexToRgba } from './mapUtils'
|
||||||
import { S57EncOverlay } from './S57EncOverlay'
|
import { S57EncOverlay } from './S57EncOverlay'
|
||||||
|
import { SrOverlay } from './SrOverlay'
|
||||||
import { useMapStore } from '@common/store/mapStore'
|
import { useMapStore } from '@common/store/mapStore'
|
||||||
import { useThemeStore } from '@common/store/themeStore'
|
|
||||||
import { useBaseMapStyle } from '@common/hooks/useBaseMapStyle'
|
import { useBaseMapStyle } from '@common/hooks/useBaseMapStyle'
|
||||||
|
|
||||||
const GEOSERVER_URL = import.meta.env.VITE_GEOSERVER_URL || 'http://localhost:8080'
|
const GEOSERVER_URL = import.meta.env.VITE_GEOSERVER_URL || 'http://localhost:8080'
|
||||||
@ -113,6 +113,7 @@ interface MapViewProps {
|
|||||||
drawingPoints?: BoomLineCoord[]
|
drawingPoints?: BoomLineCoord[]
|
||||||
layerOpacity?: number
|
layerOpacity?: number
|
||||||
layerBrightness?: number
|
layerBrightness?: number
|
||||||
|
layerColors?: Record<string, string>
|
||||||
backtrackReplay?: {
|
backtrackReplay?: {
|
||||||
isActive: boolean
|
isActive: boolean
|
||||||
ships: ReplayShip[]
|
ships: ReplayShip[]
|
||||||
@ -306,6 +307,7 @@ export function MapView({
|
|||||||
drawingPoints = [],
|
drawingPoints = [],
|
||||||
layerOpacity = 50,
|
layerOpacity = 50,
|
||||||
layerBrightness = 50,
|
layerBrightness = 50,
|
||||||
|
layerColors,
|
||||||
backtrackReplay,
|
backtrackReplay,
|
||||||
sensitiveResources = [],
|
sensitiveResources = [],
|
||||||
sensitiveResourceGeojson,
|
sensitiveResourceGeojson,
|
||||||
@ -329,7 +331,7 @@ export function MapView({
|
|||||||
analysisCircleRadiusM = 0,
|
analysisCircleRadiusM = 0,
|
||||||
showOverlays = true,
|
showOverlays = true,
|
||||||
}: MapViewProps) {
|
}: MapViewProps) {
|
||||||
const lightMode = useThemeStore((s) => s.theme) === 'light'
|
const lightMode = true
|
||||||
const { mapToggles, measureMode, measureInProgress, measurements } = useMapStore()
|
const { mapToggles, measureMode, measureInProgress, measurements } = useMapStore()
|
||||||
const { handleMeasureClick } = useMeasureTool()
|
const { handleMeasureClick } = useMeasureTool()
|
||||||
const isControlled = externalCurrentTime !== undefined
|
const isControlled = externalCurrentTime !== undefined
|
||||||
@ -1135,6 +1137,9 @@ export function MapView({
|
|||||||
{/* S-57 전자해도 오버레이 (공식 style.json 기반) */}
|
{/* S-57 전자해도 오버레이 (공식 style.json 기반) */}
|
||||||
<S57EncOverlay visible={mapToggles['s57'] ?? false} />
|
<S57EncOverlay visible={mapToggles['s57'] ?? false} />
|
||||||
|
|
||||||
|
{/* SR 민감자원 벡터타일 오버레이 */}
|
||||||
|
<SrOverlay enabledLayers={enabledLayers} opacity={layerOpacity} layerColors={layerColors} />
|
||||||
|
|
||||||
{/* WMS 레이어 */}
|
{/* WMS 레이어 */}
|
||||||
{wmsLayers.map(layer => (
|
{wmsLayers.map(layer => (
|
||||||
<Source
|
<Source
|
||||||
|
|||||||
@ -1,19 +1,15 @@
|
|||||||
import type { StyleSpecification } from 'maplibre-gl';
|
import type { StyleSpecification } from 'maplibre-gl';
|
||||||
import { useMapStore } from '@common/store/mapStore';
|
import { useMapStore } from '@common/store/mapStore';
|
||||||
import { useThemeStore } from '@common/store/themeStore';
|
|
||||||
import {
|
import {
|
||||||
BASE_STYLE,
|
|
||||||
LIGHT_STYLE,
|
LIGHT_STYLE,
|
||||||
SATELLITE_3D_STYLE,
|
SATELLITE_3D_STYLE,
|
||||||
ENC_EMPTY_STYLE,
|
ENC_EMPTY_STYLE,
|
||||||
} from '@common/components/map/mapStyles';
|
} from '@common/components/map/mapStyles';
|
||||||
|
|
||||||
export function useBaseMapStyle(): StyleSpecification {
|
export function useBaseMapStyle(): StyleSpecification {
|
||||||
const theme = useThemeStore((s) => s.theme);
|
|
||||||
const mapToggles = useMapStore((s) => s.mapToggles);
|
const mapToggles = useMapStore((s) => s.mapToggles);
|
||||||
|
|
||||||
if (mapToggles.s57) return ENC_EMPTY_STYLE;
|
if (mapToggles.s57) return ENC_EMPTY_STYLE;
|
||||||
if (mapToggles.threeD) return SATELLITE_3D_STYLE;
|
if (mapToggles.threeD) return SATELLITE_3D_STYLE;
|
||||||
if (theme === 'light') return LIGHT_STYLE;
|
return LIGHT_STYLE;
|
||||||
return BASE_STYLE;
|
|
||||||
}
|
}
|
||||||
|
|||||||
불러오는 중...
Reference in New Issue
Block a user