공지사항: 새로운 기본 지도 스타일이 곧 Google Maps Platform에 제공될 예정입니다. 이 지도 스타일 지정 업데이트에는 새로운 기본 색상 팔레트, 현대화된 핀, 지도 환경 및 사용성 개선사항이 포함됩니다. 모든 지도 스타일이 2025년 3월에 자동으로 업데이트됩니다. 사용 가능 여부 및 더 일찍 선택하는 방법에 대한 자세한 내용은 Google Maps Platform용 새로운 지도 스타일을 참고하세요.
장소 라이브러리를 로드하려면 다음 스니펫과 같이 애플리케이션 코드에 인라인 부트스트랩 로더를 추가하여 Maps JavaScript API를 먼저 로드하세요.
<script>
(g=>{varh,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});vard=b.maps||(b.maps={}),r=newSet,e=newURLSearchParams,u=()=>h||(h=newPromise(async(f,n)=>{await(a=m.createElement("script"));e.set("libraries",[...r]+"");for(king)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({key:"YOUR_API_KEY",v:"weekly",// Use the 'v' parameter to indicate the version to use (weekly, beta, alpha, etc.).// Add other bootstrap parameters as needed, using camel case.});
</script>
그런 다음 아래와 같이 await 연산자를 사용하여 async 함수 내에서 importLibrary()를 호출합니다.
[null,null,["최종 업데이트: 2025-02-28(UTC)"],[[["This guide explains how to prepare your application to work with the Google Maps Places API's Place class."],["You'll need to set up a Cloud project, obtain an API key, and enable necessary APIs including Maps JavaScript API, Places API, and Places API (New)."],["The Places Library is loaded by including the Maps JavaScript API bootstrap loader and then calling `importLibrary(\"places\")`."],["Once set up, you can utilize the Place class for searching places, retrieving details, and using Place Autocomplete."]]],["To use the Place class, you must first create a Cloud project with billing, obtain an API key, and enable the Maps JavaScript API, Places API, and Places API (New). Then, load the Places Library by including the Maps JavaScript API bootstrap loader in your code, and utilizing the `importLibrary()` function within an `async` context. This allows for the use of the \"places\" library, and subsequent place related tasks.\n"]]