Skip to content

Commit 9a044b5

Browse files
committed
- WIP
1 parent 7c41f4e commit 9a044b5

File tree

6 files changed

+460
-11
lines changed

6 files changed

+460
-11
lines changed

src/libs/Mapbox.Maui/MapboxView.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public partial class MapboxView : View, IMapboxView
1212
);
1313
public GestureSettings GestureSettings
1414
{
15-
get => (GestureSettings)GetValue(ViewAnnotationsProperty);
16-
set => SetValue(ViewAnnotationsProperty, value);
15+
get => (GestureSettings)GetValue(GestureSettingsProperty);
16+
set => SetValue(GestureSettingsProperty, value);
1717
}
1818

1919
public static readonly BindableProperty ViewAnnotationsProperty = BindableProperty.Create(

src/libs/Mapbox.Maui/Models/GestureSettings.cs

+7
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,18 @@ public GestureSettings()
8080
/// </summary>
8181
public bool IncreasePinchToZoomThresholdWhenRotating { get; set; } = true;
8282
/// <summary>
83+
/// Android only.
8384
/// The amount by which the zoom level increases or decreases during a double-tap-to-zoom-in or
8485
/// double-touch-to-zoom-out gesture. 1.0 by default. Must be positive.
8586
/// </summary>
8687
public float ZoomAnimationAmount { get; set; } = 1.0f;
8788
/// <summary>
89+
/// iOS only.
90+
/// A constant factor that determines how quickly pan deceleration animations happen.
91+
/// Multiplied with the velocity vector once per millisecond during deceleration animations.
92+
/// </summary>
93+
public float PanDecelerationFactor { get; set; } = 1.0f;
94+
/// <summary>
8895
/// Whether pan is enabled for the pinch gesture.
8996
///
9097
/// iOS: PanEnabled

src/libs/Mapbox.Maui/Platforms/Android/MapboxViewHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ private static void HandleMapboxStyleChanged(MapboxViewHandler handler, IMapboxV
225225
styleUri = MapboxMapsStyle.MapboxStreets;
226226
}
227227

228-
handler.GetMapView()?.MapboxMap.LoadStyleUri(styleUri);
228+
handler.GetMapView()?.MapboxMap.LoadStyle(styleUri);
229229
}
230230

231231
protected override PlatformView CreatePlatformView()

src/libs/Mapbox.Maui/Platforms/iOS/MapboxViewHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private static void HandleGestureSettingsChanged(MapboxViewHandler handler, IMap
3737
//gestures.ScrollEnabled = view.GestureSettings.ScrollEnabled;
3838
gestures.PanMode = view.GestureSettings.ScrollMode.ToNative();
3939
gestures.SimultaneousRotateAndPinchZoomEnabled = view.GestureSettings.SimultaneousRotateAndPinchToZoomEnabled;
40-
gestures.PanDecelerationFactor = view.GestureSettings.ZoomAnimationAmount;
40+
gestures.PanDecelerationFactor = view.GestureSettings.PanDecelerationFactor;
4141
}
4242

4343
private static void HandleLightChanged(MapboxViewHandler handler, IMapboxView view)

src/qs/MapboxMauiQs/AppShell.xaml.cs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ public partial class AppShell : Shell
55
public AppShell()
66
{
77
InitializeComponent();
8+
9+
Routing.RegisterRoute(nameof(GestureSettingsExample.GestureSettingsExampleSettingsPage), typeof(GestureSettingsExample.GestureSettingsExampleSettingsPage));
810
}
911
}
1012

0 commit comments

Comments
 (0)