/// <summary> /// Gets the tile stats json for the supplied source Id. /// </summary> /// <returns>A prepopulated <see cref=" TileStats"/> instance.</returns> /// <param name="sourceId">Source Id of the Mapbox Tileset.</param> public TileStats GetTileStats(VectorSourceType sourceType) { TileStats stats = null; switch (sourceType) { case VectorSourceType.MapboxStreets: case VectorSourceType.MapboxStreetsWithBuildingIds: StreamReader reader = new StreamReader(_filePath); stats = JsonConvert.DeserializeObject <TileStats>(reader.ReadToEnd()); reader.Close(); break; default: break; } return(stats); }
/// <summary> /// Gets the tile stats json for the supplied source Id. /// </summary> /// <returns>A prepopulated <see cref=" TileStats"/> instance.</returns> /// <param name="sourceId">Source Id of the Mapbox Tileset.</param> public TileStats GetTileStats(VectorSourceType sourceType) { TileStats stats = null; switch (sourceType) { case VectorSourceType.MapboxStreets: case VectorSourceType.MapboxStreetsWithBuildingIds: using (Stream stream = new FileStream(_filePath, FileMode.Open)) { using (StreamReader reader = new StreamReader(stream)) { stats = JsonConvert.DeserializeObject <TileStats>(reader.ReadToEnd()); } } break; default: break; } return(stats); }