Google 지도 API는 지도 유형 이미지에 다양한 확대/축소 수준의 지도 타일을 제공합니다. 예를 들어 대부분의 도로 지도 이미지는 0~18의 확대/축소 수준으로 제공됩니다. 위성 이미지는 생성되지 않고 직접 촬영하므로 더 광범위합니다.
이미지의 최고 확대/축소 수준을 미리 알고 싶을 수도 있지만, 외진 곳 위치(인구 밀도가 희박한 지역이나 개방된 바다 지역)의 경우 높은 확대/축소 수준에서 위성 이미지가 제공되지 않을 수도 있습니다. MaxZoomService 객체는 Google 지도에 위성 이미지가 있는 지정된 위치의 최대 확대/축소 사진을 찾기 위한 간단한 인터페이스를 제공합니다.
MaxZoom 요청
MaxZoomService에 대한 액세스는 Google 지도 API에서 외부 서버를 호출해야 하므로 비동기식입니다. 따라서 요청 완료 시 실행할 콜백 메서드를 전달해야 합니다. 이 콜백 메서드가 결과를 처리합니다.
MaxZoomService 요청을 시작하려면 getMaxZoomAtLatLng()를 호출하고 위치의 LatLng 및 요청 완료 시 실행할 콜백 함수를 전달하세요.
MaxZoom 응답
getMaxZoomAtLatLng()는 콜백 함수를 실행할 때 다음 두 매개변수를 다시 전달합니다.
status에는 요청의 MaxZoomStatus가 포함됩니다.
zoom에는 확대/축소 수준이 포함됩니다. 어떤 이유로든 서비스가 실패하면 이 값이 존재하지 않습니다.
status 코드는 다음 값 중 하나를 반환할 수 있습니다.
OK는 서비스가 위성 이미지의 최대 확대/축소 수준을 찾았음을 나타냅니다.
ERROR는 MaxZoom 요청을 처리하지 못했음을 나타냅니다.
다음 예는 도쿄 도심 지역의 지도를 보여줍니다. 지도의 아무 곳이나 클릭하면 해당 위치의 최대 확대/축소 수준이 표시됩니다. (일반적으로 도쿄 지역의 확대/축소 수준은 18~21입니다.)
TypeScript
letmap:google.maps.Map;letmaxZoomService:google.maps.MaxZoomService;letinfoWindow:google.maps.InfoWindow;functioninitMap():void{map=newgoogle.maps.Map(document.getElementById("map")asHTMLElement,{zoom:11,center:{lat:35.6894,lng:139.692},mapTypeId:"hybrid",});infoWindow=newgoogle.maps.InfoWindow();maxZoomService=newgoogle.maps.MaxZoomService();map.addListener("click",showMaxZoom);}functionshowMaxZoom(e:google.maps.MapMouseEvent){maxZoomService.getMaxZoomAtLatLng(e.latLngasgoogle.maps.LatLng,(result:google.maps.MaxZoomResult)=>{if(result.status!=="OK"){infoWindow.setContent("Error in MaxZoomService");}else{infoWindow.setContent("The maximum zoom at this location is: "+result.zoom);}infoWindow.setPosition(e.latLng);infoWindow.open(map);});}declareglobal{interfaceWindow{initMap:()=>void;}}window.initMap=initMap;
letmap;letmaxZoomService;letinfoWindow;functioninitMap(){map=newgoogle.maps.Map(document.getElementById("map"),{zoom:11,center:{lat:35.6894,lng:139.692},mapTypeId:"hybrid",});infoWindow=newgoogle.maps.InfoWindow();maxZoomService=newgoogle.maps.MaxZoomService();map.addListener("click",showMaxZoom);}functionshowMaxZoom(e){maxZoomService.getMaxZoomAtLatLng(e.latLng,(result)=>{if(result.status!=="OK"){infoWindow.setContent("Error in MaxZoomService");}else{infoWindow.setContent("The maximum zoom at this location is: "+result.zoom,);}infoWindow.setPosition(e.latLng);infoWindow.open(map);});}window.initMap=initMap;
[[["이해하기 쉬움","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-10(UTC)"],[[["\u003cp\u003eThe Google Maps \u003ccode\u003eMaxZoomService\u003c/code\u003e helps determine the highest zoom level available for satellite imagery at a specific location.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eMaxZoomService\u003c/code\u003e requests are asynchronous and require a callback function to handle the response, which includes a status and zoom level.\u003c/p\u003e\n"],["\u003cp\u003eThe response status can be \u003ccode\u003eOK\u003c/code\u003e indicating success or \u003ccode\u003eERROR\u003c/code\u003e if the request failed.\u003c/p\u003e\n"],["\u003cp\u003eA provided example demonstrates using the \u003ccode\u003eMaxZoomService\u003c/code\u003e to display the maximum zoom level when clicking on a map of Tokyo.\u003c/p\u003e\n"]]],["The `MaxZoomService` determines the highest zoom level for satellite imagery at a given location. It uses `getMaxZoomAtLatLng()` with a location's `LatLng` and a callback function. The callback returns a `status` (`OK` or `ERROR`) and the `zoom` level. Clicking on a map in the provided example triggers `getMaxZoomAtLatLng()`, which updates an info window with the maximum zoom level or an error message. Access to this service is asynchronous and requires a callback to process results.\n"],null,["1. [Maximum Zoom Imagery](#MaxZoom)\n2. [MaxZoom Requests](#MaxZoomRequests)\n3. [MaxZoom Responses](#MaxZoomResponses)\n\nOverview Also see the Maps JavaScript API Reference: [Max Zoom](/maps/documentation/javascript/reference/max-zoom)\n\nThe Google Maps API provides map tiles at various\n[zoom levels](/maps/documentation/javascript/tutorial#MapOptions) for map type imagery. Most roadmap\nimagery is available from zoom levels 0 to 18, for\nexample. Satellite imagery varies more widely as this\nimagery is not generated, but directly photographed.\n\nBecause satellite imagery is not always available at\nhigh zoom levels for remote locations --- sparsely populated\nareas or open ocean areas --- you may want to\nknow the highest zoom level for imagery at a given location\nbeforehand. The `MaxZoomService` object provides a\nsimple interface for discovering the maximum zoom level at a\ngiven location for which Google Maps has satellite imagery.\n\nMaxZoom Requests\n\nAccessing the `MaxZoomService` is asynchronous, since the\nGoogle Maps API needs to make a call to an external server. For\nthat reason, you need to pass a *callback* method to execute\nupon completion of the request. This callback method should process\nthe result.\n\nTo initiate a request to the `MaxZoomService`,\ncall `getMaxZoomAtLatLng()`, passing the\n`LatLng` of the location and a callback function\nto execute upon completion of the request.\n\nMaxZoom Responses\n\nWhen `getMaxZoomAtLatLng()` executes the *callback*\nfunction, it will pass back two parameters:\n\n- `status` contains the `MaxZoomStatus` of the request.\n- `zoom` contains the zoom level. If for some reason the service fails, this value will not be present.\n\nThe `status` code may return one of the following values:\n\n- `OK` indicates that the service found the maximum zoom level for satellite imagery.\n- `ERROR` indicates that the MaxZoom request could not be processed.\n\nThe following example shows a map of metropolitan Tokyo.\nClicking anywhere on the map indicates the maximum zoom level\nat that location. (Zoom levels around Tokyo generally vary\nbetween zoom levels 18 and 21.) \n\nTypeScript \n\n```typescript\nlet map: google.maps.Map;\nlet maxZoomService: google.maps.MaxZoomService;\nlet infoWindow: google.maps.InfoWindow;\n\nfunction initMap(): void {\n map = new google.maps.Map(document.getElementById(\"map\") as HTMLElement, {\n zoom: 11,\n center: { lat: 35.6894, lng: 139.692 },\n mapTypeId: \"hybrid\",\n });\n\n infoWindow = new google.maps.InfoWindow();\n\n maxZoomService = new google.maps.MaxZoomService();\n\n map.addListener(\"click\", showMaxZoom);\n}\n\nfunction showMaxZoom(e: google.maps.MapMouseEvent) {\n maxZoomService.getMaxZoomAtLatLng(\n e.latLng as google.maps.LatLng,\n (result: google.maps.MaxZoomResult) =\u003e {\n if (result.status !== \"OK\") {\n infoWindow.setContent(\"Error in MaxZoomService\");\n } else {\n infoWindow.setContent(\n \"The maximum zoom at this location is: \" + result.zoom\n );\n }\n\n infoWindow.setPosition(e.latLng);\n infoWindow.open(map);\n }\n );\n}\n\ndeclare global {\n interface Window {\n initMap: () =\u003e void;\n }\n}\nwindow.initMap = initMap;https://github.com/googlemaps/js-samples/blob/2683f7366fb27829401945d2a7e27d77ed2df8e5/samples/maxzoom-simple/index.ts#L8-L49\n```\n| **Note:** Read the [guide](/maps/documentation/javascript/using-typescript) on using TypeScript and Google Maps.\n\nJavaScript \n\n```javascript\nlet map;\nlet maxZoomService;\nlet infoWindow;\n\nfunction initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 11,\n center: { lat: 35.6894, lng: 139.692 },\n mapTypeId: \"hybrid\",\n });\n infoWindow = new google.maps.InfoWindow();\n maxZoomService = new google.maps.MaxZoomService();\n map.addListener(\"click\", showMaxZoom);\n}\n\nfunction showMaxZoom(e) {\n maxZoomService.getMaxZoomAtLatLng(e.latLng, (result) =\u003e {\n if (result.status !== \"OK\") {\n infoWindow.setContent(\"Error in MaxZoomService\");\n } else {\n infoWindow.setContent(\n \"The maximum zoom at this location is: \" + result.zoom,\n );\n }\n\n infoWindow.setPosition(e.latLng);\n infoWindow.open(map);\n });\n}\n\nwindow.initMap = initMap;https://github.com/googlemaps/js-samples/blob/2683f7366fb27829401945d2a7e27d77ed2df8e5/dist/samples/maxzoom-simple/docs/index.js#L7-L37\n```\n| **Note:** The JavaScript is compiled from the TypeScript snippet.\n[View example](/maps/documentation/javascript/examples/maxzoom-simple)\n\nTry Sample \n[JSFiddle.net](https://jsfiddle.net/gh/get/library/pure/googlemaps/js-samples/tree/master/dist/samples/maxzoom-simple/jsfiddle) [Google Cloud Shell](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fgooglemaps%2Fjs-samples&cloudshell_git_branch=sample-maxzoom-simple&cloudshell_tutorial=cloud_shell_instructions.md&cloudshell_workspace=.)"]]