# GeoExt

### Navigation

- GeoExt »
- API Reference »
- `GeoExt.data` »
- `GeoExt.data.LayerReader`

# `GeoExt.data.LayerReader`

Extends
  - Ext.data.DataReader

class `GeoExt.data.``LayerReader`(meta, recordType)
  Data reader class to create an array of `GeoExt.data.LayerRecord` objects from an array of `OpenLayers.Layer` objects for use in a `GeoExt.data.LayerStore` object.

## Example Use

Sample using a reader to create records from an array of layers:

    var reader = new GeoExt.data.LayerReader();
    var layerData = reader.readRecords(map.layers);
    var numRecords = layerData.totalRecords;
    var layerRecords = layerData.records;

## Public Methods

Public methods in addition to those listed for Ext.data.DataReader.

`LayerReader.``readRecords`()

  Parameter: | layers – `Array(OpenLayers.Layer)` List of layers for creating records.
  Returns: | `Object` An object with `records` and `totalRecords` properties.

  From an array of `OpenLayers.Layer` objects create a data block containing `GeoExt.data.LayerRecord` objects.

### Navigation

- index
- modules |
- next |
- previous |
- GeoExt »
- API Reference »
- `GeoExt.data` »
- `GeoExt.data.LayerReader`