map

map.setPitch

setPitch(degrees: number, options?: object): void

Set the unified pitch (degrees). Clamped to pitchBounds.

Dispatch:

  • _mode === "spherical" && _is3D → camera orbits around cloudScene.position, preserving distance. Google-Earth visual semantics (D1).
  • _mode === "planar" && _is3D → cloudScene.rotation.x = -pitchRad. Tilts the floor for floor-mode (D2).
  • else → state-only update (no visible effect).

Animation: options.animate = true runs a smoothstep RAF tween over options.durationMs (default 400 ms). Any in-flight tween is cancelled before the new one starts.

Damping: every successful pitch update calls the wired _setMapDamping with dampingForPitchRad(pitchRad) so near-camera nodes stay sized.

Event: emits map:pitchChanged with { pitch: degrees }.

No-op if the new pitch equals the current pitch (after clamp).

degreesnumber
optionsobject

Returns: void