示例#1
0
        public string DirectionRadian2DMS(double dblDirRad, int intRoundValue)
        {
            string result = null;

            try
            {
                double pi = Math.PI;

                double resultDbl = dblDirRad * (180 / pi);

                int    Deg  = (int)Math.Truncate(resultDbl);
                double mDBL = Math.Abs(resultDbl - Math.Truncate(resultDbl)) * 60.0;
                int    Mins = (int)Math.Truncate(mDBL);
                double Sec  = (mDBL - Mins) * 60.0;

                result = $"{Deg.ToString("D2")}° {Mins.ToString("D2")}' {StringFormatter.FormatDecimal(Sec, 3)}\"";
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
                //return null;
            }

            return(result);
        }
示例#2
0
        private async void ZoomAndUpdateTotal()
        {
            if (MapView.Active != null && this.SelectedFeature.Count > 0)
            {
                List <long> selectedOids    = new List <long>();
                string      featureLayerUri = "";
                double      totalArea       = 0;
                foreach (var selectedRow in this.SelectedFeature)
                {
                    object oidValue = ((DataRowView)selectedRow)[ObjIdCol];
                    featureLayerUri = ((DataRowView)selectedRow)[FeatureLayerUriCol] + string.Empty;
                    totalArea      += Convert.ToDouble(((DataRowView)selectedRow)[AreaCol]);
                    selectedOids.Add(Convert.ToInt64(oidValue));
                }

                FeatureLayer fl = this.CurrentSelection.Keys.First(x => x.URI.Equals(featureLayerUri));
                await this.MapViewUtil.PerformZoomToSelectedAction(selectedOids, MapView.Active, fl);

                this.TotalSelectedFeatureArea = StringFormatter.FormatDecimal(totalArea, 2) + " " + this.SelectedUnitFormat.Value.ToString();
            }
            else
            {
                this.TotalSelectedFeatureArea = " ";
            }
        }