This class represents a longitude and latitude pair
| OpenLayers. | This class represents a longitude and latitude pair |
| Properties | |
| lon | {Float} The x-axis coodinate in map units |
| lat | {Float} The y-axis coordinate in map units |
| Constructor | |
| OpenLayers. | Create a new map location. |
| Functions | |
| toString | Return a readable string version of the lonlat |
| toShortString | {String} Shortened String representation of OpenLayers.LonLat object. |
| clone | {OpenLayers.LonLat} New OpenLayers.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 OpenLayers.LonLat from a parameter string |
| fromArray | Alternative constructor that builds a new OpenLayers.LonLat from an array of two numbers that represent lon- and lat-values. |
Create a new map location.
| 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. |
clone:function()
{OpenLayers.LonLat} New OpenLayers.LonLat object with the same lon and lat values
add:function( lon, lat )
| lon | {Float} |
| lat | {Float} |
{OpenLayers.LonLat} A new OpenLayers.LonLat object with the lon and lat passed-in added to this’s.
equals:function( ll )
| ll | {OpenLayers.LonLat} |
{Boolean} Boolean value indicating whether the passed-in OpenLayers.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 | {OpenLayers.Projection} Source projection. |
| dest | {OpenLayers.Projection} Destination projection. |
{OpenLayers.LonLat} Itself, for use in chaining operations.
wrapDateLine: function( maxExtent )
| maxExtent | {OpenLayers.Bounds} |
{OpenLayers.LonLat} A copy of this lonlat, but wrapped around the “dateline” (as specified by the borders of maxExtent)
OpenLayers.LonLat.fromString = function( str )
Alternative constructor that builds a new OpenLayers.LonLat from a parameter string
| str | {String} Comma-separated Lon,Lat coordinate string. (e.g. <i>”5,40”</i>) |
{OpenLayers.LonLat} New OpenLayers.LonLat object built from the passed-in String.
OpenLayers.LonLat.fromArray = function( arr )
Alternative constructor that builds a new OpenLayers.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]) |
{OpenLayers.LonLat} New OpenLayers.LonLat object built from the passed-in array.
Return a readable string version of the lonlat
toString:function()
{String} Shortened String representation of OpenLayers.LonLat object.
toShortString:function()
{OpenLayers.LonLat} New OpenLayers.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 OpenLayers.LonLat from a parameter string
OpenLayers.LonLat.fromString = function( str )
Alternative constructor that builds a new OpenLayers.LonLat from an array of two numbers that represent lon- and lat-values.
OpenLayers.LonLat.fromArray = function( arr )