The Map Layers section of the AbstractMap script is where you can control how vector features are rendered on your map.
Data Source: This setting is where you can specify the tileset to use for your map layer.
- Buildings With Building Ids: This tileset combines Mapbox-Streets-v7 vector data with our experimental 3D buildings data, which assigns unique IDs to building features to avoid visual artifacts for buildings at tile borders.
- Mapbox Streets: This is the Mapbox-Streets-v7 tileset. This tileset will be the most appropriate choice for common use cases.
- Custom: Use this setting for bringing your custom tileset into Unity. You can create a composite data source for your layer by adding multiple comma-separated tileset IDs in the Map Ids field. This allows you to use multiple custom tilesets, or add your custom tileset as well as the default Mapbox Streets tileset. For more information on how to use custom data with the Maps SDK for Unity, refer to the custom data documentation.
Map features is where you can specify how to render specific layers from the tilesets assigned as a Data Source.
- With a Data Source selected, click on FEATURES and then on Add Features.
- A selection dialogue will appear with the following: Buildings, Roads, Landuse, Points, and Custom. These settings refer to the layers contained in the selected Data Source.
- Select a layer for the required feature.
Add 3D buildings to your map with the following steps:
- Select Buildings for the map feature.
- Preset settings for the feature type selected will be populated. Click on the Name to rename the feature.
- Enter Play mode. The 3D buildings from the
buildinglayer on the Mapbox-Streets-v7 tileset will be rendered on your map.
See the sections below for details on the default settings, and how to further customize the 3D buildings in your scene.
Using filters you can make settings to conditionally render vector features contained in the
In this section you can make settings to fine tune your meshes.
Primitive Type: Vector data is made up of lines, polygons, points, or custom data. The primitive type defines the type of vector feature you are trying to access. In the case of buildings this will be “polygon” since building footprints are essentially polygons extruded by a height value.
Extrusion Type: The extrusion type setting provides a way to specify max, min, or fixed heights for buildings. The available options are below. You will see different settings in the inspector depending on these dropdown selections.
- None: No extrusion.
- Property Height: Extrudes features using the property value.
- Min Height: Extrudes features using the property value. If height is not uniform, this sets the height based on property's minimum height value. This results in flat rooftops.
- Max Height: Extrudes features using the property value. If height is not uniform, this sets the height based on property's maximum height. This results in flat rooftops.
- Range Height: Extrudes features using the property value. Values are clamped to the min and max values if they are lower or greater than the min and max values respectively.
- Absolute Height: Extrudes all features using a fixed value.
Geometry Type: Settings to extrude roofs, sidewalls, or both.
Property Name: The name of the property on the
building layer of the tileset that is used for extrusion. By default it is set to
height. For more information see the Mapbox Streets v7 tileset layer reference.
Scale Factor: The height scale factor by which you would like to extrude the buildings. For example, if this is set to
2, the building extrusions will be done at twice the original scale.
Snap to Terrain: This makes sure buildings snap properly to the terrain when using a terrain with elevation. When this is not checked, the buildings might spawn above or below the terrain.
Combine Meshes: Check this option if you want to combine all the building meshes on a tile into a single game object. While this helps improve runtime performance, it may not offer you flexibility to make changes on individual buildings (for example, changing the color or texture of a particular building). It may also make it impossible to use a raycast to find the address of a building.
Collider Type: This option is used to add a collider to the extruded buildings. The available types of colliders that you can apply to your buildings are Box Collider, Mesh Collider, or Sphere Collider. Note that if you have Combine Meshes selected, this option will add a collider to the entire tile instead of to individual buildings.
Use the Texturing settings to configure material options for the building geometry.
- Custom: Choose this setting to specify custom materials and texturing type.
- Simple: The Simple style combines stylized vector designs with scriptable palettes to create a procedurally colored style.
- Light: The Light style uses colored materials to create a light, greyscale shading for your map.
- Dark: The Dark style uses colored materials to create a dark, greyscale shading for your map.
- Realistic: This is the default texturing for buildings. This combines modern and urban designs with physically based rendering materials to create a contemporary cityscape.
- Fantasy: The Fantasy style combines old world medieval designs with physically based rendering materials to create a fantasy-style city visualization.
- Satellite: The Satellite style uses high-resolution satellite imagery as a texture set. The comprehensive set of road, label, and POI information brings clarity and context to the crisp detail in our high-resolution satellite imagery.
- Color: The Color style is for user-defined color and opacity. Use this setting to specify a custom color.
Behavior modifiers are
ScriptableObjects that work with meshes and game objects to further allow you to decorate, enhance, or make modifications to your game objects.