Наследование: MKAnnotation
Пример #1
0
        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();
                });
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
        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();
                });
            }
        }
Пример #4
0
 private void CalculateRoutesFromAction_Handler(PlaceMark from, PlaceMark to)
 {
     CalculateRoutes(from.Coordinate, to.Coordinate);
 }
Пример #5
0
 private void CalculateRoutes(PlaceMark from, PlaceMark to)
 {
     CalculateRoutes(from.Coordinate, to.Coordinate);
 }
Пример #6
0
        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);
        }
Пример #7
0
 private void CalculateRoutes(PlaceMark from, PlaceMark to)
 {
     CalculateRoutes(from.Coordinate, to.Coordinate);
 }
Пример #8
0
 private void CalculateRoutesFromAction_Handler(PlaceMark from, PlaceMark to)
 {
     CalculateRoutes(from.Coordinate, to.Coordinate);
 }