Constructor
new Polygon(coordinates)
Parameters:
Name | Type | Description |
---|---|---|
coordinates |
Coordinates
|
Array.<Parse.GeoPoint>
|
An Array of coordinate pairs |
Members
coordinates
Coordinates value for this Polygon. Throws an exception if not valid type.
Properties:
Name | Type | Description |
---|---|---|
coordinates |
Coordinates
|
Array.<Parse.GeoPoint>
|
list of coordinates |
Methods
containsPoint(point) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
point |
Parse.GeoPoint
|
Returns:
- Type:
-
boolean
Returns if the point is contained in the polygon
equals(other) → {boolean}
Checks if two polygons are equal
Parameters:
Name | Type | Description |
---|---|---|
other |
Parse.Polygon
|
object
|
Returns:
- Type:
-
boolean
toJSON() → {object}
Returns a JSON representation of the Polygon, suitable for Parse.
Returns:
- Type:
-
object
(static) _validate(coords) → {Array.<Array.<number>>}
Validates that the list of coordinates can form a valid polygon
Parameters:
Name | Type | Description |
---|---|---|
coords |
Array
|
the list of coordinates to validate as a polygon |
Throws:
TypeError
Returns:
- Type:
-
Array.<Array.<number>>
Array of coordinates if validated.