本文整理汇总了C#中MKMapView.SetCenterCoordinate方法的典型用法代码示例。如果您正苦于以下问题:C# MKMapView.SetCenterCoordinate方法的具体用法?C# MKMapView.SetCenterCoordinate怎么用?C# MKMapView.SetCenterCoordinate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MKMapView
的用法示例。
在下文中一共展示了MKMapView.SetCenterCoordinate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindMe
static public void FindMe(MKMapView map, string markerText)
{
map.Delegate = new MapViewDelegate();
map.SetCenterCoordinate(CurrentLocation, true);
map.Region = new MKCoordinateRegion(CurrentLocation, new MKCoordinateSpan(0.005, 0.005));
map.SetCenterCoordinate(CurrentLocation, true);
var meAnn = new SpotAnnotation(CurrentLocation, markerText, "");
map.AddAnnotationObject(meAnn);
}
示例2: DidUpdateUserLocation
public void DidUpdateUserLocation(MKMapView mapView, MKUserLocation userLocation)
{
Console.WriteLine("Weak Lat: {0}, Long: {1}, Alt: {2}", userLocation.Coordinate.Latitude, userLocation.Coordinate.Longitude, userLocation.Location.Altitude);
currLocation = userLocation.Coordinate;
if (firstLaunch) {
mapView.SetRegion(MKCoordinateRegion.FromDistance(currLocation, 250, 250), true);
firstLaunch = false;
}
else
mapView.SetCenterCoordinate(currLocation, true);
}
示例3: DidUpdateUserLocation
public override void DidUpdateUserLocation(MKMapView mapView, MKUserLocation userLocation)
{
if (!_locationSet) {
_locationSet = true;
ZoomToUserLocation (mapView, userLocation);
}
else
{
mapView.SetCenterCoordinate(userLocation.Coordinate, true);
}
}