Maps SDK for Unity
Current Version: v1.3.0 View changelog
Vector map of the world
Global digital elevation model
Cloudless satellite base map
Custom data

The Maps SDK for Unity is a collection of tools for building Unity applications from real map data. It enables Unity developers to interact with Mapbox web services APIs (including the Maps, Geocoding and Directions APIs) and create game objects via a C#-based API and graphical user interface.

Install the Maps SDK for Unity 1. Download the package
Get an access token and download the SDK directly." Sign up for an account, then follow the step-by-step walkthrough to help you get started with the Maps SDK for Unity. Please note that Unity 2017.1.0 or greater is required to install the Maps SDK for Unity.
2. Get an access token

If you don't have a Mapbox account, sign up for one here, then navigate to the token page in Mapbox Studio and copy your default public token to your clipboard. When you installed the Maps SDK for Unity a Mapbox menu was added to Unity. Click Mapbox > Configure Access from the Unity Editor menu, then paste your token into the Token field. If your token is valid, it will be saved to a text file named StreamingAssets/MapboxAccess.text. At runtime, the contents of this file will be read and cached for FileSource request purposes.

3. Add a map
Many games and applications built with the Maps SDK for Unity start by building a basemap from map tiles. To add a basemap:
  1. Create a new C# script named RasterMap.
  2. Add the code below to your RasterMap script.
    using UnityEngine;
    using Mapbox.Map;
    using Mapbox.Unity;
    using Mapbox.Utils;
    public class RasterMap : MonoBehaviour, Mapbox.Utils.IObserver<RasterTile>
    void Start()
    var map = new Map<RasterTile>(MapboxAccess.Instance);
    map.Zoom = 2;
    map.Vector2dBounds = Vector2dBounds.World();
    map.MapId = "mapbox://styles/mapbox/streets-v10";
    public void OnNext(RasterTile tile)
    if (tile.CurrentState == Tile.State.Loaded)
    if (tile.HasError)
    Debug.Log("RasterMap: " + tile.ExceptionsAsString);
    var tileQuad = GameObject.CreatePrimitive(PrimitiveType.Quad);
    tileQuad.transform.SetParent(transform); = tile.Id.ToString();
    tileQuad.transform.position = new Vector3(tile.Id.X, -tile.Id.Y, 0);
    var texture = new Texture2D(0, 0);
    var material = new Material(Shader.Find("Unlit/Texture"));
    material.mainTexture = texture;
    tileQuad.GetComponent<MeshRenderer>().sharedMaterial = material;
  3. Create an empty game object and add the RasterMap component to it.
  4. Press Play and watch the map build as tiles are loaded.
4. Add other features

A number of examples are bundled with the Maps SDK for Unity to help you learn how to add geocoding, directions, traffic and more advanced features to your game or application. For each example, associated scripts and resources can be found in the same root directory as the scene itself.

Want to dive deeper? Read our step-by-step tutorials about mesh generation. Tutorials on contour lines, 3D POIs, and more coming soon.

Attribution guidelines Help
Learn more about what kinds of attribution Mapbox require and why.
You must include the the Mapbox wordmark and attribution notice on any map that uses the Maps SDK for Unity. We provide an Attribution prefab that includes all required information and can be customized via uGUI.

You may adjust the position of the Mapbox wordmark and attribution notice, but they must remain visible on the map. You may also change the background and text color of the attribution notice to best match your design aesthetics, but all information must be clearly legible.

You may not otherwise alter the Mapbox wordmark or text attribution notice. If you wish to otherwise relocate or to remove the Mapbox wordmark, please contact our sales team to discuss options available under our Enterprise plans.