如何在 xamarin.ios 中添加放大和缩小按钮功能以更改地图比例?

How to add zoom in and zoom out button functionality for changing scale of map in xamarin.ios?

我已经使用故事板在我的 c# 程序中添加了两个按钮,但是我找不到任何 属性 可以改变当前显示地图比例的地图。

Xamarin ios 应用程序中是否有任何东西可以通过使用放大和缩小等按钮来更改地图的比例?

CLLocationCoordinate2D coords = map.Region.Center;
var degrees = MilesToLatitudeDegrees(map.Region.Span.LatitudeDelta / 2);
MKCoordinateSpan span = new MKCoordinateSpan(degrees, longitudeDelta: map.Region.Span.LongitudeDelta / 2);
map.Region = new MKCoordinateRegion(coords, span);

在缩放按钮操作中添加以上代码将按预期工作