google.maps.Data.Polygon class
A Polygon geometry contains a number of Data.LinearRings. The first linear-ring must be the polygon exterior boundary and subsequent linear-rings must be interior boundaries, also known as holes. See the sample polygon with a hole.
This class implements Data.Geometry.
Constructor
Data.Polygon(elements)
Parameters:
- elements: Array<Data.LinearRing|Array<LatLng|LatLngLiteral>>
Constructs a Data.Polygon from the given Data.LinearRings or arrays of positions.
Methods
forEachLatLng(callback)
Parameters:
- callback: function(LatLng)
Return Value: None
getArray()
Parameters: None
Return Value: Array<Data.LinearRing>
Returns an array of the contained Data.LinearRings. A new array is returned each time getArray() is called.
getAt(n)
Parameters:
- n: number
Return Value: Data.LinearRing
Returns the n-th contained Data.LinearRing.
getLength()
Parameters: None
Return Value: number
Returns the number of contained Data.LinearRings.
getType()
Parameters: None
Return Value: string
Returns the string "Polygon".