ui.Map.setGestureHandling
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस विकल्प से यह कंट्रोल किया जाता है कि मैप पर जेस्चर कैसे हैंडल किए जाते हैं.
https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.gestureHandling पर जाएं.
इस्तेमाल | रिटर्न |
---|
Map.setGestureHandling(option) | |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: ui.map | ui.Map | ui.Map इंस्टेंस. |
option | स्ट्रिंग | यह विकल्प कंट्रोल करता है कि मैप पर जेस्चर कैसे हैंडल किए जाते हैं. इस्तेमाल की जा सकने वाली वैल्यू:
- "cooperative": स्क्रोल इवेंट और एक उंगली से किए गए टच जेस्चर से पेज स्क्रोल होता है. इससे मैप ज़ूम या पैन नहीं होता. दो उंगलियों से टच जेस्चर करने पर, मैप को पैन और ज़ूम किया जा सकता है. ctrl या ⌘ बटन दबाकर स्क्रोल करने से, मैप ज़ूम होता है. इस मोड में मैप, पेज के साथ काम करता है.
- "greedy": सभी टच जेस्चर और स्क्रोल इवेंट, मैप को पैन या ज़ूम करते हैं.
- "none": उपयोगकर्ता के जेस्चर से मैप को पैन या ज़ूम नहीं किया जा सकता.
- "auto": (डिफ़ॉल्ट) जेस्चर हैंडलिंग, सहयोगी या लालची होती है. यह इस बात पर निर्भर करती है कि पेज को स्क्रोल किया जा सकता है या वह iframe में है.
|
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eDefines how users interact with the map through gestures like scrolling, panning, and zooming.\u003c/p\u003e\n"],["\u003cp\u003eOffers four options: "cooperative", "greedy", "none", and the default "auto", to control gesture behavior.\u003c/p\u003e\n"],["\u003cp\u003e"Cooperative" mode prioritizes page scrolling over map interaction for single-finger gestures, while "greedy" mode prioritizes map interactions for all gestures.\u003c/p\u003e\n"],["\u003cp\u003eAllows developers to disable all gestures with the "none" option or let the map automatically determine the best gesture handling based on context with "auto".\u003c/p\u003e\n"],["\u003cp\u003eCan be set using the \u003ccode\u003eMap.setGestureHandling(option)\u003c/code\u003e method, where 'option' is one of the allowed string values.\u003c/p\u003e\n"]]],[],null,["# ui.Map.setGestureHandling\n\n\u003cbr /\u003e\n\nControls how gestures are handled on the map.\n\n\u003cbr /\u003e\n\nSee https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.gestureHandling.\n\n| Usage | Returns |\n|----------------------------------|---------|\n| Map.setGestureHandling`(option)` | |\n\n| Argument | Type | Details |\n|----------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.map` | ui.Map | The ui.Map instance. |\n| `option` | String | The option that controls how gestures are handled on the map. Allowed values: - \"cooperative\": Scroll events and one-finger touch gestures scroll the page, and do not zoom or pan the map. Two-finger touch gestures pan and zoom the map. Scroll events with a ctrl key or ⌘ key pressed zoom the map. In this mode the map cooperates with the page. - \"greedy\": All touch gestures and scroll events pan or zoom the map. - \"none\": The map cannot be panned or zoomed by user gestures. - \"auto\": (default) Gesture handling is either cooperative or greedy, depending on whether the page is scrollable or in an iframe. |"]]