code: function() {
        var self = this;
  
        var oldLayers = this.layers;
        this.layers = {};
  
        function findLayerView(layer) {
          var lv = _.find(oldLayers, function(layer_view) {
            var m = layer_view.model;
            return m.isEqual(layer);
          });
          return lv;
        }
  
        function canReused(layer) {
          return self.map.layers.find(function(m) {
            return m.isEqual(layer);
          });
        }
  
        // remove all
        for(var layer in oldLayers) {
          var layer_view = oldLayers[layer];
          if (!canReused(layer_view.model)) {
            layer_view.remove();
          }
        }
  
        this.map.layers.each(function(lyr) {
          var lv = findLayerView(lyr);
          if (!lv) {
            self._addLayer(lyr);
          } else {
            lv.setModel(lyr);
            self.layers[lyr.cid] = lv;
            self.trigger('newLayerView', lv, lv.model, self);
          }
        });
  
      }
docs: this replaces the default functionality to search for already added views so they are not replaced