City simulator
You can use the City simulator as a starting point for applications that need a scene with 3D features such as buildings and terrain with elevation. To visualize a map, this example scene comes ready with the CitySimulatorMap
prefab.
Visualize a map
Click on CitySimulatorMap
in the Hierarchy to open the Inspector to see and edit the settings.
By default, City Simulator uses the Mapbox Streets style. The style is specified in the IMAGE settings under the Data Source menu. You can change to another Mapbox default style or use a custom style.
Elevation data is provided in the TERRAIN settings by the Mapbox Terrain-RGB raster tileset.
The MAP LAYERS settings are where the vector tileset is configured. This example uses Mapbox Streets With Building Ids for the default. To change the tileset, select another option in the Data Source field.
You can see where the example configures the Map Layers in the FEATURES settings. This example sets ExtrudedBuildings and Roads. Select ExtrudedBuildings to see the settings for the visualizer.
This feature makes use of the building
layer in the Mapbox Streets v7 tileset. This data is used to create and style the layer's feature on the map. The styling is determined by the Extrusion Type and Texturing settings.
You can change the texture of the mesh by specifying another option in the Style Type settings of the Texturing section.
Add a custom feature
The scene can be extended to add any other vector features that you want. To add a custom vector feature, follow the steps below:
- Click the Add Feature button and select Custom.
- Specify a title for the new feature.
- Change the Data Layer to the layer you require. For this example the
water
[layer] (https://docs.mapbox.com/vector-tiles/reference/mapbox-streets-v7#water) has been specified. - Change the Texturing Style Type to Custom and then specify a Top Material and Side Material. For this example
MapboxBlue
, which is included in the SDK, has been selected.