private static double ConvertMercatorXToLongitude(double x)
{
double longRadians = x / GeoMath.EARTH_RADIUS_AT_EQUATOR_METERS;
double longDegrees = GeoMath.ConvertToDegrees(longRadians);
/* The user could have panned around the world a lot of times.
Lat long goes from -180 to 180. So every time a user gets
to 181 we want to subtract 360 degrees. Every time a user
gets to -181 we want to add 360 degrees. */
double rotations = Math.Floor((longDegrees + 180) / 360);
double longitude = longDegrees - (rotations * 360);
return longitude;
}