MoSync 3.3
MAP::LonLatT< MagnificationT > Class Template Reference

This class maintains a coordinate in latitude / longitude, and provides conversion function to and from other coordinate systems. More...

#include <MAP/LonLat.h>

List of all members.

Public Member Functions

 LonLatT ()
 LonLatT (const double _lon, const double _lat)
 LonLatT (const PixelCoordinateT< MagnificationT > &px)
bool isValid () const
const PixelCoordinateT
< MagnificationT > 
toPixels (MagnificationT magnification) const
void toMeters (double &meterX, double &meterY) const

Static Public Member Functions

static LonLatT< MagnificationT > fromMeters (const double meterX, const double meterY)

Public Attributes

double lon
double lat

Detailed Description

template<typename MagnificationT>
class MAP::LonLatT< MagnificationT >

This class maintains a coordinate in latitude / longitude, and provides conversion function to and from other coordinate systems.


Constructor & Destructor Documentation

template<typename MagnificationT>
MAP::LonLatT< MagnificationT >::LonLatT ( ) [inline]

Creates a LonLat initialized to (0, 0).

template<typename MagnificationT>
MAP::LonLatT< MagnificationT >::LonLatT ( const double  _lon,
const double  _lat 
) [inline]

Creates a LonLat.

template<typename MagnificationT>
MAP::LonLatT< MagnificationT >::LonLatT ( const PixelCoordinateT< MagnificationT > &  px) [inline]

Creates a LonLat from thr given global pixel coordinate.


Member Function Documentation

template<typename MagnificationT>
static LonLatT<MagnificationT> MAP::LonLatT< MagnificationT >::fromMeters ( const double  meterX,
const double  meterY 
) [inline, static]

Creates a LonLat from the given global meter coordinates.

template<typename MagnificationT>
bool MAP::LonLatT< MagnificationT >::isValid ( ) const [inline]
template<typename MagnificationT>
const PixelCoordinateT<MagnificationT> MAP::LonLatT< MagnificationT >::toPixels ( MagnificationT  magnification) const [inline]

Converts this to global pixel coordinates. Projection is assumed to be spherical Mercator (as opposed to ellipsoidal). This results in a slight Y-axis error. Spherical Mercator is chosen for compatibility with online tile servers such as Google Maps and Microsoft Virtual Earth.

template<typename MagnificationT>
void MAP::LonLatT< MagnificationT >::toMeters ( double &  meterX,
double &  meterY 
) const [inline]

Convert this to meters.


Member Data Documentation

template<typename MagnificationT>
double MAP::LonLatT< MagnificationT >::lon
template<typename MagnificationT>
double MAP::LonLatT< MagnificationT >::lat
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines