_calculateNewPitchAndBearing({deltaScaleX, deltaScaleY, startBearing, startPitch}) {
    const {minPitch, maxPitch} = this._viewportProps;

    const bearing = startBearing + 180 * deltaScaleX;
    let pitch = startPitch;
    if (deltaScaleY > 0) {
      // Gradually increase pitch
      pitch = startPitch + deltaScaleY * (maxPitch - startPitch);
    } else if (deltaScaleY < 0) {
      // Gradually decrease pitch
      pitch = startPitch - deltaScaleY * (minPitch - startPitch);
    }

    return {
      pitch,
      bearing
    };
  }
// Calculates a new pitch and bearing from a position (coming from an event)
Calculates a new pitch and bearing from a position (coming from an event)
Calculates a new pitch and bearing from a position ( coming from an event )
_calculateNewPitchAndBearing({deltaScaleX, deltaScaleY, startBearing, startPitch}) {
    const {minPitch, maxPitch} = this._viewportProps;
    const bearing = startBearing + 180 * deltaScaleX;
    let pitch = startPitch;
    if (deltaScaleY > 0) {
      pitch = startPitch + deltaScaleY * (maxPitch - startPitch);
    } else if (deltaScaleY < 0) {
      pitch = startPitch - deltaScaleY * (minPitch - startPitch);
    }
    return {
      pitch,
      bearing
    };
  }
_calculateNewPitchAndBearing ( { deltaScaleX , deltaScaleY , startBearing , startPitch } ) { const { minPitch , maxPitch } = this . _viewportProps ; const bearing = startBearing + 180 * deltaScaleX ; let pitch = startPitch ; if ( deltaScaleY > 0 ) { pitch = startPitch + deltaScaleY * ( maxPitch - startPitch ) ; } else if ( deltaScaleY < 0 ) { pitch = startPitch - deltaScaleY * ( minPitch - startPitch ) ; } return { pitch , bearing } ; }
Calculates a new pitch and bearing from a position (coming from an event)
Calculates a new pitch and bearing from a position ( coming from an event )
// Gradually increase pitch // Gradually decrease pitch