My apologies I should be more clear. I would like to use a long array
of numbers without geocoding them individually like in the example
that works. When I document.write(GLatLong(37.4419, -132.0419)) it
just returns "(37.4419, -132.0419)", but yet this does not work:
var polygon = new GPolygon([
(37.4419, -132.0419),
(47.3419, -122.1419),
(37.4419, -112.2419),
(27.5419, -122.1419),
(37.4419, -132.0419)
], "#f33f00", 5, 1, "#ff0000", 0.2);
map.addOverlay(polygon);
I think this is the best way I can word my question:
how I define the array "points" that contains 5 lat/lon coordinates
without using GLatLng more than once, so that the following draws a
polygon:
var polygon = new GPolygon(points, "#f33f00", 5, 1, "#ff0000", 0.2);
map.addOverlay(polygon);
On Dec 10, 9:01 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Dec 10, 8:52 am, Dave Llorens <[EMAIL PROTECTED]> wrote:
>
> > THIS DRAWS A POLYGON
>
> > var polygon = new GPolygon([
> > new GLatLng(37.4419, -132.0419),
> > new GLatLng(47.3419, -122.1419),
> > new GLatLng(37.4419, -112.2419),
> > new GLatLng(27.5419, -122.1419),
> > new GLatLng(37.4419, -132.0419)
> > ], "#f33f00", 5, 1, "#ff0000", 0.2);
> > map.addOverlay(polygon);
>
> This is an array of GLatLngs...
>
>
>
> > THIS DOES NOT
>
> > var polygon = new GPolygon([
> > [37.4419, -132.0419]
> > [47.3419, -122.1419]
> > [37.4419, -112.2419]
> > [27.5419, -122.1419]
> > [37.4419, -132.0419]
> > ], "#f33f00", 5, 1, "#ff0000", 0.2);
> > map.addOverlay(polygon);
>
> This is an array of arrays of numbers.
>
>
>
> > THIS DOES NOT
>
> > points = [[37.4419, -132.0419], [47.3419, -122.1419], [37.4419,
> > -112.2419], [27.5419, -122.1419], [37.4419, -132.0419]];
>
> > var polygon = new GPolygon(points, "#f33f00", 5, 1,
> > "#ff0000", 0.2);
> > map.addOverlay(polygon);
>
> This is an array of arrays of numbers.
>
>
>
> > I want to use an array of points... what the hell am and I doing
> > wrong?
>
> Define "points". It works when you use an array of GLatLngs (which
> are what I call points). It doesn't work when you don't because the
> GPolygon constructor expects an array of GLatLngs as its argument.
>
> -- Larry
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---