title: Google Maps Polyline and Marker together
body: <p>I have this code for polyline which is working perfect. How do i add marker for each of location point?</p>
  
  <pre><code>var userCoor = [
  &lt;?php
  for($i=0; $i&lt;sizeOf($lat); $i++)
  echo "new google.maps.LatLng({$lat[$i]}, {$long[$i]}),";
  ?&gt;
  ];
  
  var userCoordinate = new google.maps.Polyline({
  path: userCoor,
  strokeColor: "#FF0000",
  strokeOpacity: 1,
  strokeWeight: 2
  });
  
  userCoordinate.setMap(map);
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>var infowindow = new google.maps.InfoWindow();
  
  var marker, i;
  
  for (i = 0; i &lt; userCoor.length; i++) {  
    marker = new google.maps.Marker({
      position: new google.maps.LatLng(userCoor[i][1], userCoor[i][2]),
      map: map
    });
  
    google.maps.event.addListener(marker, 'click', (function(marker, i) {
      return function() {
        infowindow.setContent(userCoor[i][0]);
        infowindow.open(map, marker);
      }
    })(marker, i));
  }
  }
  </code></pre>
  
  <p>Marker seems missing? Any idea how? Thanks.</p>