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:
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.GeometryReturns the feature's geometry. |
getId |
getId()Parameters: None
Return Value:
number|string optionalReturns the feature ID. |
getProperty |
getProperty(name)Parameters:
Return Value:
*Returns the value of the requested property, or undefined if the property does not exist. |
removeProperty |
removeProperty(name)Parameters:
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:
Return Value: None
Sets the value of the specified property. If newValue is undefined this is equivalent to calling removeProperty. |
toGeoJson |
toGeoJson(callback)Parameters:
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. |