> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/map/show-account-details-on-marker-select.md).

# Show Account Details on Marker Select

Let Salesforce users select Account markers on a Leaflet map and inspect the matching record in the Avonni Map details panel.

A field rep wants to confirm which customer they are looking at before a visit. Add the built-in details panel to an Avonni Map. The rep opens the panel from the map header, then selects a marker to read the Salesforce Account alongside the map.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FRTJN9cWdEQMuz1vpO6QO%2Fshow-account-details-on-marker-select-result.jpg?alt=media" alt="The Blue Finch Retail popup on the map and the Details panel showing Retail as the selected Account&#x27;s industry."><figcaption><p>Selecting another marker replaces the record in the open details panel. Map data © OpenStreetMap contributors.</p></figcaption></figure>

## Before you start

* Start with the query-backed Leaflet map from [Map Accounts by Industry](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/map/map-accounts-by-industry.md). Make a test copy if the original is already in use. The pin colors are optional.
* Pick two Accounts at different locations whose Salesforce details are easy to distinguish. This example uses Atlas Logistics in Transportation and Blue Finch Retail in Retail. The viewer needs access to both records.

## Steps

{% stepper %}
{% step %}

### Map each marker to its Account

1. Select the Map in Component Builder and open **Properties**. Verify that **Data Source** uses an **Account** query.
2. In **Data Mappings**, confirm **Title** uses Account Name (`Name`) and **Value** uses Account ID (`Id`).
3. Check **Location** > **Latitude** and **Longitude**. They should use `BillingLatitude` and `BillingLongitude`.
   {% endstep %}

{% step %}

### Add the details button

1. In **Properties**, open **Header** and set **Title** to `Account locations`.
2. Enable **Show More Details Panel**. Leave **Hide Actions** and **Disable Actions** off so the header button is usable.
3. Keep **Show Route Panel** off for this map so the test starts in marker selection mode.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FC0CFMI5o6aw4PyHoOtJV%2Fshow-account-details-on-marker-select-header.jpg?alt=media" alt="Map Header settings with Show More Details Panel enabled and both Hide Actions and Disable Actions off." width="320"><figcaption><p>Show More Details Panel adds the button to the map header.</p></figcaption></figure>
{% endstep %}

{% step %}

### Save and test

1. Save and activate the Dynamic Component. Place it on a test Lightning page and open the activated page.
2. Open Atlas Logistics and Blue Finch Retail in Salesforce and note a visible field that differs, such as Industry.
3. On the map, choose **Show more details** in the header. Click the Atlas Logistics marker and compare the record name and field value in the panel with Salesforce.
4. Click the Blue Finch Retail marker. Check that the same panel switches to Blue Finch Retail and shows its value. Select Atlas Logistics again to check that the panel switches back.
5. Close the panel. Select another marker and confirm the panel stays closed until you reopen it from the header.
   {% endstep %}
   {% endstepper %}

## Troubleshooting

* **The button is missing or disabled.** Check **Show More Details Panel**, **Hide Actions** and **Disable Actions** under **Header**.
* **The panel does not follow the marker.** Open it from the header, use a query-backed marker, and map **Value** to `Id`. Check that the viewer can open the corresponding Salesforce record directly.
* **A click adds a route stop.** Close the **Route** panel before selecting records for inspection.

## Related tutorials

* [Map Accounts by Industry](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/map/map-accounts-by-industry.md) builds the query and marker mappings used here.
* [Reactive Map and Data Table](https://docs.avonnicomponents.com/dynamic-components/tutorials/reactive-components/maps-and-geolocation/reactive-map-and-data-table.md) starts with a Data Table selection and shows the chosen Account on a map.
* [Map](https://docs.avonnicomponents.com/dynamic-components/components/map.md) lists the header settings and marker outputs.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/dynamic-components/tutorials/components/map/show-account-details-on-marker-select.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
