dojox/geo/openlayers/Layer (version 1.10)

Summary

Base layer class for dojox.geo.openlayers.Map specific layers extending OpenLayers.Layer class. This layer class accepts Features which encapsulates graphic objects to be added to the map. This layer class encapsulates an OpenLayers.Layer. This class provides Feature management such as add, remove and feature access.

Usage

var foo = new Layer(name,options);
dojox/geo/openlayers/Layer
Parameter Type Description
name String

The name of the layer.

options Object

Options passed to the underlying OpenLayers.Layer object.

See the dojox/geo/openlayers/Layer reference documentation for more information.

Method Summary

  • added() Called when the layer is added to the map
  • addFeature(f) Add a feature or an array of features to the layer.
  • clear() Removes all the features from this layer.
  • getDojoMap()
  • getFeatureAt(i) Returns the i-th feature of this layer.
  • getFeatureCount() Returns the number of the features contained by this layer.
  • getFeatures() Returns the feature hold by this layer.
  • moveTo(event) Called when the layer is panned or zoomed.
  • redraw() Redraws this layer
  • removeFeature(f) Removes a feature or an array of features from the layer.
  • removeFeatureAt(index) Remove the feature at the specified index.
  • renderFeature(f) Called when rendering a feature is necessary.

Methods

added()

Called when the layer is added to the map

addFeature(f)

Add a feature or an array of features to the layer.

Parameter Type Description
f Feature | Feature[]

The Feature or array of features to add.

clear()

Removes all the features from this layer.

getDojoMap()
Returns:undefined
getFeatureAt(i)

Returns the i-th feature of this layer.

Parameter Type Description
i Number

The index of the feature to return.

Returns:any | undefined

The i-th feature of this layer.

getFeatureCount()

Returns the number of the features contained by this layer.

Returns:any | number | undefined

The number of the features contained by this layer.

getFeatures()

Returns the feature hold by this layer.

Returns:any | undefined

The untouched array of features hold by this layer.

moveTo(event)

Called when the layer is panned or zoomed.

Parameter Type Description
event MouseEvent

The event

redraw()

Redraws this layer

removeFeature(f)

Removes a feature or an array of features from the layer.

Parameter Type Description
f Feature | Feature[]

The Feature or array of features to remove.

removeFeatureAt(index)

Remove the feature at the specified index.

Parameter Type Description
index int

The index of the feature to remove.

renderFeature(f)

Called when rendering a feature is necessary.

Parameter Type Description
f dojox/geo/openlayers/Feature

The feature to draw.

Error in the documentation? Can’t find what you are looking for? Let us know!