title: Adding images to multiple google map infowindows
body: <p>So, as part of an assignment we have to design a map using the Google Maps API which needs to use multiple infowindows and custom markers. I have managed the first two, but I seem to be struggling with the images? Could I simply add the images into the array, and if so, how do I format this properly? </p>
  
  <p>Here is my current code</p>
  
  <pre><code>//Beginning of Function
  function initialise() {
  
          //Get mapArea in HTML, create map based around latlong
          var map = new google.maps.Map(document.getElementById('mapArea'), {
              zoom: 16,
              center: new google.maps.LatLng(53.470639, -2.238996),
              mapTypeId: google.maps.MapTypeId.ROADMAP
          });
  
          //add array of locations and markers
          var locations = [
              ['Geoffrey Manton Building', 53.469272, -2.237179,'http://labs.google.com/ridefinder/images/mm_20_purple.png'],
              ['All Saints Building', 53.471086, -2.238541,'http://labs.google.com/ridefinder/images/mm_20_red.png'],
              ['Business and Law Schools', 53.470575, -2.239673,'http://labs.google.com/ridefinder/images/mm_20_green.png'],
              ['John Dalton', 53.471964, -2.240392,'http://labs.google.com/ridefinder/images/mm_20_blue.png'],
          ];
  
          //declare variable marker as i
          var marker, i;
  
          //Declare new infowindow for locations
          var infowindow = new google.maps.InfoWindow();
  
          //add marker to each location
          for (i = 0; i &lt; locations.length; i++) {
              marker = new google.maps.Marker({
                  position: new google.maps.LatLng(locations[i][1], locations[i][2]),
                  map: map,
                  icon: locations[i][3]
              });
  
              //Create marker functionality, allow infowindow opening
              google.maps.event.addListener(marker, 'click', (function(marker, i) {
                  return function() {
                      infowindow.setContent(locations[i][0]);
                      infowindow.open(map, marker);
                  }
              })(marker, i));
          }
      }
      google.maps.event.addDomListener(window, 'load', initialise);
  </code></pre>