title: Geoxml3 CreatePolygon function
body: <p>I am trying to know how to use the createPolygon function in the parser options.</p>
  
  <p>This is my index file but it gives me this error: Cannot read property 'bounds' of undefined.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no"/&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"/&gt;
  &lt;title&gt;Geoxml3&lt;/title&gt;
  &lt;style&gt;
      html{height:100%;}
      body{height:100%;margin:0px;}
      #map_canvas{height: 90%;width: 90%;}
  &lt;/style&gt;
  
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="map_canvas"&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  var geoXml="", map="";
  var infowindow = new google.maps.InfoWindow({});
  
  function initialize() {
      var myOptions = {
          center: new google.maps.LatLng(39.397, -100.644),
          zoom: 4,
          mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
      geoXml = new geoXML3.parser({
          map: map,
          zoom: true,
          createMarker: addMyMarker,
          createPolygon: addMyPolygon,
          singleInfoWindow: true,
          suppressInfoWindows: true
      });
  
      geoXml.parse('testPolygon.xml');
  
      function addMyMarker(placemark) {
          var marker = geoXml.createMarker(placemark);
              //marker.setAnimation(google.maps.Animation.BOUNCE);
              google.maps.event.addListener(marker, 'click', function() {
                  infowindow.setContent(placemark.description);   
                  infowindow.setPosition(marker.getPosition());
                  infowindow.open(map,marker);
              });
          };
  
          function addMyPolygon(placemark) {
              var polygon = geoXml.createPolygon(placemark);
              google.maps.event.addListener(polygon, 'click', function() {
                  infowindow.setContent(placemark.description);   
                  var lat = event.latLng.lat();
                  var lng = event.latLng.lng();
                  var myLatlng = new google.maps.LatLng(lat,lng);
                  infowindow.setPosition(myLatlng);
                  infowindow.open(map,polygon);
              });
          };
  
      };
      google.maps.event.addDomListener(window, 'load', initialize);
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want to know if is correct the way I'm using the 'createPolygon:addMyPolygon' function, or where is the issue, I mean how can I set a click Listener for each polygon using the createPolygon function.
  I did it with the createMarker function for a KML with markers, but in the file above the createPolygon doesn't parse my KML file.</p>
  
  <p>My KML/XML file is: 
  <a href="http://www.geocodezip.com/geoxml3_test/testPolygon.xml" rel="nofollow">http://www.geocodezip.com/geoxml3_test/testPolygon.xml</a></p>