Example #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.Frame            = UIScreen.MainScreen.Bounds;
            View.BackgroundColor  = UIColor.White;
            View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;

            SetupMap();

            //Setup button to clear map
            var btn = new UIButton(new RectangleF(0, 0, 100, 50));

            btn.Layer.BorderWidth  = 1;
            btn.Layer.CornerRadius = 5;
            btn.Layer.BorderColor  = UIColor.Black.CGColor;
            btn.SetTitle(@"Clear Map", UIControlState.Normal);
            btn.BackgroundColor = UIColor.Gray;
            btn.TouchUpInside  += (s, e) =>
            {
                _mapView.Clear();
                _mapDelegate.Lines.Clear();
                _mapDelegate.Locations.Clear();
            };


            _mapView.AddSubview(btn);
        }
Example #2
0
        void SetStatusLabel()
        {
            status = new UILabel();
            status.BackgroundColor    = UIColor.FromRGBA(255, 255, 255, 160);
            status.TextColor          = UIColor.Black;
            status.Layer.CornerRadius = 5;
            status.ClipsToBounds      = true;
            status.TextAlignment      = UITextAlignment.Center;
            status.Lines         = 0;
            status.LineBreakMode = UILineBreakMode.WordWrap;
            status.Font          = UIFont.FromName("HelveticaNeue", 12);

            MapView.AddSubview(status);

            CoreGraphics.CGRect screen = UIScreen.MainScreen.Bounds;

            nfloat width  = screen.Width / 2;
            nfloat height = width / 4;

            nfloat x = screen.Width / 2 - width / 2;
            nfloat y = UIApplication.SharedApplication.StatusBarFrame.Height + NavigationController.NavigationBar.Frame.Height + 10;

            status.Frame = new CoreGraphics.CGRect(x, y, width, height);
        }