Example #1
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this 
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
			NativeCSS.StyleWithCSS (".menu-table{color:#0b93ff}");
			MapServices.ProvideAPIKey (GoogleMapsAPI);                        
			window = new UIWindow(UIScreen.MainScreen.Bounds);
			var rootNavigationController = new MainViewController (); 
			window.RootViewController = rootNavigationController;            
            window.MakeKeyAndVisible();

            return true;
        }
Example #2
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            NativeCSS.StyleWithCSS(".menu-table{color:#0b93ff}");
            MapServices.ProvideAPIKey(GoogleMapsAPI);
            window = new UIWindow(UIScreen.MainScreen.Bounds);
            var rootNavigationController = new MainViewController();

            window.RootViewController = rootNavigationController;
            window.MakeKeyAndVisible();

            return(true);
        }
Example #3
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);
        }
Example #4
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();
        }
Example #5
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;
     });
 }