code: function(viewport) {
              var position = viewport.pixelFromPoint(this.location, true);
              var size = this._getSizeInPixels(viewport);
              this.adjust(position, size);
  
              var rotate = 0;
              if (viewport.degrees &&
                  this.rotationMode !== $.OverlayRotationMode.NO_ROTATION) {
                  // BOUNDING_BOX is only valid if both directions get scaled.
                  // Get replaced by EXACT otherwise.
                  if (this.rotationMode === $.OverlayRotationMode.BOUNDING_BOX &&
                      this.width !== null && this.height !== null) {
                      var rect = new $.Rect(position.x, position.y, size.x, size.y);
                      var boundingBox = this._getBoundingBox(rect, viewport.degrees);
                      position = boundingBox.getTopLeft();
                      size = boundingBox.getSize();
                  } else {
                      rotate = viewport.degrees;
                  }
              }
  
              return {
                  position: position,
                  size: size,
                  rotate: rotate
              };
          }
docs: private