Customize the Map Marker
Overview
Welcome to the tutorial on customizing the map marker in the Avonni Map Component. This guide will walk you through the Avonni Map Component, focusing on the "Type" attribute that opens up a world of customization possibilities for your map markers.
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FTwerUtQ8FzMoGVZqD41G%252F2024-03-20_20-15-21%2520%281%29.gif%3Falt%3Dmedia%26token%3D28e13f37-bcb4-4afe-ac2d-4a4164ab3c3a&width=768&dpr=4&quality=100&sign=8d848008&sv=1)
First, install the Avonni Components app from the AppExchange to customize your map markers. This unlocks a whole new world of map design possibilities.
How to customize the Map Marker
In the Data Mappings section, the 'Type' attribute controls how locations are represented on your map. Here are the marker types you can choose from:
Default: The standard map marker style.
Circle: A circular marker that highlights a specific radius around a location.
Rectangle: A rectangular marker, good for defining boundaries or areas.
Polygon: A flexible shape with multiple sides, ideal for outlining irregular areas.
Custom Icon: Use your image file to create a unique marker.
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FBEnoo6kYL0TCL75rR1Wx%252F2024-03-19_20-34-54.png%3Falt%3Dmedia%26token%3De2c223f3-d301-4e40-a1c4-163fb16b13a4&width=768&dpr=4&quality=100&sign=a5fc4420&sv=1)
Customize your map markers: Change size, shape, color, and more
If you choose a map marker type other than "Default," you can customize the following attributes:
Radius: Controls the size of circle markers.
Stroke Color: The color of the marker's outline.
Stroke Opacity: How transparent the outline is (from completely solid to invisible).
Stroke Weight: The thickness of the marker's outline.
Fill Color: The color that fills in the marker.
Fill Opacity: How transparent the fill color is (from completely solid to invisible)
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FswEW3CP9OCw9pUUuQbtP%252F2024-03-19_21-07-18.png%3Falt%3Dmedia%26token%3Dfab522ae-8d9e-4d52-b043-a5ba6614dd1e&width=768&dpr=4&quality=100&sign=3b4a7458&sv=1)
Use Case Example
Do you want your map markers to represent different types of data visually? You can customize marker colors based on specific field values.
Example: Color-Coding Accounts by Industry
Let's say you want to display Salesforce account locations on an Avonni Map using circle markers. You can make the circle's outline color change dynamically based on the account's industry:
Banking Accounts: Display with a blue outline
Manufacturing Accounts: Display with a red outline
And so on...
Step 1: Create a Formula Field to Determine Color
We need a way to tell the Avonni Map which color to use for each marker. To do this, create a custom formula field on your mapping object. This formula will translate field values (like "Banking") into specific color codes.
Example Formula for Industry-Based Colors:
Understanding the Formula Structure
IF statements: The formula's core is a series of nested "IF" statements. Each IF statement checks a condition and returns a value if the condition is true.
ISPICKVAL: This function checks if a picklist field (like "Industry") has a specific value.
Color Codes: Values like '#ba0517' are hexadecimal color codes representing red. The formula assigns a different color code to each industry.
Default color: The final '#000000' acts as a default (black) in case the Industry value doesn't match any of the specified options.
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FwkN6i6YL5EIhF9unWOu6%252F2024-03-19_20-50-42.png%3Falt%3Dmedia%26token%3D51e25e47-1eca-4032-be98-61f7c549df94&width=768&dpr=4&quality=100&sign=8f5879e8&sv=1)
Step 2: Connect your formula field to the map marker's color setting
Tell the map to use your formula field to determine marker colors. In the Avonni Map settings, find the marker attribute setting (like 'Stroke Color') and select your newly created formula field as the value.
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FragUaGy0O1KNWcXJ4YXJ%252F2024-03-19_21-03-33%2520%281%29.gif%3Falt%3Dmedia%26token%3D84d0b7c3-cbbc-4627-a707-41feabef1e86&width=768&dpr=4&quality=100&sign=5408eddb&sv=1)
That's it! You've successfully made your map markers change dynamically based on your formula field. Now your map tells a more insightful story at a glance.
Tip: This same process works for other marker attributes too! Customize size, shape, fill color, and more by linking them to different fields or variables in your data.
Final Result
![](https://flow.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FTwerUtQ8FzMoGVZqD41G%252F2024-03-20_20-15-21%2520%281%29.gif%3Falt%3Dmedia%26token%3D28e13f37-bcb4-4afe-ac2d-4a4164ab3c3a&width=768&dpr=4&quality=100&sign=8d848008&sv=1)
Related Video tutorial
Last updated