Пример #1
0
        internal SKRect ConvertSpanToLocal(MapSpan gpsSpan)
        {
            Rectangle mercatorRect = gpsSpan.ToMercator();

            if (gpsSpan.Crosses180thMeridianRight() && _MercatorRenderArea.Left < SKMapExtensions.MercatorCenterOffset)
            {
                // We cross the 180th meridian to the right and are drawing to a tile on the left side of the map, so wrap around
                mercatorRect.X -= SKMapExtensions.MercatorMapSize;
            }
            else if (gpsSpan.Crosses180thMeridianLeft() && _MercatorRenderArea.Right > SKMapExtensions.MercatorCenterOffset)
            {
                // We cross the 180th meridian to the left and are drawing to a tile on the right side of the map, so wrap around
                mercatorRect.X += SKMapExtensions.MercatorMapSize;
            }

            return(ApplyMatrix(mercatorRect));
        }