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); }
public TileDisplayDescriptorArray GetTileArrayDescriptor(LatLonZoom center, Size windowSize) { TileDisplayDescriptorArray tileDisplayDescriptorArray = new TileDisplayDescriptorArray(); MapRectangle unclippedMapWindow = this.GetUnclippedMapWindow(center, windowSize); tileDisplayDescriptorArray.topLeftTile = this.GetTileContainingLatLonZoom(new LatLonZoom(unclippedMapWindow.GetNW(), center.zoom)); TileAddress tileContainingLatLonZoom = this.GetTileContainingLatLonZoom(new LatLonZoom(unclippedMapWindow.GetSE(), center.zoom)); tileDisplayDescriptorArray.tileCountX = tileContainingLatLonZoom.TileX - tileDisplayDescriptorArray.topLeftTile.TileX + 1; tileDisplayDescriptorArray.tileCountY = -(tileContainingLatLonZoom.TileY - tileDisplayDescriptorArray.topLeftTile.TileY) + 1; Point64 point = new Point64(this.degreesToPixels(unclippedMapWindow.GetNW().lon, center.zoom), this.degreesToPixels(unclippedMapWindow.GetNW().lat, center.zoom)); tileDisplayDescriptorArray.topLeftTileOffset = new Point((int)((long)(tileDisplayDescriptorArray.topLeftTile.TileX * 512) - point.X), (int)(point.Y - (long)((tileDisplayDescriptorArray.topLeftTile.TileY + 1) * 512))); tileDisplayDescriptorArray.layout = this.addressLayout; tileDisplayDescriptorArray.tileSize = this.GetTileSize(); return(tileDisplayDescriptorArray); }
public TileAddressEnumerator(TileDisplayDescriptorArray tad) { this.tad = tad; }