function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Francesco GuarinoFrancesco Guarino 

Open an Infowindow from Outside the map

Hello, I'm looking for a way to open an Infowindow by clicking a link "Show on map" from outside a google map in a Visualforce page. Here is my code:
<apex:page sidebar="false" standardController="Lead" recordSetVar="leads">
    <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.1.min.js"></script> 
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.3/jquery-ui.min.js"></script> 
    <script>
		$( document ).ready(function() {
			var Call = document.getElementsByClassName('MarkerCallback');
			var marker = document.getElementby
			Call.onclick = generateTriggerCallback(marker,"click");
			
			function generateTriggerCallback(object, eventType) {
				return function() {
					google.maps.event.trigger(object, eventType);
				};
			}
		});
	</script>
       <apex:pageBlock title="Selected Leads">

            <apex:form>
            <apex:pageBlockTable value="{!selected}" var="lead">
                <apex:column>
					<apex:inputCheckbox value="{!lead.id}">
					</apex:inputCheckbox>
				</apex:column>
                <apex:column value="{!lead.name}"/>
                <apex:column value="{!lead.city__c}"/>
                <apex:column value="{!lead.state__c}"/> 
                <apex:column>
					<apex:outputlink value="http://www.maps.google.com/?q={!lead.city__c}+{!lead.street__c}+{!lead.number__c}+{!lead.State__c}" target="_blank">
						Open on Google Maps
					</apex:outputlink>
				</apex:column>
				<apex:column><a href="#" id="{!lead.id}" class="MarkerCallback">Show on map</a>
                </apex:column>
            </apex:pageBlockTable>
            </apex:form>
        </apex:pageBlock>
        <apex:pageBlock>
            <apex:map width="1024px" height="768px" mapType="roadmap"
                center="{!selected[0].street__c},{!selected[0].city__c},{!selected[0].state__c}">

                <apex:repeat value="{! selected }" var="lead">
                    <apex:mapMarker title="{! lead.Name }" position="{latitude: {!lead.Latitude__c},longitude: {!lead.Longitude__c}}" icon="{! IF (lead.structure__c = 'HOTEL', URLFOR($Resource.Markers, 'GoogleMark/2.png'),URLFOR($Resource.Markers, 'GoogleMark/3.png') ) }">
                        <apex:mapInfoWindow >
                            <apex:outputPanel layout="block" style="font-weight: bold;">
                                <apex:outputText >{!lead.Name }</apex:outputText>
                            </apex:outputPanel>

                            <apex:outputPanel layout="block">
                                <apex:outputText >{!lead.Street__c}, {!lead.number__c}</apex:outputText>
                            </apex:outputPanel>               

                            <apex:outputPanel layout="block">
                                <apex:outputText >{!lead.City__c}, {!lead.state__c}</apex:outputText>
                            </apex:outputPanel>               

                            <apex:outputPanel layout="block">
                                <apex:outputLink value="/{!lead.id}" target="_blank">Open sheet</apex:outputLink>
                            </apex:outputPanel> 

                            <apex:outputPanel layout="block">
                                <apex:outputlink value="http://www.maps.google.com/?q={!lead.City__c}+{!lead.Street__c}+{!lead.number__c}+{!lead.State__c}" target="_blank">
                                    Open on Maps
                                </apex:outputlink>
                            </apex:outputPanel>

                            <apex:outputPanel layout="block">
                                <apex:outputLink value="{! 'tel://' + lead.Phone }">
                                    <apex:outputText >{!lead.Phone}</apex:outputText>
                                </apex:outputLink>
                            </apex:outputPanel>  

                        </apex:mapInfoWindow>
                    </apex:mapMarker>

                    <!-- /> -->
                </apex:repeat>
            </apex:map>
        </apex:pageBlock>

</apex:page>

Thanks to all!
Francesco GuarinoFrancesco Guarino
I solved by myself using more Javascript and no Visualforce to create and interact with the map.