async void SetLocation(EstadoMapa estado) { var resAddress = await GooglePlacesHelper.GetAddress(_map.VisibleRegion.Center.Latitude, _map.VisibleRegion.Center.Longitude); if (resAddress != null && resAddress.results.Count > 0) { var place = resAddress.results[0]; var refPlace = new ReferenciaMapa() { Label = place.formatted_address, Latitud = _map.VisibleRegion.Center.Latitude, Longitud = _map.VisibleRegion.Center.Longitude }; if (estado == EstadoMapa.Desde) { _desdeRef = refPlace; _desdeEntry.Text = refPlace.Label; } if (estado == EstadoMapa.Hasta) { _hastaRef = refPlace; _hastaEntry.Text = refPlace.Label; } UpdateView(); } }
void CancelClicked(object sender, EventArgs args) { _desdeRef = null; _hastaRef = null; CurrentEstado = EstadoMapa.Desde; UpdateView(); }
void DismissConfirmDialog(object sender, EventArgs args) { _confirmDialog.IsVisible = false; CurrentEstado = EstadoMapa.Desde; _hastaRef = null; _desdeRef = null; UpdateView(); }
async void SolicitarServicioClicked(object sender, System.EventArgs e) { var page = new ConductoresPage(); page.Closed += (ss, ee) => { CurrentEstado = EstadoMapa.Seguimiento; UpdateView(); }; await Navigation.PushModalAsync(page); }
void MarcadorClicked(object sender, EventArgs args) { if (CurrentEstado == EstadoMapa.Desde) { SetLocation(EstadoMapa.Desde); CurrentEstado = EstadoMapa.Hasta; } else if (CurrentEstado == EstadoMapa.Hasta) { SetLocation(EstadoMapa.Hasta); CurrentEstado = EstadoMapa.Confirmacion; } else if (CurrentEstado == EstadoMapa.Confirmacion) { } UpdateView(); }