async void ArchivoLibro()
        {
            var libro = await DescargaPDF();

            var ruta       = NSUrl.FromFilename(libro);
            var urlrequest = new NSUrlRequest(ruta);

            VisorWeb.LoadRequest(urlrequest);
            Progreso.SetProgress(1.0f, true);
        }
示例#2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            Visor.Image       = UIImage.FromFile("Rafita.jpg");
            Visor.ContentMode = UIViewContentMode.ScaleAspectFit;
            string htmlString = "<html>\n<header><title>This is title</title></header>\n<body>\nHello world\n</body>\n</html>";

            VisorWeb.LoadHtmlString(htmlString, new NSUrl("./", true));

            Seletor.ValueChanged += (sender, e) => {
                switch (Seletor.SelectedSegment)
                {
                case 0:
                    Map.MapType = MapKit.MKMapType.Standard;
                    break;

                case 1:
                    Map.MapType = MapKit.MKMapType.Satellite;
                    break;

                case 2:
                    Map.MapType = MapKit.MKMapType.Hybrid;
                    break;

                default:
                    break;
                }
            };

            lista.ForEach(x => Map.AddAnnotation(new MKPointAnnotation()
            {
                Title      = x.Titulo,
                Coordinate = new CLLocationCoordinate2D()
                {
                    Latitude  = x.Latitude,
                    Longitude = x.Longitude
                }
            }));



            var Leon    = new CLLocationCoordinate2D(21.152676, -101.711698);
            var Cancun  = new CLLocationCoordinate2D(21.052743, -86.847242);
            var Tijuana = new CLLocationCoordinate2D(32.526384, -117.028983);
        }
示例#3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Visor.Image = UIImage.FromFile("fp.jpg");
            string htmlString =
                "<HTML><BODY BGCOLOR=BLUE><p><center><h1>Hola Web Embebido</h1></center></p></body></html>";

            VisorWeb.LoadHtmlString(htmlString, new NSUrl
                                        ("./", true));
            Selector.ValueChanged += (s, e) => {
                switch (Selector.SelectedSegment)
                {
                case 0:
                    Mapa.MapType = MKMapType.Standard;
                    break;

                case 1:
                    Mapa.MapType = MKMapType.Satellite;
                    break;

                case 2:
                    Mapa.MapType = MKMapType.Hybrid;
                    break;
                }
            };
            Lista.ForEach(x => Mapa.AddAnnotation(new MKPointAnnotation()
            {
                Title      = x.Titulo,
                Coordinate = new CLLocationCoordinate2D()
                {
                    Latitude  = x.Latitud,
                    Longitude = x.Longitud
                }
            }));
            var Leon          = new CLLocationCoordinate2D(21.152676, -101.711698);
            var Cancun        = new CLLocationCoordinate2D(21.052743, -86.847242);
            var Tijuana       = new CLLocationCoordinate2D(32.526384, -117.028983);
            var Info          = new NSDictionary();
            var OrigenDestino = new MKDirectionsRequest()
            {
                Source      = new MKMapItem(new MKPlacemark(Leon, Info)),
                Destination = new MKMapItem(new MKPlacemark(Cancun, Info)),
            };
            var OrigenDestino2 = new MKDirectionsRequest()
            {
                Source      = new MKMapItem(new MKPlacemark(Leon, Info)),
                Destination = new MKMapItem(new MKPlacemark(Tijuana, Info)),
            };
            var RutaLeonCancun = new MKDirections(OrigenDestino);

            RutaLeonCancun.CalculateDirections((response, error) => {
                if (error == null)
                {
                    var ruta  = response.Routes [0];
                    var Linea = new MKPolylineRenderer(ruta.Polyline)
                    {
                        LineWidth   = 5.0f,
                        StrokeColor = UIColor.Red,
                    };
                    Mapa.OverlayRenderer = (Res, Err) => Linea;
                    Mapa.AddOverlay(ruta.Polyline, MKOverlayLevel.AboveRoads);
                }
            });
            var RutaLeonTijuana = new MKDirections(OrigenDestino2);

            RutaLeonTijuana.CalculateDirections((response, error) =>
            {
                if (error == null)
                {
                    var ruta  = response.Routes[0];
                    var Linea = new MKPolylineRenderer(ruta.Polyline)
                    {
                        LineWidth   = 5.0f,
                        StrokeColor = UIColor.Blue,
                    };
                    Mapa.OverlayRenderer = (Res, Err) => Linea;
                    Mapa.AddOverlay(ruta.Polyline, MKOverlayLevel.AboveRoads);
                }
            });
        }