google-maps-documentation

Data.GeometryCollection class

google.maps.Data.GeometryCollection class

A GeometryCollection contains a number of geometry objects. Any LatLng or LatLngLiteral objects are automatically converted to Data.Point geometry objects.

This class implements Data.Geometry.

Constructor
Data.GeometryCollection
Data.GeometryCollection(elements)
Parameters: 
Constructs a Data.GeometryCollection from the given geometry objects or LatLngs.
Methods
forEachLatLng
forEachLatLng(callback)
Parameters: 
  • callbackfunction(LatLng)
Return Value:  None
getArray
getArray()
Parameters:  None
Return Value:  Array<Data.Geometry>
Returns an array of the contained geometry objects. A new array is returned each time getArray() is called.
getAt
getAt(n)
Parameters: 
  • nnumber
Return Value:  Data.Geometry
Returns the n-th contained geometry object.
getLength
getLength()
Parameters:  None
Return Value:  number
Returns the number of contained geometry objects.
getType
getType()
Parameters:  None
Return Value:  string
Returns the string "GeometryCollection".