src/Layer.js
function Layer(source, geometry, view, textureStore, opts) {
  opts = opts || {};

  var self = this;

  this._source = source;
  this._geometry = geometry;
  this._view = view;
  this._textureStore = textureStore;

  this._effects = opts.effects || {};

  this._fixedLevelIndex = null;

  this._viewChangeHandler = function() {
    self.emit('viewChange', self.view());
  };

  this._view.addEventListener('change', this._viewChangeHandler);

  this._textureStoreChangeHandler = function() {
    self.emit('textureStoreChange', self.textureStore());
  };

  this._textureStore.addEventListener('textureLoad',
    this._textureStoreChangeHandler);
  this._textureStore.addEventListener('textureError',
    this._textureStoreChangeHandler);
  this._textureStore.addEventListener('textureInvalid',
    this._textureStoreChangeHandler);
}
function Layer(source, geometry, view, textureStore, opts) {
  opts = opts || {};

  var self = this;

  this._source = source;
  this._geometry = geometry;
  this._view = view;
  this._textureStore = textureStore;

  this._effects = opts.effects || {};

  this._fixedLevelIndex = null;

  this._viewChangeHandler = function() {
    self.emit('viewChange', self.view());
  };

  this._view.addEventListener('change', this._viewChangeHandler);

  this._textureStoreChangeHandler = function() {
    self.emit('textureStoreChange', self.textureStore());
  };

  this._textureStore.addEventListener('textureLoad',
    this._textureStoreChangeHandler);
  this._textureStore.addEventListener('textureError',
    this._textureStoreChangeHandler);
  this._textureStore.addEventListener('textureInvalid',
    this._textureStoreChangeHandler);
}
function Layer ( source , geometry , view , textureStore , opts ) { opts = opts || { } ; var self = this ; this . _source = source ; this . _geometry = geometry ; this . _view = view ; this . _textureStore = textureStore ; this . _effects = opts . effects || { } ; this . _fixedLevelIndex = null ; this . _viewChangeHandler = function ( ) { self . emit ( 'viewChange' , self . view ( ) ) ; } ; this . _view . addEventListener ( 'change' , this . _viewChangeHandler ) ; this . _textureStoreChangeHandler = function ( ) { self . emit ( 'textureStoreChange' , self . textureStore ( ) ) ; } ; this . _textureStore . addEventListener ( 'textureLoad' , this . _textureStoreChangeHandler ) ; this . _textureStore . addEventListener ( 'textureError' , this . _textureStoreChangeHandler ) ; this . _textureStore . addEventListener ( 'textureInvalid' , this . _textureStoreChangeHandler ) ; }
Signals that the layer has been rendered.

@param {boolean} stable Whether all tiles were successfully rendered without
missing textures or resorting to fallbacks.
@event Layer#renderComplete
 
@class Layer
@classdesc

A Layer is a combination of {@link Source}, {@link Geometry}, {@link View}
and {@link TextureStore} that may be added into a {@link Stage} and rendered
with {@link Effects}.

@param {Source} source
@param {Geometry} geometry
@param {View} view
@param {TextureStore} textureStore
@param {Object} opts
@param {Effects} opts.effects
Signals that the layer has been rendered .