> For the complete documentation index, see [llms.txt](https://docs.ninox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ninox.com/builder-hub/visualize-and-organize-your-data/create-and-customize-pages/map-component.md).

# Map component

Use a **Map** component on a page to display records with location data. It works well for visits, deliveries, service areas, projects, and site records.

Before you add a Map component, make sure your table has:

* A **Location** field with valid values
* Clear record names so markers are easy to identify
* Fields to filter the records if the map should show only relevant ones

## **Add a Map component to a page**

{% stepper %}
{% step %}
**Open the Add tab**

In the **Settings** panel, open **Add**.
{% endstep %}

{% step %}
**Add Map**

Under **Views**, drag **Map** to the preferred location on the page.
{% endstep %}

{% step %}
**Configure the Map**

In the component **Settings**:

* Choose the source **Table**.
* Select the **Location field** that determines each marker's position.
* Select the **Color field** to use dynamic marker colors.
  {% endstep %}

{% step %}
**Review the displayed markers**

Check whether the expected records appear in the right places.\
Then drag the component to move it on the page.\
Use the resize handles to adjust its size.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
To remove a component from a page, select the component, then click <i class="fa-trash-can">:trash-can:</i> **Delete component** in the blue menu above it.
{% endhint %}

## **Map component settings**

In **Settings**, you can define the basic component details:

* **Label** for the title shown on the component
* **Internal name** is filled automatically. Change it only if needed and carefully. When you script, you use **Internal name**, not **Label**.

Under **Behavior**, configure how the map works on the page:

* **Data point** to set up data retrieval. Use **Manual** to configure it with controls, or **Conditional** to use Ninox Script.\
  \
  If **Data point** is set to **Manual**:
* **Table** to choose the source table
* **Location field** to choose which field places markers on the map
* **Title field** to choose which field Ninox shows if you hold the cursor over the marker
* **Color field** to choose which field defines the marker color
* **Map type** to choose the default map style as **Roadmap**, **Satellite**, **Hybrid**, or **Terrain**
* **Filter** to limit which records users can see with one or more conditions
* **Show search field** to show a search field at the top of the map to search a location\
  \
  If **Data point** is set to **Conditional**:
* **Logic** to add the Ninox Script that retrieves the data.\
  In this case, Ninox expects **key-value pairs** in curly braces **{...}**.

Under **Visibility**, choose how the component is shown on the page:

* **Visible** to show the component on the page
* **Hidden** to hide the component on the page
* **Conditional** to define a **Visibility condition** that controls when the component is shown or hidden

  Use **Conditional** when the map should appear only in specific cases.

  Build the condition based on **Fields** and **Tables**.

  This only affects what is shown on the page. It does not change records or permissions.

{% hint style="info" %}
For the **Logic** under **Data point**, we suggest to use Ninox AI in the [Logic editor](/ninox-scripting/automate-your-workflows/explore-core-scripting-elements/logic-editor-features.md). It will support you to create a script for the required result or get an existing script explained.
{% endhint %}

**Let's take a look at an example:**

{% code lineNumbers="true" %}

```
for r in select customers do
	{
		date: r.location
	}
end
```

{% endcode %}

Use this prompt to create the script with Ninox AI:\
"Please show me the addresses of all customers."


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ninox.com/builder-hub/visualize-and-organize-your-data/create-and-customize-pages/map-component.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
