google-maps-documentation

Data.LineString class

google.maps.Data.LineString class

A LineString geometry contains a number of LatLngs.

This class implements Data.Geometry.

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