code: function() {
          if ( !this.layerStates.length ||
               (this.map.layers.length != this.layerStates.length) ) {
              return true;
          }
  
          for (var i = 0, len = this.layerStates.length; i < len; i++) {
              var layerState = this.layerStates[i];
              var layer = this.map.layers[i];
              if ( (layerState.name != layer.name) ||
                   (layerState.inRange != layer.inRange) ||
                   (layerState.id != layer.id) ||
                   (layerState.visibility != layer.visibility) ) {
                  return true;
              }
          }
  
          return false;
      }
docs: Method: checkRedraw
  Checks if the layer state has changed since the last redraw() call.
  
  Returns:
  {Boolean} The layer state changed since the last redraw() call.