This class represents a longitude and latitude pair
| ALKMaps. | This 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. | Create a new map location. |
| Functions | |
| toString | Return 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 | |
| transform | Transform the LonLat object from source to dest. |
| wrapDateLine | |
| fromString | Alternative constructor that builds a new ALKMaps.LonLat from a parameter string |
| fromArray | Alternative constructor that builds a new ALKMaps.LonLat from an array of two numbers that represent lon- and lat-values. |
| transformArray | Perform transform function on an array of ALKMaps.LonLat objects |
Create a new map location. Coordinates can be passed either as two arguments, or as a single argument.
| 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. |
| location | {Array(Float)} [lon, lat] |
add:function( lon, lat )
| lon | {Float} |
| lat | {Float} |
{ALKMaps.LonLat} A new ALKMaps.LonLat object with the lon and lat passed-in added to this’s.
equals:function( ll )
| ll | {ALKMaps.LonLat} |
{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: 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.
| source | {ALKMaps.Projection} Source projection. |
| dest | {ALKMaps.Projection} Destination projection. |
{ALKMaps.LonLat} Itself, for use in chaining operations.
wrapDateLine: function( maxExtent )
| maxExtent | {ALKMaps.Bounds} |
{ALKMaps.LonLat} A copy of this lonlat, but wrapped around the “dateline” (as specified by the borders of maxExtent)
ALKMaps.LonLat.fromString = function( str )
Alternative constructor that builds a new ALKMaps.LonLat from a parameter string
| str | {String} Comma-separated Lon,Lat coordinate string. (e.g. <i>”5,40”</i>) |
{ALKMaps.LonLat} New ALKMaps.LonLat object built from the passed-in 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.
| arr | {Array(Float)} Array of lon/lat values (e.g. [5,-42]) |
{ALKMaps.LonLat} New ALKMaps.LonLat object built from the passed-in array.
ALKMaps.LonLat.transformArray = function ( array, source, dest )
Perform transform function on an array of ALKMaps.LonLat objects
| array | {Array<ALKMaps.LonLat>} |
| source | {ALKMaps.Projection} |
| dest | {ALKMaps.Projection} |
{Array} Array of ALKMaps.LonLat objects in the projection specified by the dest parameter.
Return a readable string version of the lonlat
toString:function()
{String} Shortened String representation of ALKMaps.LonLat object.
toShortString:function()
{ALKMaps.LonLat} New ALKMaps.LonLat object with the same lon and lat values
clone:function()
add:function( lon, lat )
equals:function( ll )
Transform the LonLat object from source to dest.
transform: function( source, dest )
wrapDateLine: function( maxExtent )
Alternative constructor that builds a new ALKMaps.LonLat from a parameter string
ALKMaps.LonLat.fromString = function( str )
Alternative constructor that builds a new ALKMaps.LonLat from an array of two numbers that represent lon- and lat-values.
ALKMaps.LonLat.fromArray = function( arr )
Perform transform function on an array of ALKMaps.LonLat objects
ALKMaps.LonLat.transformArray = function ( array, source, dest )