# Button control

## Button Visibility

You can toggle the visibility of control buttons with the following functions.

{% tabs %}
{% tab title="Before loading the map" %}

```
    let LatLng = {lat: 37.482901, lng: 126.896038};
    let mapInstance = new fatosmap.maps.Map(
        document.getElementById("app"),
        {
            zoom: 14,
            center: LatLng,
            maxZoom: 20,
            minZoom: 2,
            key: 'YOUR_API_KEY'
            
            // button 
            buttonControl: false, // Remove all buttons. Default true. 
            btnTheme: false, // Remove the theme button. Default true.
            btnPitch: false, // Remove the pitch(3D) button. Default true.
            btnBuilding3d: false, // Remove the building button. Default true.
            btnZoom: false, // Remove the zoom button. Default true.
            btnCompass: false, // Remove the compass button. Default true.
            btnBering: false, // Remove the bering button. Default true.
            btnDistance: false, // Remove the distance button. Default true.
            btnArea: false, // Remove the area button. Default true.
            btnRadius: false, // Remove the radius button. Default true.
            btnFullScreen: false, // Remove the fullScreen button. Default true.
            btnGeoLocate: false, // Remove the geoLocate button. Default true.
            btnTraffic: false, // Remove the traffic button. Default true.
        }
    )
```

{% endtab %}

{% tab title="After loading the map" %}

```
/*
You can create or remove a button bar at the top right of 
the map with all buttons.
*/
mapInstance.onBtnAll();
mapInstance.offBtnAll();

// Theme Button.
mapInstance.onBtnTheme();
mapInstance.offBtnTheme();

// Pitch button.
mapInstance.onBtnPitch();
mapInstance.offBtnPitch();

// Building button.
mapInstance.onBtnBuilding3d();
mapInstance.offBtnBuilding3d();

// Zoom-in and zoom-out button.
mapInstance.onBtnZoom();
mapInstance.offBtnZoom();

// Compass button.
mapInstance.onBtnCompass();
mapInstance.offBtnCompass();

// Bering button.
mapInstance.onBtnBering();
mapInstance.offBtnBering();

// Radius button.
mapInstance.onBtnRadius();
mapInstance.offBtnRadius();

// Area Button.
mapInstance.onBtnArea();
mapInstance.offBtnArea();

// Distance Button.
mapInstance.onBtnDistance();
mapInstance.offBtnDistance();

// Full-screen button.
mapInstance.onBtnFullScreen();
mapInstance.offBtnFullScreen();

// Geographic location button.
mapInstance.onBtnGeoLocate();
mapInstance.offBtnGeoLocate();

// Traffic button.
mapInstance.onBtnTraffic();
mapInstance.offBtnTraffic();
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nostramap-doc.fatos.biz/fatos-api/map/button-control.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
