Maps API는 Navigation SDK의 일부로도 제공되며, 이를 사용하여 지도 관련 (탐색 이외) 환경을 빌드할 수 있습니다. 앱에 내비게이션이 아닌 지도 환경과 내비게이션 환경이 모두 포함된 경우 동일한 지도 인스턴스에서 Maps and Navigation API를 사용하는 것이 좋습니다.
getMapAsync를 사용하여 GoogleMap 인스턴스 가져오기
SupportNavigationFragment#getMapAsync 또는 NavigationView#getMapAsync를 사용하여 GoogleMap 객체를 가져올 수 있습니다. 아래의 NavigationView가 다시 생성되면 비활성 상태가 될 수 있는 GoogleMap 인스턴스를 유지하는 대신 이 메서드를 사용하는 것이 좋습니다.
또한 이 메서드에서 가져온 GoogleMap가 더 이상 필요하지 않으면 정리해야 합니다. 자세한 내용은 인스턴스 정리 권장사항을 참고하세요.
[[["이해하기 쉬움","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"]],["최종 업데이트: 2025-06-29(UTC)"],[[["Implement `GoogleMap` features on a separate map instance from navigation experiences to avoid conflicts and optimize performance."],["Use `getMapAsync` to retrieve the `GoogleMap` object instead of holding onto an instance, ensuring you have the most up-to-date map object and preventing stale data."],["Remember to clean up the `GoogleMap` object after use to prevent memory leaks and maintain optimal app performance, referring to the Instance cleanup best practices for detailed guidance."]]],[]]