Quantcast
Channel: maps for developers - Medium
Viewing all articles
Browse latest Browse all 2230

Migrating your Mapzen Unity project

$
0
0

By: Siyu Song

While we were sad to hear our friends at Mapzen are moving on, we’d like to cheers to all the awesome work Mapzen has pushed forward in Unity.

During this time of transition, we’ve received a lot of questions about using our Maps SDK for Unity as a solution for projects built with Tangram or Mapzen’s metro extracts. We’ve just released an update with major performance improvements, dynamic zoom, and a new suite of example scenes for you to get started with. Below are some tips for migrating your projects from Mapzen to Mapbox:

Whether you’re building an Earth sim with satellite imagery and terrain, a location based game, or a city visualization, get started with the example scenes that come with the Maps SDK for Unity.

If you were using GeoJSON, you probably fetched the GeoJSON manually, parsing it into a JSON object and querying it for data like layers and features inside those layers doing something like:

var vectorData = new JSONObject(www.text);
var layer = vectorData[layerName];

Instead of using GeoJSON to deliver the underlying map data, Mapbox vector tiles use a protobuf format that’s optimized for file size and download speed. The Maps for Unity SDK takes care of decompressing and decoding the data so it’s accessible within Unity.

Use the Map Editor to customize and style your map visualizations in Unity.

For more information on how to use vector tiles, head over to the SDK API docs for the VectorTile class. You can query vector tiles for properties similar to a JSON object. For instance, vectorTile.LayerNames will give you all the layers in a vector tile, and vectorTile.GetLayer(layerName) will give you the data in a given layer.

This is only necessary if you want to use your own mesh generation though. Otherwise you can use existing world visualization structure as shown in our tutorials.

Check out our open source repo for the Maps SDK for Unity, and reach out if you have any questions about migrating your Unity projects to Mapbox. Tweet us @Mapbox or contact our support team. We’re excited to build with you all in 2018!

Siyu Song


Migrating your Mapzen Unity project was originally published in Points of interest on Medium, where people are continuing the conversation by highlighting and responding to this story.


Viewing all articles
Browse latest Browse all 2230

Trending Articles