MCPcopy
hub / github.com/visgl/deck.gl / updateViewport

Method updateViewport

modules/core/src/controllers/map-controller.ts:630–648  ·  view source on GitHub ↗
(
    newControllerState: MapState,
    extraProps: Record<string, any> | null = null,
    interactionState: InteractionState = {}
  )

Source from the content-addressed store, hash-verified

628 }
629
630 protected updateViewport(
631 newControllerState: MapState,
632 extraProps: Record<string, any> | null = null,
633 interactionState: InteractionState = {}
634 ): void {
635 // Inject rotation pivot position during rotation for visual feedback
636 const state = newControllerState.getState();
637 if (interactionState.isDragging && state.startRotateLngLat) {
638 interactionState = {
639 ...interactionState,
640 rotationPivotPosition: state.startRotateLngLat
641 };
642 } else if (interactionState.isDragging === false) {
643 // Clear pivot when drag ends
644 interactionState = {...interactionState, rotationPivotPosition: undefined};
645 }
646
647 super.updateViewport(newControllerState, extraProps, interactionState);
648 }
649
650 /** Add altitude to rotateStart params based on rotationPivot mode */
651 protected _getAltitude = (pos: [number, number]): number | undefined => {

Callers 15

setPropsFunction · 0.45
_onPanStartFunction · 0.45
_onPanMoveFunction · 0.45
_onPanMoveEndFunction · 0.45
_onPanRotateFunction · 0.45
_onPanRotateEndFunction · 0.45
_onWheelFunction · 0.45
_onMultiPanStartFunction · 0.45
_onMultiPanFunction · 0.45
_onMultiPanEndFunction · 0.45
_onPinchStartFunction · 0.45
_onPinchFunction · 0.45

Calls 1

getStateMethod · 0.80

Tested by

no test coverage detected