Google Map style 변경하기
flutter_google_map 패키지 사용할 경우 Makers 추가 시 Default로 보여지는 Landmarkers가 보여져서 내가 추가한 Makers가 눈에 덜 띄거나 Makers 가 너무 많아 의도한 정보를 보여주지 못할 가능성이 있다.
그런 경우 Map의 style을 Custom하여 조절할 수 있다.
Style 커스텀하기
- 아래 사이트에서 원하는 스타일을 커스텀한다.
- FINISH 버튼 클릭 후 COPY JSON 버튼을 클릭한다.
https://mapstyle.withgoogle.com/
Style 적용하기
- assets 폴더 아래 map_style.json 파일을 생성하여 복사한 json 내용을 붙여넣는다. (pubspec.yaml 에 파일 추가 잊지 말 것)
- map_style.json 파일을 읽어 GoogleMap 위젯에 적용한다.
Reference
https://stackoverflow.com/questions/70980162/flutter-google-maps-how-to-remove-system-markers
'Flutter' 카테고리의 다른 글
Device_Preview (디바이스 별 레이아웃 체크하기) (0) | 2023.05.15 |
---|---|
Equatable 플러그인을 사용하여 객체 비교하기 (0) | 2023.05.11 |
Font(폰트) 변경 (0) | 2023.04.28 |
Flutter - ToggleButtons (0) | 2023.04.28 |
이미지를 배경화면으로 사용 (0) | 2023.04.28 |