Class RasterTile
A raster tile from the Mapbox Style API, an encoded image representing a geographic bounding box. Usually JPEG or PNG encoded.
Inherited Members
Namespace:Mapbox.Map
Assembly:Mapbox.Map.dll
Syntax
public class RasterTile : Tile
Examples
Making a RasterTile request:
var parameters = new Tile.Parameters();
parameters.Fs = MapboxAccess.Instance;
parameters.Id = new CanonicalTileId(_zoom, _tileCoorindateX, _tileCoordinateY);
parameters.MapId = "mapbox://styles/mapbox/satellite-v9";
var rasterTile = new RasterTile();
// Make the request.
rasterTile.Initialize(parameters, (Action)(() =>
{
if (!string.IsNullOrEmpty(rasterTile.Error))
{
// Handle the error.
}
// Consume the Data.
}));
Properties
Data
Gets the raster tile raw data.
Declaration
public byte[] Data { get; }
Property Value
Type | Description |
---|---|
System.Byte[] | The raw data, usually an encoded JPEG or PNG. |
Examples
Consuming data in Unity to create a Texture2D:
var texture = new Texture2D(0, 0);
texture.LoadImage(rasterTile.Data);
_sampleMaterial.mainTexture = texture;