첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
다운로드

▶ MainForm.cs

using System.Data;
using System.Globalization;

using DevExpress.XtraEditors;
using DevExpress.XtraMap;

namespace TestProject
{
    /// <summary>
    /// 메인 폼
    /// </summary>
    public partial class MainForm : XtraForm
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Field
        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region Field

        /// <summary>
        /// 빙 맵 키
        /// </summary>
        private string bingKey = "INPUT YOUR BING KEY";

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainForm()

        /// <summary>
        /// 생성자
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            #region 빙 맵 데이터 공급자를 설정한다.

            this.bingMapDataProvider.BingKey = this.bingKey;

            #endregion
            #region 선형 범위 분포를 설정한다.

            LinearRangeDistribution linearRangeDistribution = new LinearRangeDistribution();

            #endregion
            #region 측정 규칙을 설정한다.

            MeasureRules measureRules = new MeasureRules();

            measureRules.ApproximateValues = true;
            measureRules.RangeDistribution = linearRangeDistribution;

            for(int i = 6; i < 10; i++)
            {
                measureRules.RangeStops.Add(i);
            }

            #endregion
            #region 데이터 테이블을 설정한다.

            DataSet dataSet = new DataSet();

            dataSet.ReadXml("DATA\\Earthquakes.xml");

            DataTable dataTable = dataSet.Tables[0];

            dataTable.DefaultView.RowFilter = string.Format
            (
                CultureInfo.InvariantCulture,
                "(mag >= {0}) AND (mag <= {1})",
                6,
                10
            );

            #endregion
            #region 버블 차트 데이터 어댑터를 설정한다.

            BubbleChartDataAdapter bubbleChartDataAdapter = new BubbleChartDataAdapter();

            bubbleChartDataAdapter.MeasureRules       = measureRules;
            bubbleChartDataAdapter.Mappings.Latitude  = "glat";
            bubbleChartDataAdapter.Mappings.Longitude = "glon";
            bubbleChartDataAdapter.Mappings.Value     = "mag";
            bubbleChartDataAdapter.ItemMaxSize        = 60;
            bubbleChartDataAdapter.ItemMinSize        = 10;
            bubbleChartDataAdapter.DataSource         = dataTable;

            bubbleChartDataAdapter.AttributeMappings.Add(new MapItemAttributeMapping("Magnitude", "mag"));
            bubbleChartDataAdapter.AttributeMappings.Add(new MapItemAttributeMapping("Year"     , "yr" ));
            bubbleChartDataAdapter.AttributeMappings.Add(new MapItemAttributeMapping("Month"    , "mon"));
            bubbleChartDataAdapter.AttributeMappings.Add(new MapItemAttributeMapping("Day"      , "day"));
            bubbleChartDataAdapter.AttributeMappings.Add(new MapItemAttributeMapping("Depth"    , "dep"));

            this.vectorItemsLayer.Data = bubbleChartDataAdapter;

            #endregion
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요