예제 #1
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);
        }
예제 #2
0
 public override int GetFixedLng()
 {
     return(FixedLatLng.DoubleToFixed(_lng));
 }
예제 #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;

		}