def _map_step_size(map_size: int, lod: int) -> int:
    """Return the step size in the tile grid for the given map.

    Args:
        map_size (int): The base map size in map units
        lod (int): The LOD level for which to calculate step size

    Returns:
        int: The coordinate distance between two tiles in the map grid

    """
    if lod == 0:
        return 4
    if lod == 1 or map_size <= 1024:
        return 8
    if lod == 2 or map_size <= 2048:
        return 16
    return 32