Google. Maps. Feature. Shape. Area
A geometric representation of a flat MapFeature. For example, a park.
Summary
Inheritance
Inherits from: Google.Maps.Feature.Shape.MapFeatureShape, IEquatable< Area >
Constructors and Destructors |
|
---|---|
Area(ICollection< Vector2 > vertices, ICollection< int > vertexBreaks, ICollection< int > triangles, int zOrder, bool recenter)
Constructs an area with no external edges. Included for backwards compatibility.
|
|
Area(ICollection< Vector2 > vertices, ICollection< int > vertexBreaks, ICollection< int > triangles, ICollection< bool > externalEdges, int zOrder, bool recenter)
The Area class constructor.
|
Public attributes |
|
---|---|
ExternalEdges
|
readonly bool[]
Contains whether each edge in the area is external to the feature. An external edge is one that borders another feature.
|
Triangles
|
readonly int[]
|
VertexBreaks
|
readonly int[]
Separates the Area's vertices into discrete intervals, each one that describes an individual polygon.
|
Vertices
|
readonly Vector2[]
Vertices that make up the Area's border. This is relative to the MapFeatureShape.Origin.
|
ZOrder
|
readonly int
The z-order of this area, as returned in the tile data from Factile.
|
Public functions |
|
---|---|
Equals(object obj)
|
override bool
|
Equals(Area other)
|
bool
Type specific equality method.
|
GenerateBoundaryEdges()
|
List< EdgeSequence >
Returns a list of lists of vertices, each inner list representing a contiguous edge run for this Area.
|
GenerateExternalBoundaryEdges()
|
List< EdgeSequence >
Returns a list of lists of vertices, each inner list representing a contiguous edge run for this Area. Only external boundary edges will be returned.
|
GetHashCode()
|
override int
|
IsEdgeExternal(int v1, int v2)
|
bool
Determines whether the edge between the verticies at index v1 and v2 is external to the polygon.
|
IsEmpty()
|
bool
|
RescaleCoordinates(float scale)
|
void
Rescale the coordinates of this Feature.Shape.Area, modifying vertices, origin and tile boundary crossing points.
|
ToString()
|
override string
|
Protected functions |
|||||
---|---|---|---|---|---|
CalculateLocalBoundingBox()
|
virtual override Bounds
|
||||
TranslateGeometry(Vector2 offset)
|
virtual override void
Translates the geometry by the supplied offset. This does not change the position of the Origin.
Parameters |
|
|
Public static functions |
|
---|---|
CombineAreas(Area[] areas, int zOrder, bool recenter)
|
Combines all the areas in the supplied array into a single area.
|
Empty()
|
Classes |
|
---|---|
Google. |
Represents a contiguous sequence of edges. Each vertex appears only once, unless this represents a closed loop (in which case the first and last verticies are identical). A sequence of n vertices represents n - 1 contiguous edges: [v0, v1], [v1, v2], ..., [v(n - 2), v(n - 1)]. |
Public attributes
ExternalEdges
readonly bool[] ExternalEdges
Contains whether each edge in the area is external to the feature. An external edge is one that borders another feature.
These external edges may be used for styling. For example, when drawing borders around regions, they should only be drawn on the external edges of the area.
Currently, this field is only supported for the AdministrativeArea1, Locality, and Sublocality feature types.
This array will always have the same number of elements as the Vertices array. For each vertex index i, the edge from vertex i to NextVertexInLoop[i] is external iff ExternalEdges[i] is true.
Triangles
readonly int[] Triangles
VertexBreaks
readonly int[] VertexBreaks
Separates the Area's vertices into discrete intervals, each one that describes an individual polygon.
Vertices
readonly Vector2[] Vertices
Vertices that make up the Area's border. This is relative to the MapFeatureShape.Origin.
ZOrder
readonly int ZOrder
The z-order of this area, as returned in the tile data from Factile.
Public functions
Area
Area( ICollection< Vector2 > vertices, ICollection< int > vertexBreaks, ICollection< int > triangles, int zOrder, bool recenter )
Constructs an area with no external edges. Included for backwards compatibility.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
Area
Area( ICollection< Vector2 > vertices, ICollection< int > vertexBreaks, ICollection< int > triangles, ICollection< bool > externalEdges, int zOrder, bool recenter )
The Area class constructor.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
Equals
override bool Equals( object obj )
GenerateBoundaryEdges
List< EdgeSequence > GenerateBoundaryEdges()
Returns a list of lists of vertices, each inner list representing a contiguous edge run for this Area.
The returned edge runs will form closed loops in anticlockwise winding order. This means that the outside of the Area is to the right of each edge.
Details | |
---|---|
Returns |
A List of connected edge sequences, each sequence represented by a list of vertices where each a list of n vertices represents n - 1 contiguous edges: [v0, v1], [v1, v2], ..., etc. The vertices are in world space.
|
GenerateExternalBoundaryEdges
List< EdgeSequence > GenerateExternalBoundaryEdges()
Returns a list of lists of vertices, each inner list representing a contiguous edge run for this Area. Only external boundary edges will be returned.
The returned edge runs will form closed loops in anticlockwise winding order. This means that the outside of the Area is to the right of each edge.
This method will return only the edges that are external to the map feature (that is, they border another feature). This makes this method good for adding borders to regions.
Details | |
---|---|
Returns |
A List of connected edge sequences, each sequence represented by a list of vertices where each a list of n vertices represents n - 1 contiguous edges: [v0, v1], [v1, v2], ..., etc. The vertices are in world space.
|
GetHashCode
override int GetHashCode()
IsEdgeExternal
bool IsEdgeExternal( int v1, int v2 )
Determines whether the edge between the verticies at index v1 and v2 is external to the polygon.
IsEmpty
bool IsEmpty()
RescaleCoordinates
void RescaleCoordinates( float scale )
Rescale the coordinates of this Feature.Shape.Area, modifying vertices, origin and tile boundary crossing points.
Details | |||
---|---|---|---|
Parameters |
|
ToString
override string ToString()
Protected functions
CalculateLocalBoundingBox
virtual override Bounds CalculateLocalBoundingBox()
TranslateGeometry
virtual override void TranslateGeometry( Vector2 offset )
Translates the geometry by the supplied offset. This does not change the position of the Origin.
offset
|
An offset vector used for translation.
|
Public static functions
CombineAreas
Area CombineAreas( Area[] areas, int zOrder, bool recenter )
Combines all the areas in the supplied array into a single area.
Concatenates the vertex lists and adjusted triangle and breaks lists where the indices in the latter two are adjusted for the new positions of their respective vertices in the combined vertex lists.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
The combined area.
|