Пример #1
0
        public TileDisplayDescriptorArray GetTileArrayDescriptor(LatLonZoom center, Size windowSize)
        {
            TileDisplayDescriptorArray tileDisplayDescriptorArray = new TileDisplayDescriptorArray();
            MapRectangle mapWindow = this.GetMapWindow(center, windowSize);

            tileDisplayDescriptorArray.topLeftTile = this.GetTileContainingLatLonZoom(new LatLonZoom(mapWindow.GetNW(), center.zoom));
            TileAddress tileContainingLatLonZoom = this.GetTileContainingLatLonZoom(new LatLonZoom(mapWindow.GetSE(), center.zoom));

            tileDisplayDescriptorArray.tileCountX = tileContainingLatLonZoom.TileX - tileDisplayDescriptorArray.topLeftTile.TileX + 1;
            tileDisplayDescriptorArray.tileCountY = tileContainingLatLonZoom.TileY - tileDisplayDescriptorArray.topLeftTile.TileY + 1;
            int x    = this.GetTranslationInPixels(center, this.GetLatLonOfTileNW(tileDisplayDescriptorArray.topLeftTile)).X;
            int x2   = this.GetTranslationInPixels(center, this.GetLatLonOfTileNW(new TileAddress(tileDisplayDescriptorArray.topLeftTile.TileX + tileDisplayDescriptorArray.tileCountX, tileDisplayDescriptorArray.topLeftTile.TileY, tileDisplayDescriptorArray.topLeftTile.ZoomLevel))).X;
            int num  = x2 - x;
            int num2 = windowSize.Width + 512;

            if (num > num2)
            {
                D.Sayf(0, "break", new object[0]);
            }
            tileDisplayDescriptorArray.layout   = this.addressLayout;
            tileDisplayDescriptorArray.tileSize = this.GetTileSize();
            Point64 point = this.LatLongZoomToPixel(new LatLonZoom(mapWindow.GetNW(), center.zoom));

            tileDisplayDescriptorArray.topLeftTileOffset = new Point64((long)tileDisplayDescriptorArray.topLeftTile.TileX * 256L - point.X, (long)tileDisplayDescriptorArray.topLeftTile.TileY * 256L - point.Y).ToPoint();
            tileDisplayDescriptorArray.topLeftTile.TileX = VEAddressLayout.WrapLongitude(tileDisplayDescriptorArray.topLeftTile.TileX, tileDisplayDescriptorArray.topLeftTile.ZoomLevel);
            return(tileDisplayDescriptorArray);
        }
Пример #2
0
 public int XValueOneTileEast(TileAddress ta)
 {
     return(VEAddressLayout.WrapLongitude(ta.TileX + 1, ta.ZoomLevel));
 }