Class GSPoint
A coordinate that may be used to specify either a pixel coordinate in the map image's coordinate space or a real world coordinate expressed as an NZMG point.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSPoint(x, y)
Creates a new
GSPoint. |
| Property Attributes | Property Name and Description |
|---|---|
|
This point's x coordinate.
|
|
|
This point's y coordinate.
|
| Method Attributes | Method Name and Description |
|---|---|
|
distanceFrom(point)
Calculates the distance from the point to another supplied point
|
|
|
equals(point)
An equality function
|
|
|
Outputs a GeoJSON object representation of this point
|
|
|
toJson()
Returns this point as JSON String
|
|
|
toString()
Outputs this point's properties as a String
|
Class Detail
GSPoint(x, y)
Creates a new
GSPoint. The new point may optionally be initialized with
its x and y values.
- Parameters:
- x
- y
Property Detail
{Number}
x
This point's x coordinate. May either be an integer type if this point represents
a pixel coordinate or a floating point type if an NZMG coordinate
{Number}
y
This point's y coordinate. May either be an integer type if this point represents
a pixel coordinate or a floating point type if an NZMG coordinate
Method Detail
{Number}
distanceFrom(point)
Calculates the distance from the point to another supplied point
- Parameters:
- {GSPoint} point
- The point to calculate the distance from
- Returns:
- {Number} the distance between the points in metres
{boolean}
equals(point)
An equality function
- Parameters:
- point
- Returns:
- {boolean}
trueif the point being compared refers to the same coordinate as this point.
{Object}
toGeoJsonObj()
Outputs a GeoJSON object representation of this point
- Returns:
- {Object} a GeoJSON object
{String}
toJson()
Returns this point as JSON String
- Returns:
- {String} the JSON string
{String}
toString()
Outputs this point's properties as a String
- Returns:
- {String} this point's properties as a String