Table of Contents

Struct GestureMomentum

Namespace
Maplibre.NativeFfi
Assembly
Maplibre.NativeFfi.dll

How a gesture keeps moving the camera after the user lets go.

public readonly record struct GestureMomentum : IEquatable<GestureMomentum>
Implements
Inherited Members

Remarks

A part moves only when its velocity is set, and each part slows on its own. Every part defaults to MomentumDecayModel.Friction with a half-life of 140 ms, and these other defaults:

  • Pan stops at 10 logical pixels per second, needs a release of at least 200, and counts a release faster than 10000 as 10000.
  • Zoom stops at 0.01 levels per second and moves at most 2.5 levels. Its snap settles on the nearest whole level.
  • Bearing stops at 1 degree per second and needs a release of at least 60. Its snap settles on north within 7 degrees.
  • Pitch stops at 1 degree per second and needs a release of at least 5. Its snap settles flat within 7 degrees.

See mln_gesture_momentum in the C API reference.

Constructors

GestureMomentum()

public GestureMomentum()

GestureMomentum(PanMomentum, AnchoredMomentum, AnchoredMomentum, AnchoredMomentum)

How a gesture keeps moving the camera after the user lets go.

public GestureMomentum(PanMomentum Pan, AnchoredMomentum Zoom, AnchoredMomentum Bearing, AnchoredMomentum Pitch)

Parameters

Pan PanMomentum
Zoom AnchoredMomentum
Bearing AnchoredMomentum
Pitch AnchoredMomentum

Remarks

A part moves only when its velocity is set, and each part slows on its own. Every part defaults to MomentumDecayModel.Friction with a half-life of 140 ms, and these other defaults:

  • Pan stops at 10 logical pixels per second, needs a release of at least 200, and counts a release faster than 10000 as 10000.
  • Zoom stops at 0.01 levels per second and moves at most 2.5 levels. Its snap settles on the nearest whole level.
  • Bearing stops at 1 degree per second and needs a release of at least 60. Its snap settles on north within 7 degrees.
  • Pitch stops at 1 degree per second and needs a release of at least 5. Its snap settles flat within 7 degrees.

See mln_gesture_momentum in the C API reference.

Properties

Bearing

public AnchoredMomentum Bearing { get; init; }

Property Value

AnchoredMomentum

Pan

public PanMomentum Pan { get; init; }

Property Value

PanMomentum

Pitch

public AnchoredMomentum Pitch { get; init; }

Property Value

AnchoredMomentum

Zoom

public AnchoredMomentum Zoom { get; init; }

Property Value

AnchoredMomentum