import { LitElement, html, css, nothing } from 'lit' import { customElement, property, state } from 'lit/decorators.js' import '../../../google-map/common-google-map.js' declare global { interface Window { google: any } } @customElement('kpi-map-panel') export class KpiMapPanel extends LitElement { static styles = css` :host { display: flex; background: #f8f9fa; overflow: hidden; position: relative; min-height: 500px; } .map-overlay { position: absolute; top: 16px; left: 16px; z-index: 10; background: rgba(255, 255, 255, 0.95); border-radius: 8px; padding: 12px 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); backdrop-filter: blur(4px); } .category-buttons { display: flex; gap: 8px; flex-wrap: wrap; } .category-button { padding: 6px 12px; border: 1px solid #ced4da; background: #fff; border-radius: 4px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s; white-space: nowrap; } .category-button.active { background: #667eea; color: white; border-color: #667eea; } .category-button:hover { background: #f8f9fa; } .category-button.active:hover { background: #5a6fd8; } .period-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e9ecef; } .period-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .period-label { font-size: 0.85rem; font-weight: 600; color: #495057; min-width: 40px; } .period-select { padding: 4px 8px; border: 1px solid #ced4da; border-radius: 4px; background: white; font-size: 0.8rem; cursor: pointer; } .period-select:focus { outline: none; border-color: #667eea; } .period-separator { font-size: 0.85rem; color: #6c757d; margin: 0 4px; } .map-container { flex: 1; position: relative; overflow: hidden; } .map-controls { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 10; } .map-control-button { width: 40px; height: 40px; background: white; border: 1px solid #ced4da; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); } .map-control-button:hover { background: #f8f9fa; } .map-scale-direction { position: absolute; bottom: 16px; right: 16px; background: white; padding: 8px 12px; border-radius: 6px; border: 1px solid #ced4da; font-size: 0.8rem; color: #666; z-index: 10; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); text-align: center; } .north-arrow { font-size: 1rem; margin-bottom: 4px; } .scale-info { font-size: 0.7rem; } common-google-map { width: 100%; height: 100%; } ` @property({ type: String }) selectedCategory = '전체 KPI' @property({ type: Array }) mapData: any[] = [] @state() private map: any = null @state() private startYear = '전체' @state() private startMonth = '전체' @state() private endYear = '전체' @state() private endMonth = '전체' // mapData를 지도 마커 형식으로 변환 get mapLocations() { return ( this.mapData?.map(item => ({ lat: item.lat, lng: item.lng, title: item.region, region: item.region, // 지역명 추가 // 커스텀 마커 콘텐츠 생성 markerContent: `