title: External Link Trigger InfoWindow with Google Maps / JQuery
body: <p>Started playing around with the Google Maps API V3. I have a list of places in HTML with some data-coordinates. The places populate on the map however, what I want to happen is when you click on the actual link (i.e. Place 1) outside of the map, it triggers the infowindow to open as well.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="map"&gt;&lt;/div&gt;
  
  &lt;div id="places"&gt;
     &lt;div class="map-location" data-coordinates='{"lat" : 40.71837, "long" : -74.00608}'&gt;
       &lt;a href="http://link1.com"&gt;Place 1&lt;/a&gt;
     &lt;/div&gt;
     &lt;div class="map-location" data-coordinates='{"lat" : 40.71435, "long" : -74.00597}'&gt;
       &lt;a href="http://link2.com"&gt;Place 2&lt;/a&gt;
     &lt;/div&gt;
     &lt;div class="map-location" data-coordinates='{"lat" : 40.71803, "long" : -74.00305}'&gt;
       &lt;a href="http://link3.com"&gt;Place 3&lt;/a&gt;
     &lt;/div&gt;
     &lt;div class="map-location" data-coordinates='{"lat" : 40.74238, "long" : -73.98946}'&gt;
       &lt;a href="http://link4.com"&gt;Place 4&lt;/a&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>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 = '&lt;a href="' + rHref + '" target="_blank"&gt;' + rName + '&lt;/a&gt;';
    var myLatLng = new google.maps.LatLng( rLat, rLong );
  
    var otherMarkers = new google.maps.Marker({
       position: myLatLng,
       map: map
    });
  
    // click actions
    google.maps.event.addListener(otherMarkers, 'click', (function(otherMarkers, index) {
       return function() {
       infowindow.setContent( contentString );
       infowindow.open( map, otherMarkers );
      }
    })(otherMarkers, index));
  });
  </code></pre>
  
  <p>How do I go about setting up a click for each link to trigger the infoWindow box on the map?</p>