예제 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
            {
                NavigationBar.Frame = new RectangleF(NavigationBar.Frame.X, NavigationBar.Frame.Y, NavigationBar.Frame.Width, 64.0f);
            }
            var             item   = new UINavigationItem(this.title);
            UIBarButtonItem button = new UIBarButtonItem(MainViewController.ResizedImageIcon(UIImage.FromFile("menu.png")), UIBarButtonItemStyle.Bordered, delegate {
                navigation.ToggleMenu();
            });

            item.LeftBarButtonItem = button;
            item.HidesBackButton   = true;
            NavigationBar.PushNavigationItem(item, false);
        }
예제 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            stationsRepository = new WebStationRepository();

            var centerPoint      = Station.TroncalRouteCenter;
            var centerCoordinate = new CLLocationCoordinate2D(centerPoint.Y, centerPoint.X);
            var bounds           = UIScreen.MainScreen.Bounds;

            CameraPosition cameraPosition = CameraPosition.FromCamera(centerCoordinate, 14.0f);
            var            map            = MapView.FromCamera(new RectangleF(0, 64, bounds.Width, bounds.Height - 60), cameraPosition);

            map.MyLocationEnabled         = true;
            map.MapType                   = MapViewType.Normal;
            map.Settings.MyLocationButton = true;

            this.mapView = map;
            if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
            {
                NavigationBar.Frame = new RectangleF(NavigationBar.Frame.X, NavigationBar.Frame.Y, NavigationBar.Frame.Width, 64.0f);
            }

            var             item   = new UINavigationItem("CHART");
            UIBarButtonItem button = new UIBarButtonItem(MainViewController.ResizedImageIcon(UIImage.FromFile("menu.png")), UIBarButtonItemStyle.Bordered, delegate {
                navigation.ToggleMenu();
            });
            UIBarButtonItem closestStationButton = new UIBarButtonItem("Cercana", UIBarButtonItemStyle.Bordered, delegate {
                FindClosestStation();
            });

            item.LeftBarButtonItem  = button;
            item.HidesBackButton    = true;
            item.RightBarButtonItem = closestStationButton;
            NavigationBar.PushNavigationItem(item, false);

            notificationView = new GCDiscreetNotificationView("Buscando estación cercana...",
                                                              true, GCDNPresentationMode.Bottom, mapView);
            this.View.AddSubview(map);
            LoadMapInfo();
        }
예제 #3
0
 private void SetStationsFromRepository()
 {
     stations = stationsRepository.Stations;
     InvokeOnMainThread(() => {
         foreach (var station in stations)
         {
             var stationPosition = new CLLocationCoordinate2D(station.Latitude, station.Longitude);
             Marker marker       = Marker.FromPosition(stationPosition);
             marker.Title        = station.Name;
             var stationIcon     = UIImage.FromFile("StationImages/" + station.ImageFilename() + ".png");
             marker.Icon         = MainViewController.ResizedImageIcon(stationIcon);
             marker.Map          = mapView;
         }
         var path = new MutablePath();
         foreach (var point in Station.TroncalRoutePath)
         {
             path.AddCoordinate(new CLLocationCoordinate2D(point.Y, point.X));
         }
         var poliline         = Polyline.FromPath(path);
         poliline.StrokeColor = UIColor.DarkGray;
         poliline.StrokeWidth = 4.0f;
         poliline.Map         = mapView;
     });
 }