Ejemplo n.º 1
0
        /// <summary>
        /// 定位以及 刷新Bluebar
        /// </summary>
        /// <returns></returns>
        private async Task FreshBlueBar()
        {
            //先定位以便获取位置信息
            //await LocationNowAsync();
            GeoPosition = await PositionUtility.GetFixedGeopointAsync();

            Map.Center = GeoPosition;

            var blueBarResult = await OfoApi.GetBlueBarAsync(GeoPosition.Position);

            if (await CheckOfoApiResult(blueBarResult))
            {
                BlueBarInfo = blueBarResult.Data;
                if (!string.IsNullOrEmpty(blueBarResult.Data.Text))
                {
                    BlueBarButtonVisibility = Visibility.Visible;
                    if (BlueBarInfo.Id?.Equals(Global.AppConfig.LastBlueBarID) == false)
                    {
                        Global.AppConfig.LastBlueBarID = BlueBarInfo.Id;
                        BlueBarButtonVisibility        = Visibility.Collapsed;
                        BlueBarVisibility = Visibility.Visible;
                        Global.SaveAppConfig();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 定位
        /// </summary>
        /// <returns></returns>
        private async Task LocationNowAsync()
        {
            if (IsPositioning)
            {
                return;
            }
            IsPositioning       = true;
            IsShowMapCenterFlag = true;

            try
            {
                ClearMapAddOnInfo();

                GeoPosition = await PositionUtility.GetFixedGeopointAsync();

                Map.Center = GeoPosition;

                await GetPositionBicycles(GeoPosition.Position);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 定位以及 刷新Bluebar
        /// </summary>
        /// <returns></returns>
        private async Task FreshBlueBar()
        {
            //先定位以便获取位置信息
            //await LocationNowAsync();
            GeoPosition = await PositionUtility.GetFixedGeopointAsync();

            Map.Center = GeoPosition;

            var blueBarResult = await OfoApi.GetBlueBarAsync(GeoPosition.Position);

            if (await CheckOfoApiResult(blueBarResult))
            {
                BlueBarInfo = blueBarResult.Data;
                if (!string.IsNullOrEmpty(blueBarResult.Data.Text))
                {
                    BlueBarButtonVisibility = Visibility.Visible;
                    if (BlueBarInfo.MainType == 1)
                    {
                        BlueBarButtonVisibility = Visibility.Collapsed;
                        BlueBarVisibility       = Visibility.Visible;
                    }
                }
            }
        }