public void SetupLocations() { var firstTarget = new ARItem { ItemDescription = "wolf", Location = new CLLocation(10.3349, 123.9174) }; targets.Add(firstTarget); var secondTarget = new ARItem { ItemDescription = "wolf", Location = new CLLocation(10.3348, 123.9174) }; targets.Add(secondTarget); var thirdTarget = new ARItem { ItemDescription = "dragon", Location = new CLLocation(10.3347, 123.9174) }; targets.Add(thirdTarget); foreach (var item in targets) { var annotation = new MapAnnotation(item.Location.Coordinate, item); mapView.AddAnnotation(annotation); } var coordinations = new CLLocationCoordinate2D(10.3349, 123.9174); var span = new MKCoordinateSpan(); mapView.Region = new MKCoordinateRegion(coordinations, span); }
public MapAnnotation(CLLocationCoordinate2D location, ARItem item) { this.coordinate = location; this.title = item.ItemDescription; this.Item = item; //base.Init(); }