Show / Hide Table of Contents

Class RasterTile

A raster tile from the Mapbox Style API, an encoded image representing a geographic bounding box. Usually JPEG or PNG encoded.

Inheritance
System.Object
Tile
RasterTile
ClassicRasterTile
RawPngRasterTile
Inherited Members
Tile.Id
Tile.Error
Tile.SetError(String)
Tile.CurrentState
Tile.Initialize(Tile.Parameters, Action)
Tile.ToString()
Tile.Cancel()
Tile.SetState(Tile.State)
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;
Back to top Copyright © 2015-2016 Microsoft
Generated by DocFX