For the complete documentation index, see llms.txt. This page is also available as Markdown.
Updated

Map

Overview

Use Avonni Map to show Salesforce records as locations on Google Maps or Leaflet. Choose pins or shapes, then add tools such as search, filters, or a details panel. Leaflet also supports clustering, drawing, and route planning.

Tutorials

Browse the Map tutorial hub for builds that start with Salesforce records.

To start with a Data Table selection, see Reactive Map and Data Table.

Choose a map type

Your records or workflow
Type

Records have street addresses and you need the list beside the map

Google Maps

Records already have latitude and longitude and you need clusters, drawing, or route planning

Leaflet

Projects

See how Map fits into a complete Salesforce workflow. Each project includes steps to build it with AI or manually.

Cover

Put the technician timeline and the map of the day's jobs on one screen, from one query.

Configuration

Select the Map on the canvas to open the Edit Map panel (Properties, Interactions, Style). The sections below follow the Properties tab; its groups depend on the map Type.

Data Source

Where the map gets its locations.

Manual

Enter data directly into the component configuration.

Variable

This is useful for data that changes based on user interactions or other component logic.

Query

This is the most common option for displaying Salesforce records.

Data Mapping

With a Query or Variable source, map your Salesforce fields to the marker attributes.

Location: address fields, or Latitude and Longitude.

Location: Latitude and Longitude, no address fields, plus an optional City for the route stop list and route file. Image Source, Infos (links: Label, URL) and Fields fill the popup.

Data Mappings section of the Edit Map panel for a Leaflet map that reads Account records from a query. Title maps to Account Name, Description to the Industry field, Type is Default, Location maps Latitude, Longitude and City to the billing fields, Image Source maps to Photo URL, Infos holds one item named Visit website, Fields lists Industry and Employees, and Value maps to Id.

Type sets the marker shape, the styling fields its fill color, stroke and scale. Map them to formula fields to color-code markers, for example Accounts by industry.

A Leaflet map of the west side of Chicago with six markers in two rows. Top row, left to right: a red pin, a blue pin and a blue circle. Bottom row: a blue rectangle, a blue pentagon and an orange star.
Top: Default, Pin, Circle. Bottom: Rectangle, Polygon, Custom Icon (an SVG star).
Type
Draws
Needs

Default

Standard map pin

Circle

Circular area

Radius, in meters

Rectangle

Rectangular area

Bounds: north, south, east, west

Polygon

Multi-sided shape

Paths: latitude and longitude points

Pin

Classic pin, icon styling

Custom Icon

Fully custom icon

SVG path

Mapping
What it does

Filters

Fields offered as filters. Only these appear in the filter menu.

Search Fields

Mapped fields the search covers. Default: every searchable mapped field.

Content

Type

Google Maps (default) geocodes addresses: best under 100 markers. Leaflet, open source, handles thousands of markers and adds clustering, drawing, route planning and GeoJSON.

Five Chicago customer sites on Google Maps: four red pins near the lakeshore, from Edgewater in the north to just southwest of the Loop, and a blue circle over Hyde Park. The Map and Satellite buttons sit at the top left, the Street View and zoom controls on the right.
Shape markers, like this circle, work on Google Maps too.
The same five Chicago customer sites on a Leaflet map with OpenStreetMap tiles: four red pins near the lakeshore and a blue circle over Hyde Park. The popup of the northern pin is open and reads Northwind Traders, Andersonville office. Zoom buttons sit at the bottom right.
The same records on Leaflet, one popup open.
Google Maps
Leaflet

Marker position

Address, or latitude and longitude

Latitude and longitude only

Map Center Location

Coordinates or address

Coordinates

Own groups

None

Marker Clustering, Draw, Route, Popup, Image

With Leaflet, add https://tile.openstreetmap.org to Trusted Sites in your Salesforce org, or the map tiles do not load.

Display and Controls

Setting
What it does
Only on

List View

List beside the map: Visible, Hidden or Auto (default, shown with several markers).

Google Maps

List Title

Heading above the list.

Google Maps

Zoom Level

Initial zoom, 0 (world) to 23 (building).

Disable Dragging

No panning.

Disable Scroll Wheel Zooming, Disable Double Click Zoom

No zoom by scroll wheel, or by double-click. Only while dragging is allowed.

Hide Zoom Controls

No zoom buttons.

Disable Default UI

No Map and Satellite buttons.

Google Maps

Show Footer

Footer bar below the map.

Google Maps

Zoom Controls Position

Bottom Right (default), Bottom Left, Top Right, Top Left.

Leaflet

Tile Layer

Custom tile URL template, replacing OpenStreetMap.

Leaflet

Selected Marker Value

Marker pre-selected on load, by value, for example a list's selected record.

Enable Multi-Select Markers

Ctrl+click (Cmd+click on a Mac) selects several markers, returned in Selected Markers sObject.

Leaflet

A Google map of Chicago with five red pins and, on its right, a list titled Customer Sites (5). Each entry has a green location icon, the site name as a link and its address: Atlas Logistics, 300 W Adams St, Chicago, IL; Blue Finch Retail, 2200 N Clark St; Northwind Traders, 5300 N Clark St; Redwood Supply Co, 1800 S Halsted St; Juniper Health, 1500 E 53rd St.
List View: each entry shows the marker title and address.

Map Center Location

Where the map centers on load. Bind any field to a Variable resource to move the center as the end user works on the page.

Setting
What it does
Only on

Latitude, Longitude

Decimal coordinates.

Street, City, State, Postal Code, Country

Center geocoded from an address.

Google Maps

Display As Marker

Center marker: one of the six marker types, with its attributes.

Marker Clustering (Leaflet only)

Groups nearby markers into numbered clusters, so large datasets stay fast and readable.

A Leaflet map of the Chicago area with forty customer sites grouped into clusters. Green circles read 4, 6, 5, 5 and 2, a yellow circle over downtown Chicago reads 17, and one site near Naperville, with no neighbour close enough, shows as a plain marker.
Each cluster counts its markers; a lone marker stays plain.
Setting
What it does

Enable Marker Clustering

Clustering on.

Coverage On Hover

Hovering a cluster outlines its markers' area.

Max Cluster Radius

Max distance, in pixels, from the central marker. Default 80.

Disable Clustering Zoom Level

No clustering at this zoom and below.

Draw (Leaflet only)

End users draw shapes, a sales territory for example, and can save them as a Salesforce file.

A Leaflet map titled Sales territories with five red markers in Chicago. A polygon outlined and filled in blue covers the north side and two of the markers. At the bottom right, the drawing toolbar shows Line, Polygon, Circle and Marker buttons, then Edit and Delete, above the zoom buttons, and a Save button sits in the bottom right corner of the map.
A territory loaded from GeoJSON, the toolbar and the Save button.
Setting
What it does

Enable Draw

Drawing toolbar on. Updates the Draw GeoJSON Value output.

Draw GeoJSON Value

Shapes pre-loaded on the map (GeoJSON object or array). Hidden when saving as a file.

Toolbar

Line, Polygon, Circle, Marker, Edit, Delete. Requires Enable Draw.

Toolbar Position

Bottom Right (default), Bottom Left, Top Right, Top Left.

Save as Content Document

Saves the drawing as a Salesforce file (ContentDocument). Requires Enable Draw; the five settings below require it.

Auto Save Content Document

Saves with no button click.

Content Document Id

Existing file to update instead of a new one.

Content Document Title

File title. Default "Avonni Map Drawing Document".

Content Document Linked Entity Id

Record the file is linked to.

Save Button Label

Manual save button. Default "Save".

Route (Leaflet only)

End users turn the map's markers into a multi-stop driving route, then open each stop in a navigation app or export the itinerary.

A map of Chicago with five numbered stops joined by a driving route. The Route panel on the right lists the five stops in order with an arrival time for each stop after the first, and shows the departure and arrival times, the total duration, and the Optimize and Clear actions.
A calculated route, panel overlaid. With Mapbox, each stop shows its arrival time.

Routing is enabled once per package by an administrator, with your own routing provider API key. Until then, the Route group shows enablement guidance: see Enable Map Routing.

Route Group Settings

The settings below Show Route Panel require it.

Edit Map panel in the Component Builder, Properties tab of a Leaflet map. Data Source, Content, Map Center Location, Marker Clustering and Draw are folded. The Route group is open: Show Route Panel on, Disable Multi-Stop Selection off, Position set to Right, Display Overlaid on the Map on, Opened by Default on. Header, Popup, Image, Filter and Search are folded below it.
Setting
What it does

Show Route Panel

Route button (route icon) in the header actions, opening the Route panel.

Disable Multi-Stop Selection

No Add Multiple Stops: one marker at a time.

Position

Right (default) or Left.

Display Overlaid on the Map

Panel over the map, Route button on the map (in the header on a narrow map, such as a phone).

Opened by Default

Panel open on load.

A Leaflet map titled Customer visits with the Route panel as a column on its right, outside the map. In the header, the Route button is selected. Five numbered stops in Chicago are joined by straight lines in the order of the list, and the panel lists them under Starting point, with Settings and the Calculate route button below.
Not overlaid: a column beside the map, toggled by the Route button. Straight lines until calculated.

In the Route Panel

1

Add stops

Click a marker or its popup's Add Stop (Remove Stop undoes it), or draw a rectangle or lasso with Add Multiple Stops. Up to 25 stops; at the limit the panel says so.

Part of a Leaflet map with the Route panel open. At the top of the map, Add Multiple Stops has opened into two buttons, a rectangle tool, selected, and a lasso tool. Two stops, Atlas Logistics and Blue Finch Retail, are numbered 1 and 2 on the map and listed in the panel above Settings and Calculate route. Three markers not yet in the route are still red pins.
2

Choose a starting point

Any record on the map, or My position (the browser's location).

3

Reorder or optimize

Drag the stops into order, or click Optimize to ask for a suggested order. The first stop, or the starting point, stays first. Undo, Redo and Clear sit in the panel header.

4

Calculate the route

Calculate route draws the roads and each stop's distance and drive time from the previous one.

5

Hand off or export

Each stop's menu: Remove, Google Maps, Waze. Once calculated, the download button beside Calculate route saves a CSV.

The Route panel after a five-stop route is calculated: 8:00 AM to 10:49 AM, 2 hr 49 min, then the Starting point search and the five stops with their arrival times. The menu of stop 2, Blue Finch Retail, is open on three actions: Remove, Google Maps and Waze. At the bottom, the Calculate route button is greyed out and a download button sits beside it.

Route Panel Settings

The Route panel with its Settings section open. Lunch start 12:00 p.m., Lunch end 1:00 p.m., End of day 6:00 p.m., Visit duration (minutes) 30, Timing set to Leave at, Date Nov 14, 2026, Time 8:00 a.m., then three switches, Avoid ferries, Avoid highways and Avoid tolls, all off. The Calculate route button sits at the bottom of the panel.
Leave at, with its Date and Time. The other values are defaults.
Setting
What it does
Default

Timing

Leave now, Leave at, Arrive by; the last two add Date and Time. Mapbox only (traffic).

Leave now. Time 8:00 AM

Visit duration (minutes)

Time at each stop, delaying the later ones; first and last stops excluded (ten stops, eight visits).

30

Lunch start, Lunch end

A route under way at lunch start, driving or at a stop, pauses for the window and later stops shift. No break if it leaves after lunch starts. End after start, between departure and end of day.

12:00 PM to 1:00 PM

End of day

Last time on the road. A later stop turns orange (marker, drive, number), flagged Past end of day. None is dropped.

6:00 PM

Avoid ferries, Avoid highways, Avoid tolls

Sent to the provider and the Google Maps links.

Off

A Leaflet map titled Customer visits with five numbered stops in Chicago and the calculated driving route. The Route panel on the right reads 11:00 AM to 3:08 PM, 4 hr 8 min, followed by a red note: This route finishes after the end of day. Remove a stop, or start earlier. Stops 1 to 4 are blue and show their arrival times. Stop 5, Juniper Health, is orange, arrives at 3:08 PM and is flagged Past end of day, and the last leg of the route, from stop 4 to stop 5, is drawn in orange.
Past the end of day: orange stop and drive, and a note to remove a stop or start earlier.
Optimize, arrival times, navigation and CSV export

Optimize. When Mapbox optimization is enabled and available for the stop count, Mapbox suggests an order. If provider optimization is unavailable, the map suggests an order based on proximity. See Enable Map Routing for the provider settings.

Arrival times. Mapbox only (traffic model): departure, arrival, total and per stop, visits and lunch included, so the total is the length of the day.

Navigation is per stop. A directions URL holds nine waypoints at most, three on mobile; one stop at a time has no ceiling and works on every device.

CSV. route_<date>.csv: Stop Number, Record Name, City (from the City mapping), Arrival Time (when the provider supplied it), Distance (km), Duration (min), Google Maps, Waze. Whether its link columns are tappable depends on the app: CSV has no hyperlink format.

A title bar above the map, with header actions.

The header of a Leaflet map: a green location icon as the avatar, the caption Plan the day's route from the map above the title Customer visits, and on the right two action buttons, Log Visit and Share, followed by an open menu that holds a third action, Refresh. The top of the map, with two red markers, shows below.
Visible Actions Buttons at 2: the third action moves into the menu.
Setting
What it does

Title

Header heading.

Caption

Smaller label above the title.

Avatar

Image URL, Fallback Icon Name or Initials. Size and variant (Circle, Square) under advanced options.

Help Text

Hoverable info icon.

Is Joined

No bottom border or shadow: flush on the component below.

Actions

Buttons with Label, Name, Icon Name, optional Disabled and Hidden.

Visible Actions Buttons

Buttons shown before the rest overflow into a menu.

Hide Actions, Disable Actions

Hide, or disable without hiding, every action button.

Show More Details Panel

Side panel with record details for the selected marker.

A marker click opens its popup, filled from the Leaflet data mappings.

A Leaflet map titled Customer visits with the popup of Juniper Health open above its marker. The popup shows an illustration across its top, the title Juniper Health, the description Hyde Park clinic, a Visit website link, the fields Industry, Healthcare and Employees, 240, and an Add Stop button. A route button sits at the top right of the map.
Image, link and fields from the data mapping; Add Stop when routing is on.
Setting
Group
What it does

Width

Popup

Maximum width in pixels. 300 when empty.

Image Fallback

Image

Shown when the image fails to load.

Position

Image

Left (default), Right, Top, Bottom, Background.

Size

Image

Small, Medium, Large (default). Width for Left and Right, height otherwise.

Width, Height

Image

Pixels, overriding Size: width for Left and Right, height for Top, Bottom, Background.

Crop Fit

Image

Cover (default), Contain, Fill, None.

Crop Position X / Y

Image

Anchor along each axis, in percent.

Records at the exact same coordinates share one marker whose popup pages through them (arrows, counter), no location edited. Point markers only, not Circle, Rectangle or Polygon; a record with no Title is skipped.

A map marker popup showing the first of three records, with arrows and a 1 / 3 counter
Three accounts registered at one address, all reachable from a single marker.

Filter

How the filter menu appears; fields come from Filters in Data Mapping.

A Leaflet map titled Customer sites with five customer sites in Chicago. A Search sites box sits at the top left of the map and two filter buttons, Industry and Account Type, at the top right. The Industry filter is open and its filter mode menu lists Equals, selected, then Not Equals, Empty and Not Empty, over the list of industries. A Clear link and 5 of 5 sit at the bottom of the filter.
Overlaid search and filters, a Filter mode menu open.
Setting
What it does

Type

Horizontal (default, above the map), Popover (from a filter button) or Panel (side panel).

Display Overlaid on the Map

Filters over the map, not in the header. Horizontal and Popover only; Panel overlays from Side Panel.

Use Record Picklist Values

Picklist options from the loaded records, not the full value set.

Use Cascading Filter Values

An applied filter narrows the others to matching records. Overrides Use Record Picklist Values.

Filter operators

Each filter's Filter mode selector offers operators by field type. Nothing to configure.

Field type
Operators

Text, picklist, multi-select picklist, lookup

Equals (default), Not Equals, Empty, Not Empty

Number, currency, percent, date, date/time, time

Between (default), Not Between, Equals, Not Equals, Less Than, Less or Equal, Greater Than, Greater or Equal, Empty, Not Empty

Checkbox

No selector: always equality

Empty and Not Empty take no value, so they hide the value input.

Finds markers by text.

Setting
What it does

Show Search

Search bar on.

Placeholder

Default "Search". Requires Show Search.

Position

Header Left (default), Right, Center, Fill; Panel (side panel); Overlaid on the Map (back in the header on a narrow map). Requires Show Search.

Side Panel

Holds the filters or search set to Panel. On a narrow map, such as a phone, filters become a popover and search moves to the header.

A Leaflet map titled Customer sites with a side panel on its left. The panel holds a Search sites box, an Industry filter listing Healthcare, Manufacturing, Retail, Technology and Transportation, an Account Type filter with Customer - Direct checked and Prospect unchecked, and a Clear all selections button. Both filters show an Equals filter mode button. The header reads 3 items found, Filtered by Account Type, and carries two actions, Log Visit and Share, and the button that shows or hides the panel. Three markers remain on the map.
Beside the map, by default; Clear all selections resets every filter.
Setting
What it does
Only when

Position

Left (default) or Right.

Display Overlaid on the Map

Panel over the map, opened from a button on it. With the Route panel also overlaid, one is open at a time.

Closed by Default

Starts closed.

Not overlaid

Hide Toggle Button

Hides the header button that opens and closes the panel.

Not overlaid

Opened by Default

Open on load.

Overlaid

Reset Button Label

Button that clears the filters. Default "Clear all selections".

Set Component Visibility

Show or hide the Map on conditions: see Component Visibility.

Interactions

Interactions define what happens when the end user acts on the Map. Set them in the Interactions tab of the Edit Map panel.

Interaction
Fires when the end user
Output
Only on

Marker Select

Clicks a marker. Not with the Route panel open (the click adds a stop; outputs unchanged). At a shared address, outputs follow the record shown; paging does not refire.

Selected Marker, Selected Marker SObject (Query or Variable)

Header Action Click

Clicks the header action set in Target Name.

Clicked Header Action Name

Drawing Created

Completes a drawing, to store or process.

Draw GeoJSON Value

Leaflet

Marker Created

Places a toolbar marker.

Created Marker

Leaflet

Save As Button Click

Clicks the manual save button (drawing saved as a ContentDocument).

Leaflet

Output Variables

Use them elsewhere on the page, for example Selected Marker SObject to show the clicked Account beside the map.

Output variable
Type
Returns
Filled on

Selected Marker

Object

Value, title, description, location (Latitude, Longitude)

Marker click

Selected Marker SObject

Record (SObject)

The marker's record (Query or Variable)

Marker click

Selected Marker Value

Text (String)

The marker's value

Marker click

Selected Markers sObject

Record Collection (SObject[])

Every selected record, with Enable Multi-Select Markers (Query or Variable)

Marker click

Created Marker

Object

New marker's Latitude, Longitude

Toolbar marker (Leaflet)

Draw GeoJSON Value

Text (String)

Drawn shapes as GeoJSON, to persist to a record

Drawing change (Leaflet)

Clicked Header Action Name

Text (String)

Clicked action's name

Header action click

Number of Items

Integer

Markers loaded

Loaded markers change

Visible Width (km)

Integer

Visible width at the current zoom

Center or zoom change

Center Latitude, Center Longitude

Number

Map center

Load; each pan (Leaflet)

Zoom Level

Text (String)

Current zoom

Each zoom (Leaflet)

Styling

Set from the Style tab. "Border" below means Border Color, Size, Style and Radius.

Tab
Styles
Properties
Only on

Margin, Padding

Outer, inner spacing

Top, Right, Bottom, Left

Size

Dimensions

Width, Height

Border

Map border

Border

Header

Header

Background Color; Padding Top, Right, Bottom, Left; Margin Bottom

Filters Panel

Filters and search panel

Panel: Background Color, Border. Labels: Background, Color (each plus Active, Hover), Collapse Icon Color, Font Size, Font Weight. Options: Color, Checkbox Border Color, Load More Button Text Color (plus Active, Hover). Reset Button: Background, Text and Border Color, Border Size, Border Radius; Background and Border Color Hover and Active

Map Markers

Marker popup

Background Color. Title: Text Color, Font Size, Style, Weight. Description: Color, Font Size, Style, Weight, Line Clamp. Info: Text, Link, Link Hover Color, Font Size, Style, Weight. Fields: Background Color, Border, Spacing Inline, Spacing Block. Fields Label, Fields Value: Color, Font Size, Style, Weight

Leaflet

Selected Marker

Selected marker

Scale

Leaflet

Zoom Controls

Zoom buttons

Text, Background, Shadow Color; Border

Leaflet

Draw Controls

Draw toolbar buttons

Background, Shadow Color; Border

Leaflet

Route Panel

Route panel

Panel: Background Color, Border. Header: Background Color, Color, Font Size, Font Weight

Leaflet

Troubleshooting Common Issues

Problem
Cause and fix

No Route button

Routing is Leaflet only: set Type (Content) to Leaflet, turn on Show Route Panel.

The Route group shows enablement guidance

Routing is off for this package: an administrator enables it in the Avonni Components app, Settings tab. See Enable Map Routing.

Straight line instead of roads

Provider unreachable or quota spent (the panel says which); the line keeps the stop order. If every route falls back, activate the Avonni_Route_Mapbox and Avonni_Route_ORS Remote Site Settings.

A stop cannot be routed to

No road near it; the message names it. Fix its coordinates or drop it.

No Timing setting, no arrival times

OpenRouteService has no traffic model: times are Mapbox only, and the CSV omits Arrival Time.


Build with AI

MCP name: dcMap · Toolset: dynamic

Ask your AI assistant: "Create an Avonni Dynamic Component with a Map showing my Accounts as markers, with the list view visible and a search bar."

The avonni-dynamic-components skill generates the component's metadata file locally. Nothing is deployed. Styling hooks are available through the MCP server's get_component_styles tool.

Set up the AI assistant

Last updated

Was this helpful?