Пример #1
0
        private async void OnSearchButtonClicked(object sender, EventArgs e)
        {
            var searchText = SearchField.Text;

            if (string.IsNullOrEmpty(searchText))
            {
                return;
            }

            var positions = await Geocoder.GetPositionsForAddressAsyncFunc(searchText);

            var position = positions.FirstOrDefault();

            ((MapModalViewModel)BindingContext).SelectedLocation = position.ToLocation();
            Pin.Position = position;
            Map.MoveToRegion(MapSpan.FromCenterAndRadius(position, Distance.FromKilometers(1)));
        }