title: google maps V3 polyline circle drawing, error: invalid value for constructor parameter 0
body: <p>I am creating a map that allows a user to enter a zip code and a radius to be drawn around it. I am having a problem with google.maps.Polyline. The error message that I am receiving is "invalid value for constructor parameter 0. </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;style type="text/css"&gt;  
      html { height: 100% }   
      body { height: 100%; margin: 0px; padding: 0px }  
      #map_canvas { height: 100% } 
  &lt;/style&gt; 
  &lt;script type="text/javascript"   
    src="http://maps.google.com/maps/api/js?sensor=false"&gt; 
   &lt;/script&gt; 
  
  
  &lt;/script&gt;
  &lt;script type= "text/javascript"&gt;
  
  var geocoder;   
  var map;  
  
  
  function initialize() {    
      geocoder = new google.maps.Geocoder();     
      var latlng = new google.maps.LatLng(-34.397, 150.644);    
      var myOptions = {       
          zoom: 8,      
          center: latlng,       
          mapTypeId: google.maps.MapTypeId.ROADMAP    
          }     
      map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);  
  }    
  function codeAddress() {    
      var address = document.getElementById("address").value;
      geocoder.geocode( { 'address': address}, function(results, status) {       
          if (status == google.maps.GeocoderStatus.OK) {         
          map.setCenter(results[0].geometry.location);        
          var marker = new google.maps.Marker({          
              map: map,             
              position: results[0].geometry.location
              }); 
  
          }
          else {        
          alert("Geocode was not successful for the following reason: " + status);       
          }     
          });   
          } 
  
  function drawCircle() {
      var address=document.getElementById("address").value;
      var radius=document.getElementById("radius").value;
      var latitude=40;
      var longitude=0;
      geocoder.geocode( { 'address': address}, function(results, status){
      if (status==google.maps.GeocoderStatus.OK){
      latlng=(results[0].geometry.location);
      latitude=latlng.lat();
      longitude=latlng.lng();
      alert(latitude);
      alert(longitude);
      alert (radius);
      }   
  
      else{
          alert("Geocode was not successful for the following reason: " + status);
      }
      });
  
  
  
  
  
  //Degrees to radians 
    var d2r = Math.PI / 180;
    alert("calc d2r " + d2r);
   //  Radians to degrees
   var r2d = 180 / Math.PI;
   alert("calc r2d " + r2d);
   // Earth radius is 3,963 miles
   var cLat = (radius / 3963) * r2d;
   alert("calc cLat " + cLat);
    var cLng = cLat / Math.cos(latitude * d2r);
    alert("calc cLng " + cLng);
  
    //Store points in array 
    var points = [];
    alert("declare array ");
  
    // Calculate the points
    // Work around 360 points on circle
    for (var i=0; i &lt; 360; i++) {
  
     var theta = Math.PI * (i/16);
  
     // Calculate next X point 
     circleX = longitude + (cLng * Math.cos(theta));            
      // Calculate next Y point 
     circleY = latitude + (cLat * Math.sin(theta));
      // Add point to array 
      points.push(new google.maps.Point(circleX, circleY));
  
  
   };
      alert("completed loop");
      var Polyline_Path = new google.maps.Polyline({
      path: points,
      strokeColor: "#003F87",
      // color of the outline of the polyline
      strokeOpacity: 1,
      // between 0.0 and 1.0
      strokeWeight: 5
      // The stroke width in pixels
      });
      Polyline_Path.setMap(map);
  
  
  
     //Add points to map
      //var sColor="#003F87";
      //alert("color");
      //var stroke=.5;
      //alert("stroke");
      //map.addOverlay(new GPolyline(points, sColor, stroke));
      //alert("added points to map");
  
  }
  
  
  &lt;/script&gt;
  &lt;/head&gt;
      &lt;body onload="initialize()"&gt; 
          &lt;div id="map_canvas" style="width:500px; height:460px;
          -moz-outline-radius:20px; -moz-box-sizing:padding-box; -moz-outline-style:solid ;-moz-outline-color:#9FB6CD; 
          -moz-outline-width:10px;"&gt;&lt;/div&gt;  
          &lt;div&gt;     
              Zip Code: &lt;input id="address" type="textbox" value=""&gt;    
              Radius:&lt;input id="radius" type="textbox" value=""&gt;
              &lt;input type="button" value="Find" onclick="codeAddress() "&gt;   
              &lt;input type="button" value="Draw Radius" onclick= "drawCircle() "&gt;
          &lt;/div&gt; 
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>