Search Results for

    Show / Hide Table of Contents

    Class TileIndexExtensions

    Extension methods for BruTile.TileIndex.

    Inheritance
    object
    TileIndexExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Mapsui.Tiling.Extensions
    Assembly: Mapsui.Tiling.dll
    Syntax
    public static class TileIndexExtensions

    Methods

    | Edit this page View Source

    ToLong(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
    This encoding supports tile coordinates far beyond any practical map zoom level (web maps typically max out around level 22-24).
    | Edit this page View Source

    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.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX