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 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 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. |"]]