private void OnLocationsUpdate(IEnumerable <MKMapItem> mapItems) { if (_annotations != null) { var annotations = from c in _annotations select c.Item2; mapView.RemoveAnnotations(annotations.ToArray()); _annotations = null; } if (mapItems != null) { _annotations = mapItems.Select(mapItem => { var a = new BasicMapAnnotation(mapItem); mapView.AddAnnotation(a); return(Tuple.Create(mapItem, a)); }); } tableLocations.ReloadData(); }
private void OnLocationsUpdate(IEnumerable<MKMapItem> mapItems) { if (_annotations != null) { var annotations = from c in _annotations select c.Item2; mapView.RemoveAnnotations (annotations.ToArray ()); _annotations = null; } if (mapItems != null) { _annotations = mapItems.Select (mapItem => { var a = new BasicMapAnnotation (mapItem); mapView.AddAnnotation (a); return Tuple.Create(mapItem, a); }); } tableLocations.ReloadData (); }
private void OnLocationsUpdate(IEnumerable<Location> locations) { if (_annotations != null) { var annotations = from c in _annotations select c.Item2; mapView.RemoveAnnotations (annotations.ToArray<NSObject> ()); _annotations = null; } if (locations != null) { var alist = new List<Tuple<Location, BasicMapAnnotation>> (); foreach (var c in locations) { var a = new BasicMapAnnotation(c.Location.ToCLLocation().Coordinate, c.Name,GetSubtitle(c)); mapView.AddAnnotation (a); alist.Add(new Tuple<Location, BasicMapAnnotation>(c, a)); }; _annotations = alist; } tableLocations.ReloadData (); }