EMS.LonLat

Drop-in replacement for OpenLayers.LonLat that automatically converts to the EMS.Projection.SPHERICAL_MERCATOR projection.

Inherits from

Summary
EMS.LonLatDrop-in replacement for OpenLayers.LonLat that automatically converts to the EMS.Projection.SPHERICAL_MERCATOR projection.
Constructor
EMS.LonLatCreates a new instances of the EMS.LonLat class using a longitude and latitude.
Functions
toArray{Array} Returns an array form of the point with the first indexed item the longtitude and the second being the latitude.

Constructor

EMS.LonLat

Creates a new instances of the EMS.LonLat class using a longitude and latitude.  The longitude and latitude are automatically converted into SGP format.  To get back original WGS coordinates call <OpenLayers.LonLat.prototype.asWGS84>.

Examples

// Construct with separate arguments
var one = new EMS.LonLat(144.3322, -35.49239);

// Construct with an object
var two = new EMS.LonLat({lon: 144.3322, lat: -35.49239});

// Construct with an array
var three = new EMS.LonLat([144.3322, -35.49239]);

// Construct with an EMS.LonLat instance
var four = new EMS.LonLat(three);

Parameters

lonlat{Mixed} This maybe either two arguments representing the longitude and latitude, an array with the first index being the longitude and the second being the latitude (others discarded) an object with a lon and lat property or an EMS.LonLat instance to copy.

Functions

toArray

toArray: function()

Returns

{Array} Returns an array form of the point with the first indexed item the longtitude and the second being the latitude.  This will always return an array of length 2.

This class represents a longitude and latitude pair
Spherical mercator in metres.
toArray: function()
{Array} Returns an array form of the point with the first indexed item the longtitude and the second being the latitude.
Creates a new instances of the EMS.LonLat class using a longitude and latitude.
Close