새로운 지도 스타일이 곧 Google Maps Platform에 제공될 예정입니다. 이 지도 스타일 지정 업데이트에는 새로운 기본 색상 팔레트와 지도 환경 및 사용성 개선사항이 포함됩니다. 모든 지도 스타일이 2025년 3월에 자동으로 업데이트됩니다. 사용 가능 여부 및 더 일찍 선택하는 방법에 대한 자세한 내용은 Google Maps Platform용 새로운 지도 스타일을 참고하세요.
이렇게 한다고 해서 반드시 지도가 레이아웃 과정을 거친 것은 아닙니다. 따라서 콜백 메서드가 호출될 때 지도 크기가 결정되지 않았을 수도 있습니다. 크기를 알아야 하거나 API에서 크기를 알아야 하는 메서드를 호출해야 하는 경우 지도의 View를 가져오고 ViewTreeObserver.OnGlobalLayoutListener도 등록하세요.
OnMapReadyCallback 및 OnGlobalLayoutListener 리스너를 체이닝하지 말고, 콜백은 어떤 순서로든 실행될 수 있으므로 두 콜백을 따로 등록하고 기다립니다.
예를 들어 크기 없이 LatLngBounds를 사용하여 지도의 카메라를 업데이트하려면 OnMapReadyCallback 및 OnGlobalLayoutListener가 모두 완료될 때까지
기다려야 합니다. 그렇지 않으면 IllegalStateException을 트리거할 수 있는 경합 상태가 발생합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-09-05(UTC)"],[[["`OnMapReadyCallback` is triggered when the Google Map is fully loaded and ready for interaction within a `MapFragment` or `MapView`."],["It provides a non-null `GoogleMap` object in the `onMapReady` method, enabling developers to manipulate the map."],["If Google Play services is not available, users are prompted to install it before the callback is triggered."],["The map's layout and dimensions might not be immediately available in `onMapReady`, requiring the use of `ViewTreeObserver.OnGlobalLayoutListener` for size-dependent operations."],["Avoid chaining `OnMapReadyCallback` and `OnGlobalLayoutListener`, handle them independently to prevent race conditions and potential `IllegalStateException`."]]],[]]