function populateLayers(layers, data, opt) {
  // track used data rows
  let usedRows = []

  // process each layer
  for (let i = 0; i < layers.length; i++) {
    let layer = layers[i]

    let dataRow = Core.populator.selectDataRow(data, usedRows, opt.randomizeData)

    // populate layer
    populateLayer(layer, dataRow.dataRow, {
      rootDir: opt.rootDir,
      trimText: opt.trimText,
      insertEllipsis: opt.insertEllipsis,
      defaultSubstitute: opt.defaultSubstitute
    })
  }
}
Populates an array of layers using the provided data array.

@param {Array} layers
@param {Array} data
@param {Object} opt

opt: {
  rootDir: {String},
  randomizeData: {Boolean},
  trimText: {Boolean},
  insertEllipsis: {Boolean},
  defaultSubstitute: {String}
}