Defines a marker to be displayed at a location on an <apex:map>.
Note: This component must be enclosed within an <apex:map> component. You can add up to 100 <apex:mapMarker> components to a single map.
<apex:page standardController="Account"> <!-- This page must be accessed with an Account Id in the URL. For example: https://<salesforceInstance>/apex/NearbyContacts?id=001D000000JRBet --> <apex:pageBlock > <apex:pageBlockSection title="Contacts For {! Account.Name }"> <apex:dataList value="{! Account.Contacts }" var="contact"> <apex:outputText value="{! contact.Name }" /> </apex:dataList> </apex:pageBlockSection> </apex:pageBlock> <apex:map width="600px" height="400px" mapType="roadmap" center="{!Account.BillingStreet},{!Account.BillingCity},{!Account.BillingState}"> <apex:repeat value="{! Account.Contacts }" var="contact"> <apex:mapMarker title="{! contact.Name }" position="{!contact.MailingStreet},{!contact.MailingCity},{!contact.MailingState}" /> </apex:repeat> </apex:map> </apex:page>
Attribute Name | Attribute Type | Description | Required? | API Version | Access |
---|---|---|---|---|---|
icon | String | Absolute URL of the icon to be displayed at the location. When using static resources, URLFOR function must be used. | 34.0 | ||
id | String | An identifier that allows other components in the page to reference this component. | 32.0 | global | |
position | Object | Specifies the location of the marker. There are several ways to define the location:
Note: There’s a limit of 10 geocoded address lookups per page request. Lookups for both the center attribute of the <apex:map> component and the position attribute of the <apex:mapMarker> component count against this limit. The limit is per page request, not per map. Additional map centers or marker positions must provide actual latitude and longitude values, or they’ll be skipped. |
Yes | 32.0 | |
rendered | Boolean | A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. | 32.0 | ||
title | String | Text to display when the user's cursor moves over the marker. That is, when the marker's mouseover event is triggered. | 32.0 |