private void UpdateMap(PlaceMark from, PlaceMark to) { using (var pool = new NSAutoreleasePool()) { pool.BeginInvokeOnMainThread(() => { _MapView.AddAnnotation(new MKAnnotation[] { from, to }); _MapView.SetRegion(new MKCoordinateRegion(from.Coordinate, new MKCoordinateSpan(0.2, 0.2)), true); UpdateRouteView(); CenterMap(); }); } }
public void ShowRouteFrom(Place from, Place to) { if (_Routes.Any()) { _MapView.RemoveAnnotations(_MapView.Annotations as MKAnnotation[]); _Routes = new CLLocation[] { }; } var placeMarkFrom = new PlaceMark(from); var placeMarkTo = new PlaceMark(to); CalculateRoutesAction.BeginInvoke(placeMarkFrom, placeMarkTo, (ar) => { CalculateRoutesAction.EndInvoke(ar); UpdateMap(placeMarkFrom, placeMarkTo); }, null); }
private void UpdateMap(PlaceMark from, PlaceMark to) { using(var pool = new NSAutoreleasePool()) { pool.BeginInvokeOnMainThread(()=> { _MapView.AddAnnotation(new MKAnnotation[] { from, to }); _MapView.SetRegion(new MKCoordinateRegion(from.Coordinate, new MKCoordinateSpan(0.2, 0.2)), true); UpdateRouteView(); CenterMap(); }); } }
private void CalculateRoutesFromAction_Handler(PlaceMark from, PlaceMark to) { CalculateRoutes(from.Coordinate, to.Coordinate); }
private void CalculateRoutes(PlaceMark from, PlaceMark to) { CalculateRoutes(from.Coordinate, to.Coordinate); }
public void ShowRouteFrom(Place from, Place to) { if(_Routes.Any()) { _MapView.RemoveAnnotations(_MapView.Annotations as MKAnnotation[]); _Routes = new CLLocation[] { }; } var placeMarkFrom = new PlaceMark(from); var placeMarkTo = new PlaceMark(to); CalculateRoutesAction.BeginInvoke(placeMarkFrom, placeMarkTo, (ar) => { CalculateRoutesAction.EndInvoke(ar); UpdateMap(placeMarkFrom, placeMarkTo); }, null); }