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.

Class Summary
Constructor Attributes Constructor Name and Description
 
GSPoint(x, y)
Creates a new GSPoint.
Property Summary
Property Attributes Property Name and Description
 
x
This point's x coordinate.
 
y
This point's y coordinate.
Method Summary
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
 
Returns this point as JSON String
 
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} true if 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

Documentation generated by JsDoc Toolkit 2.3.2 on Wed Mar 07 2012 11:47:29 GMT+1300 (NZDT)