OpenSpace. MapPoint

This class represents an eastings and northings pair of coordinates in British National Grid (BNG) format

Inherits

Summary
This class represents an eastings and northings pair of coordinates in British National Grid (BNG) format
{Integer} The spatial reference system
Create a new map location with an optional spatial reference system.
{Float} The x-axis easting coodinate in metres
{Float} The y-axis northing coodinate in metres
Return a readable string version of the map point
Return a readable string version of the map point
{OpenSpace.MapPoint} New OpenSpace.MapPoint object with the same eastings and northings values

Properties

srs

{Integer} The spatial reference system

Constructor

OpenSpace. MapPoint

Create a new map location with an optional spatial reference system.

Parameters

eastings{Number} The x-axis coordinate in map units (metres).
northings{Number} The y-axis coordinate in map units (metres).
srs{Integer} Optional Spatial Reference System, defaults to 27700 (BNG).

Functions

getEasting

getEasting: function()

Returns

{Float} The x-axis easting coodinate in metres

getNorthing

getNorthing: function()

Returns

{Float} The y-axis northing coodinate in metres

toString

toString: function()

Return a readable string version of the map point

Returns

{String} String representation of OpenSpace.MapPoint object.  (ex.  <i>”eastings=500000,northings=420000”</i>)

toCoordString

toCoordString: function()

Return a readable string version of the map point

Returns

{String} String representation of OpenSpace.MapPoint object.  (ex.  <i>”(500000,420000)”</i>)

clone

clone: function()

Returns

{OpenSpace.MapPoint} New OpenSpace.MapPoint object with the same eastings and northings values

add

add: function(eastings,
northings)

Parameters

eastings{Float}
northings{Float}

Returns

{OpenSpace.MapPoint} A new OpenSpace.MapPoint object with the rastings and northings passed-in values added to this’s.

equals

equals:function(ll)

Parameters

ll{OpenSpace.MapPoint}

Returns

{Boolean} Boolean value indicating whether the passed-in OpenSpace.MapPoint object has the same eastings and northings components as this.  Note: if ll passed in is null, returns false

getEasting: function()
{Float} The x-axis easting coodinate in metres
getNorthing: function()
{Float} The y-axis northing coodinate in metres
toString: function()
Return a readable string version of the map point
toCoordString: function()
Return a readable string version of the map point
clone: function()
{OpenSpace.MapPoint} New OpenSpace.MapPoint object with the same eastings and northings values
Create a new map location with an optional spatial reference system.
add: function(eastings,
northings)
equals:function(ll)
This class represents a longitude and latitude pair