Exemplo n.º 1
0
        private async Task StartRideBtnClick_TappedAsync()
        {
            IsLoading = true;
            WebConnection webconnection = new WebConnection();
            var           locator       = CrossGeolocator.Current;

            locator.DesiredAccuracy = 50;
            var position = await locator.GetPositionAsync();

            //var position = await locator.GetPositionAsync(timeoutMilliseconds: 10000);
            Debug.WriteLine("Position Status: {0}", position.Timestamp);
            Debug.WriteLine("Position Latitude: {0}", position.Latitude);
            Debug.WriteLine("Position Longitude: {0}", position.Longitude);
            startpickupPosition =
                new Position(position.Latitude, position.Longitude);
            var str = $"DestinationPosition:{startpickupPosition.Latitude} ,{startpickupPosition.Longitude} ";

            // DisplayAlert("DestinationPosition", str, "OK");

            webconnection.On_ResponseRecived += Webconnection_StartRide_ResponseRecived;
            await webconnection.Changebookingstatus(BookingInfo.booking_id, "2");
        }