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); } }
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); } }