-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathVectorTile.cs
More file actions
55 lines (40 loc) · 1.2 KB
/
VectorTile.cs
File metadata and controls
55 lines (40 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System.Collections.Generic;
using System.Diagnostics;
using System.Collections.ObjectModel;
namespace Mapbox.VectorTile
{
/// <summary>
/// Class to access the tile data
/// </summary>
[DebuggerDisplay("{Zoom}/{TileColumn}/{TileRow}")]
public class VectorTile
{
/// <summary>
/// Class to access the tile data
/// </summary>
/// <param name="data">Byte array containing the raw (already unzipped) tile data</param>
/// <param name="validate">If true, run checks if the tile contains valid data. Decreases decoding speed.</param>
public VectorTile(byte[] data, bool validate = true)
{
_VTR = new VectorTileReader(data, validate);
}
private VectorTileReader _VTR;
/// <summary>
/// Collection of layers contained in the tile
/// </summary>
/// <returns>Collection of layer names</returns>
public ReadOnlyCollection<string> LayerNames()
{
return _VTR.LayerNames();
}
/// <summary>
/// Get a tile layer by name
/// </summary>
/// <param name="layerName">Name of the layer to request</param>
/// <returns>Decoded <see cref="VectorTileLayer"/></returns>
public VectorTileLayer GetLayer(string layerName)
{
return _VTR.GetLayer(layerName);
}
}
}