MGMap.getLon   Go to object model Go to parent topic Go to previous topic Go to next topic

Syntax

double getLon()

Description

Gets the longitude (X) value in decimal degrees of the center of the map area currently displayed.

Longitudes are positive east of the Greenwich meridian and negative west of the meridian.

Returns

double - Longitude, or theX coordinate if an arbitrary coordinate system is being used.

Error Codes

none

Example

The following example is designed to work with the Tutorial.mwf file that is included with Autodesk MapGuide Author. It displays a dialog box showing the Lat/Lon coordinates for the center of the visible map area:

function showCenterCoords() 
{
    var map = getMap();
    alert( "Lat: " + map.getLat() + "\nLon: " + map.getLon() );

See Also

Lon, getLat, zoomWidth