jp, it does make sense.  Google is doing it correctly.  A polygon
consists a ring or multiple rings.  In order to have a ring you have
to have the starting point twice.  Think of it this way.  If you had
to draw lines to make an outside ring you would have starting and
ending points for each segment.  The same goes with a polygon.  You
need  a starting point and and ending point.  If you stop at the last
point and don't return to the starting point then it would not be a
polygon anymore.  Instead it would be a line.  In the case of a
polygon, the starting and ending points are always the same.  It's a
valid standard and typically polygons are created in the counter-
clockwise direction.  Check out the OGC standard if you have any
doubts.

JKC

On Jun 19, 8:39 am, jp <[email protected]> wrote:
> I don't think that duplicating the last point makes it a valid
> polygon.  I realize that this is happening, but i'm not sure if the
> API is specifically trying to make a valid polygon or if it was an
> arbitrary decision made by Google to accommodate for this scenario, in
> which case I will need to manually validate the polygon to make sure
> it is at least a triangle.
>
> It doesn't make sense to me because the user has only clicked 3 points
> and the result now has 4 points.
>
> Thanks
> jp
>
> On Jun 19, 9:13 am, Andrew Leach <[email protected]>
> wrote:
>
>
>
> > On Jun 19, 1:59 pm, jp <[email protected]> wrote:
>
> > > What do you mean by this?
> > > Do you think this is a legitimate issue?
>
> > In Chrome, drawing a triangle I get this:
> > 0: -107.666015625,48.10743118848038
> > 1: -95.2734375,56.12106042504407
> > 2: -86.220703125,48.10743118848038
> > 3: -107.666015625,48.10743118848038
>
> > Drawing just a line, I get this (which I think is what you're
> > complaining of):
> > 0: -106.611328125,46.73986059969267
> > 1: -91.318359375,53.592504809039376
> > 2: -106.611328125,46.73986059969267
> > 3: -106.611328125,46.73986059969267
>
> > This is legitimate and not a bug. A polygon must have a minimum of
> > three sides (four vertices for a closed shape), or it's not a polygon.
> > The API is making sure that you are constructing a valid polygon. If
> > you just want to draw a line, draw a line.
>
> > Andrew- Hide quoted text -
>
> - Show quoted text -

--~--~---------~--~----~------------~-------~--~----~
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