google-maps-documentation

Data.Polygon class

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
Data.Polygon(elements)
Parameters: 
Constructs a Data.Polygon from the given Data.LinearRings or arrays of positions.
Methods
forEachLatLng
forEachLatLng(callback)
Parameters: 
  • callbackfunction(LatLng)
Return Value:  None
getArray
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
getAt(n)
Parameters: 
  • nnumber
Return Value:  Data.LinearRing
Returns the n-th contained Data.LinearRing.
getLength
getLength()
Parameters:  None
Return Value:  number
Returns the number of contained Data.LinearRings.
getType
getType()
Parameters:  None
Return Value:  string
Returns the string "Polygon".