Skip to content

Google V2: Allow closed polyline #27

Open

Description

@adamd

At present, when creating a polyline where the first and the last points
are equal, the resulting curve is automatically converted to GPolygon
without an 'opt-out' alternative.

What if to enable such a case, making the following patch to
mxn.google.core.js:504:

Remove:
if (this.closed || gpoints[0].equals(gpoints[length-1])) {

Add:
if (this.closed || !('closed' in this) && gpoints[0].equals(gpoints[length-1])) {

Basically, what it does is checking if a .closed field isn't present before
checking endpoints. This way it's now possible to enforce closed GPolyline
by explicitly setting .closed = false.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions