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.PseudoMapFeature, Google.Maps.Feature.Region, Google.Maps.Feature.Segment

Constructors and Destructors

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

Public attributes

MapFeatureMetadata
Metadata associated with this MapFeature.
TileCoords = new List()
readonly List< TileCoord >
The (x,y) coordinates of the Google Maps tiles that contain this map feature.

Properties

DefaultGameObjectName
abstract string
The default name to use for the associated GameObject.
IsStaticBatchable
bool
Indicates whether this MapFeature is a valid candidate for static batching.
IsStitchable
abstract bool
Indicates whether this MapFeature has stitchable features.

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.
MergeTileCoordsFrom(MapFeature sourceMapFeature)
void
Appends the tile coordinates from the source MapFeature to the tile coordinates for this feature.

Public attributes

MapFeatureMetadata

readonly MapFeatureMetadata MapFeatureMetadata

Metadata associated with this MapFeature.

Due to chunking, multiple MapFeatures can reference the same MapFeatureMetadata

TileCoords

readonly List< TileCoord > TileCoords = new List()

The (x,y) coordinates of the Google Maps tiles that contain this map feature.

For more information, see Map and Tile Coordinates. Note: This is a mutable collection to facilitate feature stitching.

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.

IsStaticBatchable

bool IsStaticBatchable

Indicates whether this MapFeature is a valid candidate for static batching.

Note: Any feature that is not stitchable is batchable.

IsStitchable

abstract bool IsStitchable

Indicates whether this MapFeature has stitchable features.

Currently, features are either stitchable (buildings) or not-stitchable (everything else). We don't currently support partially stitching large features.

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.

MergeTileCoordsFrom

void MergeTileCoordsFrom(
  MapFeature sourceMapFeature
)

Appends the tile coordinates from the source MapFeature to the tile coordinates for this feature.

This method is used by feature stitching code to merge features while remembering from which tiles, parts of the feature have been loaded. This is necessary for caching.

Details
Parameters
sourceMapFeature
The source feature from which to merge TileCoords.

Send feedback about...

Google Maps Platform gaming solution
Google Maps Platform gaming solution