code: function(width, height){
              if(width !== void 0){
                  this.width = width;
              }
              if(height !== void 0){
                  this.height = height;
              }
  
              width = this.width * this.tileSize;
              height = this.height * this.tileSize;
  
              var devicePixelRatio = window.devicePixelRatio || 1;
  
              if(devicePixelRatio !== 1){
  
                  this.canvas.style.width = width + 'px';
                  this.canvas.style.height = height + 'px';
  
                  this.buffer.style.width = width + 'px';
                  this.buffer.style.height = height + 'px';
  
                  width = Math.round(width * devicePixelRatio);
                  height = Math.round(height * devicePixelRatio);
              }
  
              this.devicePixelRatio = devicePixelRatio;
              this.canvas.width = width;
              this.canvas.height = height;
  
              this.buffer.width = width;
              this.buffer.height = height;
              this.bufferCtx.scale(devicePixelRatio, devicePixelRatio);
              this.offsetX = Math.floor(this.width * 0.5);
              this.offsetY = Math.floor(this.height * 0.5);
  
          }
docs: Resizes canvas elements to match the tileSize and map view with/height. Also adjusts behavior to accomodate high pixel density screens.
  @method resize