웹페이지에서 지도를 사용하려면 사용자가 확대/축소 및 화면 이동을 위해 지도와 상호작용하는 방식을 관리하는 특정 옵션이 필요할 수도 있습니다. 이러한 옵션(예: gestureHandling, minZoom, maxZoom, restriction)은 MapOptions 인터페이스 내에서 정의됩니다.
기본 동작
다음 지도는 정의된 zoom 및 center 옵션만 사용하여 인스턴스화된 지도와의 상호작용에 대한 기본 동작을 보여줍니다.
사용자가 지도가 포함된 페이지를 스크롤할 때 스크롤 작업으로 인해 의도치 않게 지도가 확대/축소될 수 있습니다. 이 동작은 gesturehandling 지도 옵션을 사용하여 관리할 수 있습니다.
gestureHandling: cooperative
아래 지도에서는 cooperative로 설정된 gesturehandling 옵션을 사용하여 사용자가 지도를 확대/축소하거나 화면 이동하지 않고 정상적으로 페이지를 스크롤할 수 있도록 합니다. 사용자는 확대/축소 컨트롤을 클릭하여 지도를 확대/축소할 수 있습니다. 또한 터치 스크린 기기에서 지도를 두 손가락으로 움직여 확대/축소하고 화면 이동할 수도 있습니다.
gestureHandling 옵션이 없는 페이지 상단 지도의 동작은 이 페이지의 모든 지도가 <iframe> 내에 있기 때문에 gestureHandling이 cooperative로 설정된 이전 지도와 동일합니다. 기본 gesturehandling 값 auto는 지도가 <iframe> 내에 포함되어 있는지에 따라 greedy나 cooperative로 전환됩니다.
지도가 <iframe> 내에 포함됨
동작
예
cooperative
아니요
greedy
gestureHandling: greedy
다음은 gestureHandling이 greedy로 설정된 지도입니다. 이 지도는 cooperative와 달리 모든 터치 동작과 스크롤 이벤트에 반응합니다.
[[["이해하기 쉬움","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\u003eThis documentation explains how to control user interactions, such as zoom and pan, on Google Maps using options like \u003ccode\u003egestureHandling\u003c/code\u003e, \u003ccode\u003eminZoom\u003c/code\u003e, \u003ccode\u003emaxZoom\u003c/code\u003e, and \u003ccode\u003erestriction\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egestureHandling\u003c/code\u003e option allows you to manage how the map responds to scroll events and touch gestures, with options like \u003ccode\u003ecooperative\u003c/code\u003e, \u003ccode\u003egreedy\u003c/code\u003e, \u003ccode\u003eauto\u003c/code\u003e, and \u003ccode\u003enone\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can completely disable panning and zooming by setting \u003ccode\u003egestureHandling\u003c/code\u003e to "none" and \u003ccode\u003ezoomControl\u003c/code\u003e to false.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003erestriction\u003c/code\u003e, \u003ccode\u003eminZoom\u003c/code\u003e, and \u003ccode\u003emaxZoom\u003c/code\u003e options can be used to limit the map's viewable area and zoom levels, providing further control over user interaction.\u003c/p\u003e\n"]]],["This content explains how to control user interactions with Google Maps on a webpage. Key actions include using the `MapOptions` interface to define `gestureHandling`, `minZoom`, `maxZoom`, and `restriction`. `gestureHandling` controls how scrolling affects the map, with options like `cooperative`, `auto`, `greedy`, and `none`. To disable map panning and zooming, both `gestureHandling: \"none\"` and `zoomControl: false` must be set. Map boundaries and zoom levels can be restricted using `restriction`, `minZoom`, and `maxZoom` options.\n"],null,[]]