| | 1 | | using System; |
| | 2 | |
|
| | 3 | | namespace Itinero.Network.Tiles; |
| | 4 | |
|
| | 5 | | /// <summary> |
| | 6 | | /// Contains network tile extensions. |
| | 7 | | /// </summary> |
| | 8 | | internal static class NetworkTileExtensions |
| | 9 | | { |
| | 10 | | /// <summary> |
| | 11 | | /// Gets the location of the given vertex. |
| | 12 | | /// </summary> |
| | 13 | | /// <param name="tile">The tile.</param> |
| | 14 | | /// <param name="vertex">The vertex.</param> |
| | 15 | | /// <returns>The location.</returns> |
| | 16 | | /// <exception cref="ArgumentOutOfRangeException">When the vertex doesn't exist.</exception> |
| | 17 | | public static (double longitude, double latitude, float? e) GetVertex(this NetworkTile tile, |
| | 18 | | VertexId vertex) |
| 0 | 19 | | { |
| 0 | 20 | | if (!tile.TryGetVertex(vertex, out var longitude, out var latitude, out var e)) |
| 0 | 21 | | { |
| 0 | 22 | | throw new ArgumentOutOfRangeException(nameof(vertex)); |
| | 23 | | } |
| | 24 | |
|
| 0 | 25 | | return (longitude, latitude, e); |
| 0 | 26 | | } |
| | 27 | | } |