Defines an info window for the marker displayed at a location on an <apex:map>.
Note: This component must be enclosed within an <apex:mapMarker> component.
<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:mapInfoWindow> <apex:outputPanel layout="block" style="font-weight: bold;"> <apex:outputText>{! contact.Name }</apex:outputText> </apex:outputPanel> <apex:outputPanel layout="block"> <apex:outputText>{!contact.MailingStreet},{!contact.MailingCity},{!contact.MailingState}</apex:outputText> </apex:outputPanel> </apex:mapInfoWindow> </apex:mapMarker> </apex:repeat> </apex:map> </apex:page>
Attribute Name | Attribute Type | Description | Required? | API Version | Access |
---|---|---|---|---|---|
id | String | An identifier that allows other components in the page to reference this component. | 34.0 | global | |
maxWidth | Integer | Maximum width of the info window, regardless of content's width. | 34.0 | ||
rendered | Boolean | A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. | 34.0 |