YD_S 개발로그
article thumbnail

Google Map style 변경하기

 

flutter_google_map 패키지 사용할 경우 Makers 추가 시 Default로 보여지는 Landmarkers가 보여져서 내가 추가한 Makers가 눈에 덜 띄거나 Makers 가 너무 많아 의도한 정보를 보여주지 못할 가능성이 있다.

그런 경우 Map의 style을 Custom하여 조절할 수 있다.

 

Style 커스텀하기

  • 아래 사이트에서 원하는 스타일을 커스텀한다.
  • FINISH 버튼 클릭 후 COPY JSON 버튼을 클릭한다.

https://mapstyle.withgoogle.com/

 

Styling Wizard: Google Maps APIs

To import, paste in your JSON. When importing we reorder and rewrite the JSON, which means it's not going to look the same on the other side. You have been warned. Import JSON Invalid JSON. Unable to import.

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

profile

YD_S 개발로그

@YD_S

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!