public void Flip(MapLocation toLocation) { mapView.SetLocation(toLocation); // assume not null, since it's created in ViewDidLoad ?? Flip(); }
public void SetLocation(MapLocation toLocation) { var loc = toLocation.Location; Console.WriteLine("SetLocation to {0},{1}", loc.Latitude, loc.Longitude); if (loc.Equals(new CLLocationCoordinate2D(0,0))) { // use the 'location manager' current coordinate loc = locationManager.Location.Coordinate; } else if (toLocation.Title == "PCD09") { // no need to drop anything } else { // drop a new pin ConferenceAnnotation a = new ConferenceAnnotation(toLocation.Location, toLocation.Title,toLocation.Subtitle); mapView.AddAnnotationObject(a); } mapView.CenterCoordinate = loc; }