コード例 #1
0
ファイル: MapPedido.xaml.cs プロジェクト: MarioRguezz/Kour
        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();
            }
        }
コード例 #2
0
ファイル: MapPedido.xaml.cs プロジェクト: MarioRguezz/Kour
 void CancelClicked(object sender, EventArgs args)
 {
     _desdeRef     = null;
     _hastaRef     = null;
     CurrentEstado = EstadoMapa.Desde;
     UpdateView();
 }
コード例 #3
0
ファイル: MapPedido.xaml.cs プロジェクト: MarioRguezz/Kour
        void DismissConfirmDialog(object sender, EventArgs args)
        {
            _confirmDialog.IsVisible = false;

            CurrentEstado = EstadoMapa.Desde;

            _hastaRef = null;
            _desdeRef = null;

            UpdateView();
        }
コード例 #4
0
ファイル: MapPedido.xaml.cs プロジェクト: MarioRguezz/Kour
        async void SolicitarServicioClicked(object sender, System.EventArgs e)
        {
            var page = new ConductoresPage();

            page.Closed += (ss, ee) =>
            {
                CurrentEstado = EstadoMapa.Seguimiento;
                UpdateView();
            };
            await Navigation.PushModalAsync(page);
        }
コード例 #5
0
ファイル: MapPedido.xaml.cs プロジェクト: MarioRguezz/Kour
        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();
        }