Пример #1
0
        private void TapGeografia_Tapped(object sender, EventArgs e)
        {
            try
            {
                map.Pins.Clear();
                Iservicios myServices = DependencyService.Get <Iservicios>();
                List <Model.clsDepartamentos> departamentos = myServices.getDepartamentos();
                foreach (Model.clsDepartamentos obclsDepartamentos in departamentos)
                {
                    var position = new Position(Convert.ToDouble(obclsDepartamentos.stLatitud), Convert.ToDouble(obclsDepartamentos.stLongitud)); // Latitude, Longitude
                    pin = new Pin
                    {
                        Type           = PinType.Place,
                        Position       = position,
                        Label          = obclsDepartamentos.stNombre,
                        Address        = "Capital: " + obclsDepartamentos.stCapital,
                        BindingContext = AnchorX
                    };

                    pin.Clicked += Pin_Clicked;
                    map.Pins.Add(pin);
                    map.Icon = "https://images.vexels.com/media/users/3/153168/isolated/preview/ce53e14c82752a3fa9a2940b94518fb9-icono-de-la-escuela-globo-geograf-a-by-vexels.png";
                }
                trueorfalse();
            }
            catch (Exception ew)
            {
                throw ew;
            }
        }