Class TileIndexExtensions
Extension methods for BruTile.TileIndex.
Inherited Members
Namespace: Mapsui.Tiling.Extensions
Assembly: Mapsui.Tiling.dll
Syntax
public static class TileIndexExtensions
Methods
| Edit this page View SourceToLong(TileIndex)
Encodes a BruTile.TileIndex into a single long value. This is useful for using tile indices as dictionary keys or cache identifiers.
Declaration
public static long ToLong(this TileIndex index)
Parameters
| Type | Name | Description |
|---|---|---|
| TileIndex | index | The tile index to encode. |
Returns
| Type | Description |
|---|---|
| long | A long value uniquely representing the tile index. |
Remarks
Bit layout (64 bits total):
- Bits 0-27 (28 bits): Row - supports up to 268 million tiles per axis
- Bits 28-55 (28 bits): Col - supports up to 268 million tiles per axis
- Bits 56-63 (8 bits): Level - supports zoom levels 0-255
ToTileIndex(long)
Decodes a long value back into a BruTile.TileIndex. This is the inverse of ToLong(TileIndex).
Declaration
public static TileIndex ToTileIndex(this long value)
Parameters
| Type | Name | Description |
|---|---|---|
| long | value | The encoded tile index value. |
Returns
| Type | Description |
|---|---|
| TileIndex | The decoded tile index. |