Hi
    Sorry....
In the above post I have wrote a Pseudo-code for drawing the polygon.
Here is the actual function.

       function drawPolygon(msg){
                var bounds = new GLatLngBounds();
                for(var x in msg.result.zipboundary){
                       var polygon = new GPolygon.fromEncoded({
                                polylines:[{
                                  points:
msg.result.zipboundary[x].points,
                                  levels:
msg.result.zipboundary[x].levels,
                                  color: "#ff0000",
                                  opacity: 1,
                                  weight: 1,
                                  numLevels: 18,
                                  zoomFactor: 2
                                }],
                                fill:true,
                                color: "#cecece",
                                opacity: 0.5,
                                outline:true
                       });
                     map.addOverlay(polygon);
                     if ( polygon.getBounds() ){
 
bounds.extend(polygon.getBounds().getSouthWest());
 
bounds.extend(polygon.getBounds().getNorthEast());
                      }

                }
                if (typeof(bounds) != undefined) {
                      map.setCenter( bounds.getCenter(),
map.getBoundsZoomLevel( bounds ) );
                }
       };

Here is the link to my map
http://supportwarriors.com/cgi-bin/precision_coverage_version_2/callcenterjss.pl

In the Zip Text Box please enter: 85004


On Feb 16, 4:01 pm, Marcelo <[email protected]> wrote:
> On Feb 16, 11:54 am, Susi <[email protected]> wrote:
>
>
>
> > Begin: Loop of Polygon --
> >        map.addOverlay(polygon);
> >        if ( polygon ){
> >             bounds.extend(polygon.getBounds().getSouthWest());
> >             bounds.extend(polygon.getBounds().getNorthEast());
> >         }
> > Loop Ends:
> > map.setCenter( bounds.getCenter(), map.getBoundsZoomLevel( bounds ) );
>
> No. You should be getting an error message saying "Begin is
> undefined", or something like that.
> You are not new to this group, so you should know to post a link
> already.
>
> Please read and follow the group's posting 
> guidelines:http://groups.google.com/group/Google-Maps-API/web/suggested-posting-...http://groups.google.com/group/Google-Maps-API/web/why-including-a-li...
>
> --
> Marcelo -http://maps.forum.nu
> --
>
>
>
> > Is this correct? But I am getting the incorrect values.
> > Can any one help me on this.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to