OpenSpace.MapPoint

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

Inherits

  • <OpenLayers.LonLat>
Summary
OpenSpace.MapPointThis class represents an eastings and northings pair of coordinates in British National Grid (BNG) format
Properties
srs{Integer} The spatial reference system
Constructor
OpenSpace.MapPointCreate a new map location with an optional spatial reference system.
Functions
getEasting{Float} The x-axis easting coodinate in metres
getNorthing{Float} The y-axis northing coodinate in metres
toStringReturn a readable string version of the map point
toCoordStringReturn a readable string version of the map point
clone{OpenSpace.MapPoint} New OpenSpace.MapPoint object with the same eastings and northings values
add
equals
fromStringAlternative constructor that builds a new OpenSpace.MapPoint from a parameter string

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

fromString

OpenSpace.MapPoint.fromString = function(str)

Alternative constructor that builds a new OpenSpace.MapPoint from a parameter string

Parameters

str{String} Comma-separated Eastings,Northings coordinate string.  (ex.  <i>”512300,403400”</i>)

Returns

{OpenSpace.MapPoint} New OpenSpace.MapPoint object built from the passed-in String.

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)
OpenSpace.MapPoint.fromString = function(str)
Alternative constructor that builds a new OpenSpace.MapPoint from a parameter string
Close