Newer Version Available
apex:mapInfoWindow
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.
Map of Contacts for an Account
1<apex:page standardController="Account">
2
3 <!-- This page must be accessed with an Account Id in the URL. For example:
4 https://<salesforceInstance>/apex/NearbyContacts?id=001D000000JRBet -->
5
6 <apex:pageBlock >
7 <apex:pageBlockSection title="Contacts For {! Account.Name }">
8
9 <apex:dataList value="{! Account.Contacts }" var="contact">
10 <apex:outputText value="{! contact.Name }" />
11 </apex:dataList>
12
13 </apex:pageBlockSection>
14 </apex:pageBlock>
15
16 <apex:map width="600px" height="400px" mapType="roadmap"
17 center="{!Account.BillingStreet},{!Account.BillingCity},{!Account.BillingState}">
18
19 <apex:repeat value="{! Account.Contacts }" var="contact">
20 <apex:mapMarker title="{! contact.Name }"
21 position="{!contact.MailingStreet},{!contact.MailingCity},{!contact.MailingState}"
22 >
23 <apex:mapInfoWindow>
24 <apex:outputPanel layout="block" style="font-weight: bold;">
25 <apex:outputText>{! contact.Name }</apex:outputText>
26 </apex:outputPanel>
27 <apex:outputPanel layout="block">
28 <apex:outputText>{!contact.MailingStreet},{!contact.MailingCity},{!contact.MailingState}</apex:outputText>
29 </apex:outputPanel>
30 </apex:mapInfoWindow>
31 </apex:mapMarker>
32 </apex:repeat>
33
34 </apex:map>
35
36</apex:page>Attributes
| 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 |