google-maps-documentation

Data.Feature class

google.maps.Data.Feature class

A feature has a geometry, an id, and a set of properties.

Constructor
Data.Feature
Data.Feature([options])
Parameters: 
Constructs a Feature with the given options.
Methods
forEachProperty
forEachProperty(callback)
Parameters: 
  • callbackfunction(*, string)
Return Value:  None
Repeatedly invokes the given function, passing a property value and name on each invocation. The order of iteration through the properties is undefined.
getGeometry
getGeometry()
Parameters:  None
Return Value:  Data.Geometry
Returns the feature's geometry.
getId
getId()
Parameters:  None
Return Value:  number|string optional
Returns the feature ID.
getProperty
getProperty(name)
Parameters: 
  • namestring
Return Value:  *
Returns the value of the requested property, or undefined if the property does not exist.
removeProperty
removeProperty(name)
Parameters: 
  • namestring
Return Value:  None
Removes the property with the given name.
setGeometry
setGeometry(newGeometry)
Parameters: 
Return Value:  None
Sets the feature's geometry.
setProperty
setProperty(name, newValue)
Parameters: 
  • namestring
  • newValue*
Return Value:  None
Sets the value of the specified property. If newValue is undefined this is equivalent to calling removeProperty.
toGeoJson
toGeoJson(callback)
Parameters: 
  • callbackfunction(Object)
Return Value:  None
Exports the feature to a GeoJSON object.
Events
removeproperty
function(event)
Arguments: 
This event is triggered when a feature's property is removed.
setgeometry
function(event)
Arguments: 
This event is triggered when a feature's geometry is set.
setproperty
function(event)
Arguments: 
This event is triggered when a feature's property is set.