2021년 10월 13일에 google.load에 '지도' 모듈을 제공하는 서비스가 사용 중지됩니다.
따라서 2021년 10월 13일 이후에 google.load에서 '지도' 모듈을 사용하려고 하면 오류('지도' 모듈은 지원되지 않습니다)가 표시되고 지도가 로드되지 않습니다. 잠재적인 서비스 중단을 방지하려면 대안 중 하나로 전환해야 합니다.
어떤 조치를 취해야 하나요?
먼저 google.load 로더를 로드하는 <script> 태그를 삭제한 다음 google.load 호출을 삭제합니다. 다른 용도로 Google 로더를 사용 중인 경우 로더 <script> 태그를 그대로 두어도 됩니다.
이어서 Maps JavaScript API를 로드하는 새로운 방법을 구현합니다(다음 옵션 중 하나 선택).
다음 예는 현재 Google 로더를 사용하여 Maps JavaScript API를 로드하는 방법을 보여줍니다(두 개의 <script> 블록이 있음).
이전
<scripttype='text/javascript'src='https://www.google.com/jsapi'></script>
<scripttype='text/javascript'>
google.load("maps","3.exp",{"callback":initMap,"key":"YOUR_KEY","libraries":"places,visualization"});functioninitMap(){// Google Maps JS API is loaded and available}
</script>
<script> 태그를 사용하여 인라인 로드(권장)
이 접근 방식을 사용하면 페이지가 로드되는 동시에 Maps JavaScript API가 로드됩니다. 인라인 로드를 구현하려면 먼저 www.google.com/jsapi('이전')를 로드하는 <script> 태그를 다음 예에 표시된 <script> 태그로 바꿉니다.
동적 로드를 사용하면 Maps JavaScript API가 로드되는 시점을 관리할 수 있습니다. 예를 들어 사용자가 버튼을 클릭하거나 다른 작업을 실행할 때까지 기다렸다가 Maps JavaScript API를 로드할 수 있습니다. 동적 로드를 구현하려면 먼저 www.google.com/jsapi('이전')를 로드하는 <script> 태그를 다음 예에 표시된 대로 <script> 태그를 프로그래매틱 방식으로 추가하는 코드로 바꿉니다.
[[["이해하기 쉬움","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-08-27(UTC)"],[[["\u003cp\u003eThe "Maps" module for \u003ccode\u003egoogle.load\u003c/code\u003e will be discontinued on October 13, 2021, resulting in map loading errors if still in use.\u003c/p\u003e\n"],["\u003cp\u003eTo avoid issues, developers must switch to alternative loading methods like inline or dynamic loading before the deadline.\u003c/p\u003e\n"],["\u003cp\u003eInline loading involves replacing the \u003ccode\u003egoogle.load\u003c/code\u003e script with a new script tag directly embedding the Maps JavaScript API.\u003c/p\u003e\n"],["\u003cp\u003eDynamic loading allows for controlled, on-demand loading of the Maps JavaScript API triggered by user actions or specific events.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should remove or update the existing \u003ccode\u003egoogle.load\u003c/code\u003e function calls in their code after implementing the new loading method.\u003c/p\u003e\n"]]],[],null,["# Migration: Maps Module in google.load\n\nOn October 13, 2021, we will turn off the service that provides the \"Maps\"\nmodule for [`google.load`](https://support.google.com/code/answer/74501).\nThis means that after October 13, 2021, if you try to use the \"Maps\" module in\n`google.load` you will receive an error (*module \"maps\" is not supported*), and\nno map will load. To help you avoid potential breakage, you must switch to one\nof the alternatives.\n\nWhat do I need to do?\n---------------------\n\nFirst, remove the `\u003cscript\u003e` tag that loads the `google.load` loader,\nthen remove calls to `google.load`. If you're using Google Loader for other\nthings, it's okay to leave the loader `\u003cscript\u003e` tag in place.\n\nNext, implement a new way to load the Maps JavaScript API (select\none of the following options):\n\n- [Inline loading using the `\u003cscript\u003e` tag](#inline-loading)\n- [Dynamic loading from another JavaScript file](#dynamic-loading)\n\n### Current example using the Google Loader\n\nThe following example shows how the Google Loader is currently used to load the\nMaps JavaScript API (there are two `\u003cscript\u003e` blocks):\n\n#### Before\n\n \u003cscript type='text/javascript' src='https://www.google.com/jsapi'\u003e\u003c/script\u003e\n \u003cscript type='text/javascript'\u003e\n google.load(\"maps\", \"3.exp\", {\n \"callback\": initMap,\n \"key\": \"YOUR_KEY\",\n \"libraries\": \"places,visualization\"\n });\n function initMap() {\n // Google Maps JS API is loaded and available\n }\n \u003c/script\u003e\n\n### Inline loading using the `\u003cscript\u003e` tag (recommended)\n\nWhen this approach is used, the Maps JavaScript API loads at the\nsame time the page loads. To implement inline loading, first replace the\n`\u003cscript\u003e` tag that loads www.google.com/jsapi ([\"before\"](#before)) with the\n`\u003cscript\u003e` tag shown in the following example: \n\n \u003cscript async src=\"https://maps.googleapis.com/maps/api/js?libraries=places,visualization&key=YOUR_API_KEY&v=weekly&callback=initMap\"\u003e\n \u003c/script\u003e\n\nThen in your javascript code, remove the `google.load` function call, since\nit's no longer needed. The following example shows a blank `initMap()`\nfunction, which is called when the Maps library has loaded successfully: \n\n \u003cscript type='text/javascript'\u003e\n function initMap() {\n // Google Maps JS API is loaded and available\n }\n \u003c/script\u003e\n\n[See the documentation](/maps/documentation/javascript/overview#Loading_the_Maps_API)\n\n### Dynamic loading from another JavaScript file\n\nDynamic loading lets you control when the Maps JavaScript API is loaded. For\nexample, you can wait to load the Maps JavaScript API until the\nuser clicks a button or performs another action. To implement dynamic loading,\nfirst replace the `\u003cscript\u003e` tag that loads www.google.com/jsapi ([\"before\"](#before))\nwith code to programmatically add the `\u003cscript\u003e` tag, as shown in the following example: \n\n var script = document.createElement('script');\n script.src =\n 'https://maps.googleapis.com/maps/api/js?libraries=places,visualization&key=YOUR_API_KEY&v=weekly&callback=initMap';\n script.async=true;\n\nThen attach your callback function to the window object like this: \n\n window.initMap = function() {\n // Google Maps JS API is loaded and available\n };\n\nFinally, add the `\u003cscript\u003e` tag to the header of the page like this: \n\n document.head.appendChild(script);\n\n[See the documentation](/maps/documentation/javascript/overview#Loading_the_Maps_API)"]]