public override LatLng Normalize()
        {
            if (IsNormalized())
            {
                return(this);
            }

            int delta = 0;

            if (_lng < 0)
            {
                delta = 360 * ScaleFactorInt;
            }
            if (_lng >= 0)
            {
                delta = -360 * ScaleFactorInt;
            }

            int newLng = _lng;

            while (newLng <= -180 * ScaleFactorInt || newLng >= 180 * ScaleFactorInt)
            {
                newLng += delta;
            }

            var ret = new FixedLatLng(_lat, newLng)
            {
                _normalized = true
            };

            return(ret);
        }
Beispiel #2
0
 public override int GetFixedLng()
 {
     return(FixedLatLng.DoubleToFixed(_lng));
 }
Beispiel #3
0
		public override LatLng Normalize()
		{
			if (IsNormalized()) return this;
    
			int delta = 0;
			if (_lng < 0) delta = 360 * ScaleFactorInt;
			if (_lng >= 0) delta =- 360 * ScaleFactorInt;
		    
			int newLng = _lng;
			while (newLng <= -180 * ScaleFactorInt || newLng >= 180 * ScaleFactorInt)
			{
				newLng += delta;
			}

			var ret = new FixedLatLng(_lat, newLng)
			          	{
			          		_normalized = true
			          	};

			return ret;

		}