ALKMaps.LonLat

This class represents a longitude and latitude pair

Summary
ALKMaps.LonLatThis class represents a longitude and latitude pair
Properties
lon{Float} The x-axis coordinate in map units
lat{Float} The y-axis coordinate in map units
Constructor
ALKMaps.LonLatCreate a new map location.
Functions
toStringReturn a readable string version of the lonlat
toShortString{String} Shortened String representation of ALKMaps.LonLat object.
clone{ALKMaps.LonLat} New ALKMaps.LonLat object with the same lon and lat values
add
equals
transformTransform the LonLat object from source to dest.
wrapDateLine
fromStringAlternative constructor that builds a new ALKMaps.LonLat from a parameter string
fromArrayAlternative constructor that builds a new ALKMaps.LonLat from an array of two numbers that represent lon- and lat-values.
transformArrayPerform transform function on an array of ALKMaps.LonLat objects

Properties

lon

{Float} The x-axis coordinate in map units

lat

{Float} The y-axis coordinate in map units

Constructor

ALKMaps.LonLat

Create a new map location.  Coordinates can be passed either as two arguments, or as a single argument.

Parameters (two arguments)

lon{Number} The x-axis coordinate in map units.  If your map is in a geographic projection, this will be the Longitude.  Otherwise, it will be the x coordinate of the map location in your map units.
lat{Number} The y-axis coordinate in map units.  If your map is in a geographic projection, this will be the Latitude.  Otherwise, it will be the y coordinate of the map location in your map units.

Parameters (single argument)

location{Array(Float)} [lon, lat]

Functions

toString

toString:function()

Return a readable string version of the lonlat

Returns

{String} String representation of ALKMaps.LonLat object.  (e.g.  <i>”lon=5,lat=42”</i>)

toShortString

toShortString:function()

Returns

{String} Shortened String representation of ALKMaps.LonLat object.  (e.g.  <i>”5, 42”</i>)

clone

clone:function()

Returns

{ALKMaps.LonLat} New ALKMaps.LonLat object with the same lon and lat values

add

add:function(lon,
lat)

Parameters

lon{Float}
lat{Float}

Returns

{ALKMaps.LonLat} A new ALKMaps.LonLat object with the lon and lat passed-in added to this’s.

equals

equals:function(ll)

Parameters

ll{ALKMaps.LonLat}

Returns

{Boolean} Boolean value indicating whether the passed-in ALKMaps.LonLat object has the same lon and lat components as this.  Note: if ll passed in is null, returns false

transform

transform: function(source,
dest)

Transform the LonLat object from source to dest.  This transformation is in place: if you want a new lonlat, use .clone() first.

Parameters

source{ALKMaps.Projection} Source projection.
dest{ALKMaps.Projection} Destination projection.

Returns

{ALKMaps.LonLat} Itself, for use in chaining operations.

wrapDateLine

wrapDateLine: function(maxExtent)

Parameters

maxExtent{ALKMaps.Bounds}

Returns

{ALKMaps.LonLat} A copy of this lonlat, but wrapped around the “dateline” (as specified by the borders of maxExtent)

fromString

ALKMaps.LonLat.fromString = function(str)

Alternative constructor that builds a new ALKMaps.LonLat from a parameter string

Parameters

str{String} Comma-separated Lon,Lat coordinate string.  (e.g.  <i>”5,40”</i>)

Returns

{ALKMaps.LonLat} New ALKMaps.LonLat object built from the passed-in String.

fromArray

ALKMaps.LonLat.fromArray = function(arr)

Alternative constructor that builds a new ALKMaps.LonLat from an array of two numbers that represent lon- and lat-values.

Parameters

arr{Array(Float)} Array of lon/lat values (e.g.  [5,-42])

Returns

{ALKMaps.LonLat} New ALKMaps.LonLat object built from the passed-in array.

transformArray

ALKMaps.LonLat.transformArray = function (array,
source,
dest)

Perform transform function on an array of ALKMaps.LonLat objects

Parameters

array{Array<ALKMaps.LonLat>}
source{ALKMaps.Projection}
dest{ALKMaps.Projection}

Returns

{Array} Array of ALKMaps.LonLat objects in the projection specified by the dest parameter.

toString:function()
Return a readable string version of the lonlat
toShortString:function()
{String} Shortened String representation of ALKMaps.LonLat object.
clone:function()
{ALKMaps.LonLat} New ALKMaps.LonLat object with the same lon and lat values
Create a new map location.
add:function(lon,
lat)
equals:function(ll)
transform: function(source,
dest)
Transform the LonLat object from source to dest.
wrapDateLine: function(maxExtent)
ALKMaps.LonLat.fromString = function(str)
Alternative constructor that builds a new ALKMaps.LonLat from a parameter string
ALKMaps.LonLat.fromArray = function(arr)
Alternative constructor that builds a new ALKMaps.LonLat from an array of two numbers that represent lon- and lat-values.
ALKMaps.LonLat.transformArray = function (array,
source,
dest)
Perform transform function on an array of ALKMaps.LonLat objects
Methods for coordinate transforms between coordinate systems.
Instances of this class represent bounding boxes.
Close