Map.setControlVisibility
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Legt die Sichtbarkeit der Steuerelemente auf der Karte fest.
Gibt diese ui.Map zurück.
Nutzung | Ausgabe |
---|
Map.setControlVisibility(all, layerList, zoomControl, scaleControl, mapTypeControl, fullscreenControl, drawingToolsControl) | ui.Map |
Argument | Typ | Details |
---|
all | Boolesch, optional | Gibt an, ob alle Steuerelemente angezeigt werden sollen. Bei „false“ werden alle Steuerelemente ausgeblendet, bei „true“ werden alle Steuerelemente eingeblendet. Wird durch individuell festgelegte Parameter überschrieben. Wenn Sie diese Einstellung explizit festlegen, wirkt sich das auf alle zusätzlichen Steuerelemente aus, die in Zukunft hinzugefügt werden. |
layerList | Boolesch, optional | Wenn „false“, wird der Bereich „Ebenenliste“ ausgeblendet. Wenn „true“, wird die Sichtbarkeit des Bereichs „Ebenenliste“ durch das Vorhandensein von Ebenen in der Liste bestimmt. Standardmäßig wird die Liste angezeigt. |
zoomControl | Boolesch, optional | Gibt an, ob die Zoom-Steuerung sichtbar ist. Der Standardwert ist „true“. |
scaleControl | Boolesch, optional | Gibt an, ob das Steuerelement angezeigt werden soll, das den Maßstab bei der aktuellen Zoomstufe der Karte angibt. Der Standardwert ist „true“. |
mapTypeControl | Boolesch, optional | Gibt an, ob das Steuerelement angezeigt werden soll, mit dem der Nutzer die Basiskarte ändern kann. Der Standardwert ist „true“. |
fullscreenControl | Boolesch, optional | Gibt an, ob das Steuerelement angezeigt werden soll, mit dem der Nutzer die Karte im Vollbildmodus darstellen kann. Der Standardwert ist „true“. |
drawingToolsControl | Boolesch, optional | Gibt an, ob das Steuerelement angezeigt werden soll, mit dem der Nutzer die Geometrie-Zeichentools hinzufügen oder bearbeiten kann. Der Standardwert ist „true“. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003e\u003ccode\u003eMap.setControlVisibility()\u003c/code\u003e allows customization of the visibility of map controls, such as zoom, scale, layer list, map type, fullscreen, and drawing tools.\u003c/p\u003e\n"],["\u003cp\u003eControl visibility can be set individually for each control or globally using the \u003ccode\u003eall\u003c/code\u003e parameter, with individual settings overriding the global setting.\u003c/p\u003e\n"],["\u003cp\u003eBy default, all map controls are visible; setting \u003ccode\u003eall\u003c/code\u003e to \u003ccode\u003efalse\u003c/code\u003e will hide all controls, while setting it to \u003ccode\u003etrue\u003c/code\u003e will show all.\u003c/p\u003e\n"],["\u003cp\u003eThe layer list's visibility is influenced by the presence of layers and can be further customized using the \u003ccode\u003elayerList\u003c/code\u003e parameter.\u003c/p\u003e\n"]]],["The `Map.setControlVisibility` function sets the visibility of map controls. It accepts boolean arguments: `all`, `layerList`, `zoomControl`, `scaleControl`, `mapTypeControl`, `fullscreenControl`, and `drawingToolsControl`. `all` toggles all controls, while the others manage individual controls. Defaults for all controls except the layer list are set to show, the default for the layer list is to show if layers are present. The function returns the `ui.Map` object.\n"],null,["# 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| `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. |"]]