Пример #1
0
        private void MLocationCallback_OnLocationFound(object sender, LocationCallbackHelper.OnLocationCapturedEventArgs e)
        {
            myLastLocation = e.Location;
            // Updates Location when app is normal
            if (!directionDrawn)
            {
                if (myLastLocation != null)
                {
                    mypostion = new LatLng(myLastLocation.Latitude, myLastLocation.Longitude);
                    map.AnimateCamera(CameraUpdateFactory.NewLatLngZoom(mypostion, 15));
                }
            }


            //  Updates Location When Trip stared
            if (tripStarted)
            {
                if (myLastLocation != null)
                {
                    string key = Resources.GetString(Resource.String.mapkey);
                    mypostion = new LatLng(myLastLocation.Latitude, myLastLocation.Longitude);
                    mapHelper.UpdateLocationToDestination(mypostion, destinationPoint, map, key);
                }
            }
        }