google.maps.Data.Feature class
A feature has a geometry, an id, and a set of properties.
Constructor
Data.Feature([options])
Parameters:
- options: Data.FeatureOptions optional
Constructs a Feature with the given options.
Methods
forEachProperty(callback)
Parameters:
- callback: function(*, 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()
Parameters: None
Return Value: Data.Geometry
Returns the feature's geometry.
getId()
Parameters: None
Return Value: number|string optional
Returns the feature ID.
getProperty(name)
Parameters:
- name: string
Return Value: *
Returns the value of the requested property, or undefined if the property does not exist.
removeProperty(name)
Parameters:
- name: string
Return Value: None
Removes the property with the given name.
setGeometry(newGeometry)
Parameters:
- newGeometry: Data.Geometry|LatLng|LatLngLiteral
Return Value: None
Sets the feature's geometry.
setProperty(name, newValue)
Parameters:
- name: string
- newValue: *
Return Value: None
Sets the value of the specified property. If newValue is undefined this is equivalent to calling removeProperty.
toGeoJson(callback)
Parameters:
- callback: function(Object)
Return Value: None
Exports the feature to a GeoJSON object.
Events
function(event)
Arguments:
- event: Data.RemovePropertyEvent
This event is triggered when a feature's property is removed.
function(event)
Arguments:
- event: Data.SetGeometryEvent
This event is triggered when a feature's geometry is set.
function(event)
Arguments:
- event: Data.SetPropertyEvent
This event is triggered when a feature's property is set.