ui.Map.setControlVisibility
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ההגדרה הזו קובעת את מידת החשיפה של אמצעי הבקרה במפה.
מחזירה את ui.Map.
שימוש | החזרות |
---|
Map.setControlVisibility(all, layerList, zoomControl, scaleControl, mapTypeControl, fullscreenControl, drawingToolsControl) | ui.Map |
ארגומנט | סוג | פרטים |
---|
זה: ui.map | ui.Map | המופע ui.Map. |
all | בוליאני, אופציונלי | האם להציג את כל אמצעי הבקרה. הערך False מסתיר את כל אמצעי הבקרה, והערך True מציג את כל אמצעי הבקרה. ההגדרה הזו מבוטלת על ידי פרמטרים שהוגדרו בנפרד. שימו לב: הגדרה מפורשת של ההגדרה הזו תשפיע על כל אמצעי בקרה נוספים שיוגדרו בעתיד. |
layerList | בוליאני, אופציונלי | אם הערך הוא false, החלונית של רשימת השכבות מוסתרת. אם הערך הוא true, הנראות של החלונית נקבעת לפי הנוכחות של שכבות ברשימה. ברירת המחדל היא להציג את הרשימה. |
zoomControl | בוליאני, אופציונלי | האם פקד הזום גלוי. ברירת המחדל היא True. |
scaleControl | בוליאני, אופציונלי | האם להציג את הפקד שמציין את קנה המידה ברמת הזום הנוכחית של המפה. ברירת המחדל היא True. |
mapTypeControl | בוליאני, אופציונלי | האם להציג את אמצעי הבקרה שמאפשר למשתמש לשנות את מפת הבסיס. ברירת המחדל היא True. |
fullscreenControl | בוליאני, אופציונלי | האם להציג את האפשרות שמאפשרת למשתמש להציג את המפה במסך מלא. ברירת המחדל היא True. |
drawingToolsControl | בוליאני, אופציונלי | האם להציג את האפשרות שמאפשרת למשתמש להוסיף או לערוך את כלי השרטוט של הצורות הגיאומטריות. ברירת המחדל היא true אם כלי השרטוט נוספו בעבר למפה. המערכת מתעלמת מהפרמטר הזה אם כלי השרטוט לא נוספו למפה לפני כן. |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003eControls the visibility of map elements like zoom, scale, layer list, and map type selection.\u003c/p\u003e\n"],["\u003cp\u003eAllows for customization by showing or hiding individual controls or all at once.\u003c/p\u003e\n"],["\u003cp\u003eUses Boolean values (true/false) to set the visibility of each control element.\u003c/p\u003e\n"],["\u003cp\u003eProvides control over the fullscreen and drawing tools visibility, if enabled on the map.\u003c/p\u003e\n"],["\u003cp\u003eAffects the display of the layer list panel based on the presence of layers and user preference.\u003c/p\u003e\n"]]],["The `Map.setControlVisibility` function modifies the visibility of map controls. It accepts boolean arguments to show or hide controls: `all`, `layerList`, `zoomControl`, `scaleControl`, `mapTypeControl`, `fullscreenControl`, and `drawingToolsControl`. Setting `all` to true/false shows/hides all controls unless overridden. `layerList` determines the visibility of the layer list panel. The function returns the modified `ui.Map` instance, and each control defaults to visible (true), except `drawingToolsControl` that needs the drawing tools to have been added before.\n"],null,["# ui.Map.setControlVisibility\n\n\u003cbr /\u003e\n\nSets the visibility of the controls on the map.\n\n\u003cbr /\u003e\n\nReturns this ui.Map.\n\n| Usage | Returns |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| Map.setControlVisibility`(`*all* `, `*layerList* `, `*zoomControl* `, `*scaleControl* `, `*mapTypeControl* `, `*fullscreenControl* `, `*drawingToolsControl*`)` | ui.Map |\n\n| Argument | Type | Details |\n|-----------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.map` | ui.Map | The ui.Map instance. |\n| `all` | Boolean, optional | Whether to show all controls. False hides all controls; true shows all controls. Overridden by individually set parameters. Note that setting this explicitly will affect any additional controls added in the future. |\n| `layerList` | Boolean, optional | When false, hides the layer list panel or, when true, allows the layer list panel's visibility to be determined by the presence of layers in the list. The default is to show the list. |\n| `zoomControl` | Boolean, optional | Whether the zoom control is visible. Defaults to true. |\n| `scaleControl` | Boolean, optional | Whether to show the control which indicates the scale at the map's current zoom level. Defaults to true. |\n| `mapTypeControl` | Boolean, optional | Whether to show the control that allows the user to change the base map. Defaults to true. |\n| `fullscreenControl` | Boolean, optional | Whether to show the control that allows the user to make the map full-screen. Defaults to true. |\n| `drawingToolsControl` | Boolean, optional | Whether to show the control that allows the user to add or edit the geometry drawing tools. Defaults to true if the drawing tools were previously added to the map. Ignored if the drawing tools were not previously added to the map. |"]]