Сделайте свой JS таким:
создать глобальный массив вне функции:
var infoArray = new Array();
var markerArray = new Array();
и сохранить каждый экземпляр информационного окна:
var map;
var infowindow = new google.maps.InfoWindow();
var myOptions = {
zoom: 15,
center: new google.maps.LatLng(40.71938, -74.00552),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map'), myOptions);
// grab data attributes from html
$('.map-location').each(function( index ){
var rLat = $(this).data("coordinates").lat;
var rLong = $(this).data("coordinates").long;
var rName = $(this).find('a').html();
var rHref = $(this).find('a').attr("href");
var contentString = '<a href="' + rHref + '" target="_blank">' + rName + '</a>';
var myLatLng = new google.maps.LatLng( rLat, rLong );
var otherMarkers = new google.maps.Marker({
position: myLatLng,
map: map
});
markerArray[myLatLng] = otherMarkers;
// click actions
google.maps.event.addListener(otherMarkers, 'click', (function(otherMarkers, index) {
return function() {
infowindow.setContent( contentString );
infowindow.open( map, otherMarkers );
}
})(otherMarkers, index));
});
infoArray[myLatLng] = infowindow;
и сделать функцию на HTML:
<div id="map"></div>
<div id="places">
<div class="map-location" >
<a href="http://link1.com" onclick ='infoOpen(40.71837,-74.00608);'>Place 1</a>
</div>
<div class="map-location" >
<a href="http://link2.com" onclick ='infoOpen(40.71837,-74.00608);'>Place 2</a>
</div>
<div class="map-location" >
<a href="http://link3.com" onclick ='infoOpen(40.71837,-74.00608);'>Place 3</a>
</div>
<div class="map-location" >
<a href="http://link4.com" onclick ='infoOpen(40.71837,-74.00608);'>Place 4</a>
</div>
</div>
и создайте функцию JS:
function infoOpen(lat,lng){
var myLatLng = new google.maps.LatLng(lat,lng);
infoArray[myLatLng].open(map,markerArray[myLatLng]);
}
сделать переменную карты также глобальной.
Также настроить его в соответствии с вами.