Google.Maps.Feature.MapFeature

This is an abstract class.

Mutable data associated with a map feature.

Summary

There's a one-to-one correspondence between MapFeatures and generated Unity GameObjects. Due to feature chunking, there can be multiple GameObjects representing a feature in the Unity scene, with each one having a unique MapFeature but with all sharing a common MapFeatureMetadata.

Note: The tile coordinates and geometry of this feature can change if additional feature chunks are combined for the same PlaceId through feature chunk stitching.

Inheritance

Direct Known Subclasses:Google.Maps.Feature.AreaWater, Google.Maps.Feature.ExtrudedStructure, Google.Maps.Feature.LineWater, Google.Maps.Feature.ModeledStructure, Google.Maps.Feature.Region, Google.Maps.Feature.Segment, Google.Maps.Unity.Intersections.IntersectionFeature

Constructors and Destructors

MapFeature(MapFeatureMetadata mapFeatureMetadata, TileCoord tileCoord)
The MapFeature class constructor.

Public attributes

MapFeatureMetadata
Metadata associated with this MapFeature.

Properties

DefaultGameObjectName
abstract string
The default name to use for the associated GameObject.

Public functions

GameObjectName()
string
The name used for the GameObject associated with this MapFeature.
GetShape()
virtual abstract MapFeatureShape
Returns the shape of a MapFeature if it has one.

Protected functions

GetMapFeatureMetadata< T >()
T
Returns the metadata from this feature, cast to a feature-specific type.

Public attributes

MapFeatureMetadata

readonly MapFeatureMetadata MapFeatureMetadata

Metadata associated with this MapFeature.

Due to chunking, multiple MapFeatures can reference the same MapFeatureMetadata

Properties

DefaultGameObjectName

abstract string DefaultGameObjectName

The default name to use for the associated GameObject.

This name is used when the MapFeatureMetadata doesn't have an explicit display name.

Public functions

GameObjectName

string GameObjectName()

The name used for the GameObject associated with this MapFeature.

GetShape

virtual abstract MapFeatureShape GetShape()

Returns the shape of a MapFeature if it has one.

Details
Returns
Returns a MapFeatureShape instance representing the shape of the feature if it has one, otherwise returns null.

MapFeature

 MapFeature(
  MapFeatureMetadata mapFeatureMetadata,
  TileCoord tileCoord
)

The MapFeature class constructor.

Details
Parameters
mapFeatureMetadata
Metadata associated with this feature.
tileCoord
Tile Coordinates.

Protected functions

GetMapFeatureMetadata< T >

T GetMapFeatureMetadata< T >()

Returns the metadata from this feature, cast to a feature-specific type.

Details
Template Parameters
T
The type to cast the metadata to.
Returns
The cast metadata.