목차
이슈 #1: Google Maps 미얀마 지역 선택 제한 문제
1. 이슈 상황
| 항목 |
내용 |
| 발생 환경 |
섹션 등록 페이지에서 Google Maps Places Autocomplete 사용 시 |
| 증상 |
미얀마(Myanmar) 지역 주소 검색 시 결과가 나타나지 않음 |
| 영향 범위 |
지역 등록, 섹션 등록 기능 전체 |
문제 코드:
// componentRestrictions에 미얀마가 설정되어 있지 않음
const autocomplete = new window.google.maps.places.Autocomplete(ref, {
types: ['geocode'],
componentRestrictions: { country: 'kr' }, // 한국만 설정됨
});
2. 해결 방안 후보
| 방안 |
장점 |
단점 |
| A. 국가 선택 드롭다운 추가 |
사용자가 국가 선택 가능, 명확한 UX |
추가 UI 구현 필요 |
| B. componentRestrictions 복수 국가 설정 |
간단한 설정 변경 |
사용자가 국가 전환 불가 |
| C. 제한 없이 전체 허용 |
구현 간단 |
불필요한 검색 결과 노출 |
3. 선택한 해결법
선택: A안 (국가 선택 드롭다운 + 동적 componentRestrictions 업데이트)
// SectionRegister/index.tsx
const [selectedCountry, setSelectedCountry] = React.useState<'kr' | 'mm'>('mm');
const autocompleteRef = React.useRef<google.maps.places.Autocomplete | null>(null);
// 국가 선택 UI
<Select
value={selectedCountry}
onChange={(e) => {
const newCountry = e.target.value as 'kr' | 'mm';
setSelectedCountry(newCountry);
// Autocomplete 제한 국가 동적 업데이트
if (autocompleteRef.current) {
autocompleteRef.current.setComponentRestrictions({
country: newCountry,
});
}
}}
>
<MenuItem value="kr">대한민국</MenuItem>
<MenuItem value="mm">미얀마</MenuItem>
</Select>
// Autocomplete 초기화 시 선택된 국가 적용
const autocomplete = new window.google.maps.places.Autocomplete(ref, {
types: ['geocode'],
componentRestrictions: { country: selectedCountry },
});
4. 선택 이유
| 관점 |
이유 |
| 유연성 |
사용자가 필요에 따라 국가 전환 가능 |
| UX |
기본값을 미얀마('mm')로 설정하여 주 사용 케이스 대응 |
| 확장성 |
향후 라오스 등 다른 국가 추가 용이 |
| 실시간 반영 |
setComponentRestrictions로 페이지 새로고침 없이 국가 변경 |
이슈 #2: 면장 파일 업로드 시 PDF 미지원 문제
1. 이슈 상황
| 항목 |
내용 |
| 발생 환경 |
면장 등록/수정 페이지의 계약서, 통장 사본 업로드 필드 |
| 증상 |
PDF 파일 선택 불가, 이미지만 업로드 가능 |
| 영향 범위 |
면장 등록, 수정 기능의 파일 첨부 |
문제 코드:
// LabelAndSelectFile.tsx - 이미지만 허용
<input
type="file"
accept="image/*" // PDF 미포함
onChange={handleFileChange}
/>