Exemplo n.º 1
0
        async void addPins(String houseAddress, String accommodationType)
        {
            var approximateLocation = await geoCoder.GetPositionsForAddressAsync(houseAddress);

            foreach (var position in approximateLocation)
            {
                var pin = new CustomPin
                {
                    Pin = new Pin
                    {
                        Type     = PinType.Place,
                        Position = new Xamarin.Forms.Maps.Position(position.Latitude, position.Longitude),
                        Label    = accommodationType,
                        Address  = houseAddress
                    }
                };
                MyMap.CustomPins = new List <CustomPin> {
                    pin
                };
                MyMap.Pins.Add(pin.Pin);
            }
        }
Exemplo n.º 2
0
        async void addPins(String houseAddress)
        {
            var approximateLocation = await geoCoder.GetPositionsForAddressAsync(houseAddress);

            foreach (var position in approximateLocation)
            {
                geocodedOutputLabel.Text = position.Latitude + ", " + position.Longitude + "\n";

                var pin = new CustomPin
                {
                    Pin = new Pin
                    {
                        Type     = PinType.Place,
                        Position = new Xamarin.Forms.Maps.Position(position.Latitude, position.Longitude),
                        Label    = "LiveWell house",
                        Address  = houseAddress
                    }
                };
                MyMap.CustomPins = new List <CustomPin> {
                    pin
                };
                MyMap.Pins.Add(pin.Pin);
            }
        }