title: Polygon infowindows in Gmaps4Rails
body: <p>I'm using gmap4rails to draw a bunch of fairly complicated polygons that serve as district boundaries. I've got two things i would like help with:</p>
  
  <p>Firstly, I want to associate an info window on click with these polygons. This is an example of my use-case: <a href="https://google-developers.appspot.com/maps/documentation/javascript/examples/polygon-arrays" rel="nofollow">https://google-developers.appspot.com/maps/documentation/javascript/examples/polygon-arrays</a></p>
  
  <p>I've tried registering a click event handler in the gmap's callback but it doesn't work and I don't think it's the right approach.  </p>
  
  <pre><code>Gmaps.map.callback = function() 
  {
          console.log("'sup");
          var infowindow = new google.maps.InfoWindow
          ({
              content: 'you clicked me!',
              suppressMapPan:true
          });
          google.maps.event.addListener(Gmaps.map.polygons[0], 'click', function() 
          {
              console.log("the click event fired");
              infowindow.open(map, Gmaps.map.polygons[0]);
          });
  
  }
  </code></pre>
  
  <p>Secondly, I'd like to be able to change the fill-color of these polygons via jquery on some user-events (user clicks a checkbox for example). How would I go about that using the gem?</p>