Skip to content

Commit

Permalink
- fix type casting error
Browse files Browse the repository at this point in the history
  • Loading branch information
tuyen-vuduc committed Aug 1, 2024
1 parent ecce035 commit b668f74
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/libs/Mapbox.Maui/Mapbox.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<RepositoryUrl>https://github.com/tuyen-vuduc/mapbox-maui</RepositoryUrl>
<PackageProjectUrl>https://mapbox.tuyen-vuduc.tech</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageVersion>11.5.0-alpha02</PackageVersion>
<PackageVersion>11.5.0-alpha03</PackageVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageIcon>tv-mapbox.png</PackageIcon>
Expand Down
6 changes: 4 additions & 2 deletions src/libs/Mapbox.Maui/Platforms/Android/MapboxFragment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,13 @@ partial class MapboxFragment
{
void ICameraChangedCallback.Run(CameraChanged p0)
{
var center = p0.CameraState.Center.ToMapPosition();
var padding = p0.CameraState.Padding.ToX();
var cameraOptions = new CameraOptions
{
Center = p0.CameraState.Center.ToMapPosition(),
Center = center,
Bearing = (float)p0.CameraState.Bearing,
Padding = (float)p0.CameraState.Padding,
Padding = padding,
Pitch = (float)p0.CameraState.Pitch,
Zoom = (float)p0.CameraState.Zoom,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ public CameraAnimationsExample()
map.MapReady += Map_MapReady;
map.StyleLoaded += Map_StyleLoaded;
map.MapLoaded += Map_MapLoaded;
map.CameraChanged += Map_CameraChanged;

Content = grid;
}

private void Map_CameraChanged(object sender, CameraChangedEventArgs e)
{
}

private void HandleCameraFlyTo(object sender, EventArgs e)
{
var centerLocation = new MapPosition(21.028511, 105.804817);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.Json.Nodes;
using Android.Gestures;
using MapboxMaui.Gestures;
using MapboxMaui.Viewport;

namespace MapboxMauiQs;
Expand Down Expand Up @@ -121,11 +120,11 @@ private void SetupAdvancedGesturesForFollowPuckViewportState()
//map.GestureShoved += HandleGestureShoved;
}

private void HandleRotatingBegan(object sender, Gestures.RotatingBeganEventArgs e)
private void HandleRotatingBegan(object sender, RotatingBeganEventArgs e)
{
followPuckViewportState.Options.Bearing = null;
}
private void HandleRotatingEnded(object sender, Gestures.RotatingEndedEventArgs e)
private void HandleRotatingEnded(object sender, RotatingEndedEventArgs e)
{
followPuckViewportState.Options.Bearing = map.CameraController.CameraState.Bearing;
}
Expand Down

0 comments on commit b668f74

Please sign in to comment.