Skip to content

Latest commit

 

History

History
147 lines (75 loc) · 2.73 KB

Data.Feature.md

File metadata and controls

147 lines (75 loc) · 2.73 KB

See html formatted version

Data.Feature class

google.maps.Data.Feature class

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

Constructor

undefined

Data.Feature([options])

Parameters: 

Constructs a Feature with the given options.

Methods

undefined

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.

undefined

getGeometry()

Parameters:  None

Return Value:  Data.Geometry

Returns the feature's geometry.

undefined

getId()

Parameters:  None

Return Value:  number|string optional

Returns the feature ID.

undefined

getProperty(name)

Parameters: 

  • name:  string

Return Value:  *

Returns the value of the requested property, or undefined if the property does not exist.

undefined

removeProperty(name)

Parameters: 

  • name:  string

Return Value:  None

Removes the property with the given name.

undefined

setGeometry(newGeometry)

Parameters: 

Return Value:  None

Sets the feature's geometry.

undefined

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.

undefined

toGeoJson(callback)

Parameters: 

  • callback:  function(Object)

Return Value:  None

Exports the feature to a GeoJSON object.

Events

undefined

function(event)

Arguments: 

This event is triggered when a feature's property is removed.

undefined

function(event)

Arguments: 

This event is triggered when a feature's geometry is set.

undefined

function(event)

Arguments: 

This event is triggered when a feature's property is set.