WPF - XDL Tutorial

XDL MilmapView È°¿ë ù¹ø°

(piXoneer XDL Tutorial)

 

 

 

 

 

 

 NXMilmapView¸¦ ÀÌ¿ëÇÏ¿© ±º Áöµµ µµ½Ã ¿£ÁøÀÇ ±â´É »ç¿ë¹ýÀ» ÀÍÈ÷°í

°£´ÜÇÑ µµ½Ã±â´ÉÀ» Ãß°¡Çغ¸µµ·Ï ÇÕ´Ï´Ù.

 

 

2019. 04.

 

 

¸ñÂ÷

XDL MilmapView È°¿ë ù¹ø°... 1

1    »ç¿ëÇϱâ... 3

1.1    XDL ¿£Áø... 3

1.2    µ¥ÀÌÅÍ... 3

2    Config ÆÄÀÏ ¼³Á¤Çϱâ... 3

2.1    Config ÆÄÀÏ ¼³Á¤Çϱâ... 3

3    NXMILMAPVIEW¸¦ ÀÌ¿ëÇÑ ¿¹Á¦ ÇÁ·Î±×·¥ ¸¸µé±â... 5

3.1    ±âº» ÇÁ·Î±×·¥ ÀÛ¼º... 5

3.2    ÇÁ·Î±×·¥ µðÀÚÀÎ... 8

3.3    ±â´É ¹× À̺¥Æ® Ãß°¡... 12

 

 

 

 

1     »ç¿ëÇϱâ

 

1.1    XDL ¿£Áø

¼³Ä¡ ÇÁ·Î±×·¥À¸·Î ¹èÆ÷µÇ´Â XDL ¿£ÁøÀº Visual Studio 2010 x86 Release ¹öÀüÀ¸·Î, Visual Studio 2010 ÀÌ»óÀÇ ¹öÀü¿¡¼­ »ç¿ë°¡´ÉÇÏ´Ù.

¾Æ·¡ÀÇ ¼³¸íÀº Visual Studio 2015À» ±âÁØÀ¸·Î ÇÏ°Ú´Ù.

1.2    µ¥ÀÌÅÍ

CADRG µ¥ÀÌÅÍ´Â º¸¾È ¹× ¿ë·® ¹®Á¦·Î ÀÎÇØ ¿¹Á¦¿Í ÇÔ²² ¹èÆ÷°¡ ºÒ°¡´ÉÇÏ´Ù. ÀÌ¿¡ Milmap°ú °ü·ÃÇÑ ¿¹Á¦ÀÇ ¼³¸íÀº ¿£Áø°ú °°ÀÌ ¹èÆ÷µÈ World.pbi¸¦ Áß½ÉÀ¸·Î ÇÏ°í, Ãß°¡ÀûÀÎ ¼³¸íÀÌ ÇÊ¿äÇÑ °æ¿ì µ¡ºÙÀÌ´Â °ÍÀ¸·Î ÇÏ°Ú´Ù.

 

2     Config ÆÄÀÏ ¼³Á¤Çϱâ

2.1    Config ÆÄÀÏ ¼³Á¤Çϱâ

2.1.1     À©µµ¿ì Ž»ö±â¸¦ ½ÇÇàÇÏ¿© ¡°c:\Pixoneer\Xdl1.2\Config\XMilmapConfig.xml¡± ÆÄÀÏÀ» ¸Þ¸ðÀåÀ¸·Î ¿¬´Ù.

2.1.2     <XMilmap> - <Scales> ÅÂ±× Áß <Scale Type=¡±PBI¡±>ÀÇ <DataSource> °æ·Î¸¦ ¼öÁ¤ÇÑ´Ù.

¿¹¸¦ µé¾î, XDL 1.2¸¦ ¼³Ä¡ÇÑ Æú´õ°¡ ¡°C:\Pixoneer\XDL1.2¡±¶ó¸é <DataSource>ÀÇ °ªÀ» ¡°c:\Pixoneer\Xdl1.2\Map\World.pbi¡±·Î ¼öÁ¤ÇÑ´Ù.

 

2.1.3     <Scales> ÅÂ±× Áß <Scale Type=¡±PBP¡±>ÀÇ <DataSource> °æ·Î¸¦ ¼öÁ¤ÇÑ´Ù.

¿¹¸¦ µé¾î, XDL 1.2¸¦ ¼³Ä¡ÇÑ Æú´õ°¡ ¡°C:\Pixoneer\XDL1.2¡±¶ó¸é °¢°¢ÀÇ °æ·Î´Â ¡°c:\Pixoneer\Xdl1.2\Resource\PBP\korea.pbp¡±, ¡°c:\Pixoneer\Xdl1.2\Resource\PBP\metropolis.pbp¡±, ¡°c:\Pixoneer\Xdl1.2\Resource\PBP\city.pbp¡±°¡ µÈ´Ù.

 

 

CADRG µ¥ÀÌÅÍ°¡ ÀÖ´Â °æ¿ì XDL config¸¦ ÆíÁý ¶Ç´Â XDL Config ÆÄÀÏÀ» Á» ´õ ÀÚ¼¼È÷ ¾Ë°íÀÚ ÇÑ´Ù¸é, ¢ßÇȼҴϾî(http://www.pixoneer.co.kr)ÀÇ XDL ´Ù¿î·Îµå ÆäÀÌÁö¿¡¼­ ¡°XDL 1.2 ȯ°æ¼³Á¤ Åø¡±À» ´Ù¿î·Îµå ¹Þ¾Æ ¼³Ä¡ÇÑ µÚ ÅøÀÇ ¸Å´º¾óÀ» Âü°íÇϱ⠹ٶõ´Ù.

 

3     NXMILMAPVIEW¸¦ ÀÌ¿ëÇÑ ¿¹Á¦ ÇÁ·Î±×·¥ ¸¸µé±â

l  º» ¿¹Á¦ ÇÁ·Î±×·¥Àº NXMilmapViewÀÇ ±âº» »ç¿ë¹ýÀ» ÀÍÈ÷°í °£´ÜÇÑ µµ½Ã±â´ÉÀ» Ãß°¡ÇØ º¸µµ·Ï ÇÑ´Ù.

3.1    ±âº» ÇÁ·Î±×·¥ ÀÛ¼º

3.1.1     Visual Studio 2015À» ½ÇÇàÇÑ´Ù.

3.1.2     ¸Þ´º [ÆÄÀÏ]-[»õ·Î ¸¸µé±â]-[ÇÁ·ÎÁ§Æ®]¸¦ ¼±ÅÃÇÑ´Ù.

 

 

3.1.3     [»õ ÇÁ·ÎÁ§Æ®] ´ëÈ­»óÀÚ¿¡¼­ ¿ÞÂÊÀÇ ÅÛÇø´ â¿¡¼­ ¡°Visual C#¡±À» ¼±ÅÃÇÏ°í, ´ëÈ­»óÀÚ Áß°£ÀÇ ¸ñ·Ï¿¡¼­ ¡°WPF ÀÀ¿ë ÇÁ·Î±×·¥¡±À» ¼±ÅÃÇÑ´Ù.

»ç¿ëÀÚ°¡ ¿øÇÏ´Â °æ·Î¸¦ ¼±ÅÃÇÑ ´ÙÀ½ ÇÁ·ÎÁ§Æ® À̸§À» ¡°XDL_MilmapView1¡± À¸·Î ÀÔ·ÂÇÏ°í [»õ ÇÁ·ÎÁ§Æ®] ´ëÈ­»óÀÚÀÇ ¡°È®ÀΡ± ¹öÆ°À» Ŭ¸¯ÇÑ´Ù. ÀÌ ¹®¼­¿¡¼­´Â ´ëÈ­»óÀÚ ¿À¸¥ÂÊ ¾Æ·¡¿¡ ÀÖ´Â ¡°¼Ö·ç¼Ç¿ë µð·ºÅ͸® ¸¸µé±â¡±´Â ¼±ÅÃÇÏÁö ¾Ê°Ú´Ù. ¡°È®ÀΡ± ¹öÆ°À» ´©¸£¸é ÇÁ·ÎÁ§Æ®°¡ ±âº»ÀûÀ¸·Î »ý¼ºµÇ°í, È­¸é¿¡ WindowÀ» µðÀÚÀÎÇÒ ¼ö ÀÖ´Â È­¸éÀÌ ¶á´Ù. ¸¸¾à ¾Æ·¡¿Í °°Àº Window âÀÌ »ý¼ºµÇÁö ¾ÊÀ¸¸é, [¼Ö·ç¼Ç Ž»ö±â] â¿¡¼­ MainWindow.xaml¡±¸¦ ¸¶¿ì½º ´õºíŬ¸¯À» ÇÏ¿© âÀ» ¿¬´Ù.

 

 

3.1.4     ¼Ö·ç¼Ç Ž»ö±âÀÇ ÇÁ·ÎÁ§Æ® ÇϺÎÀÇ [ÂüÁ¶]ÀÇ ¿À¸¥ÂÊ ¸¶¿ì½º Ŭ¸¯À» ÅëÇØ [ÂüÁ¶Ãß°¡]¸¦ ¼±ÅÃÇÑ´Ù.

 

[

 

3.1.5     [ã¾Æº¸±â]ÅÇÀ¸·Î À̵¿ÇÑ ÈÄ ¡°C:\Pixoneer\XDL1.2\bin\¡±°æ·Î·Î À̵¿ÇÑ´Ù. CtrlÅ°¸¦ ´©¸¥ ä ¿¬¼ÓÀ¸·Î ¡°NXDL.dll¡±, ¡°NXDLgr.dll¡±, ¡°NXMilmap.dll¡±À» ¼±ÅÃÇÑ ÈÄ ¡°È®ÀΡ±¹öÆ°À» ¼±ÅÃÇÑ´Ù

3.1.6  ¼Ö·ç¼Ç Ž»ö±âÀÇ ÇÁ·ÎÁ§Æ® ÇϺÎÀÇ [ÂüÁ¶]Ç׿¡ NXDL, NXDLgr, NXMilmapÀÌ Ãß°¡µÇ¾úÀ½À» È®ÀÎÇÑ´Ù.

 

3.1.7  NXMilmapÄÁÆ®·ÑÀ» È°¿ëÇϱâ À§ÇØ MainWindow.xaml â¿¡¼­ namespace¸¦ ´ÙÀ½°ú °°ÀÌ Ãß°¡ÇÑ´Ù.

 

 

3.2    ÇÁ·Î±×·¥ µðÀÚÀÎ

 

 

Number

Name

Control type

Content

Items

(1)

checkBoxInverseMouseButton

CheckBox

InverseMouseButton

 

(2)

checkBoxInverseMouseWheel

CheckBox

InverseMouseWheel

 

(3)

checkBoxScale

CheckBox

Scale

 

(4)

comboBoxScale

ComboBox

 

 

(5)

textBoxCenterLon

TextBox

 

 

(6)

textBoxCenterLat

TextBox

 

 

(7)

buttonCenterMove

Button

À̵¿

 

(8)

comboBoxGrid

ComboBox

 

None

Degrees

GARS

(9)

radioButtonRotateNone

RadioButton

None

 

(10)

radioButtonRotateMouse

RadioButton

Mouse »ç¿ë

 

(11)

radioButtonRotateUserInput

RadioButton

»ç¿ëÀÚ ÀÔ·Â

 

(12)

textBoxRotateUserInput

TextBox

 

 

(13)

radioButtonZoomViewCenter

RadioButton

È­¸é Áß½É È®´ë/Ãà¼Ò

 

(14)

radioButtonZoomMousePosition

RadioButton

¸¶¿ì½º À§Ä¡ Áß½É È®´ë/Ãà¼Ò

 

(15)

checkBoxShowPBP

CheckBox

Show PBP

 

(16)

checkBoxCross

CheckBox

Show Cross

 

(17)

nxMilmapView1

NXMilmapView

 

 

(18)

GridSplitter1

GridSplitter

 

 

 

3.2.1     MainWindow.xaml â¿¡¼­ ±âº»À¸·Î »ý¼ºµÈ Grid ·¹À̾ƿô¿¡ Grid.ColumnDefinitionÀ» ÀÌ¿ëÇÏ¿© ¼¼ °³ÀÇ ColumnÀ» »ý¼ºÇÑ´Ù. ù ¹ø° Column¿¡´Â À§ÀÇ Ç¥¸¦ ÀÌ¿ëÇÏ¿© µðÀÚÀÎÇÑ´Ù. µÎ ¹ø° ColumnÀº GridSpiltterÀ» ¹èÄ¡ÇÏ°í ¼¼ ¹ø° ColumnÀº NXMilmapView ÄÁÆ®·ÑÀ» ¹èÄ¡ÇÑ´Ù.

¸ÕÀú Grid¸¦ ¼¼ °³ÀÇ ColumnÀ¸·Î ³ª´«´Ù. ±× ´ÙÀ½À¸·Î ù ¹ø° Column¿¡ À§ÀÇ Ç¥¸¦ Âü°íÇÏ¿© µµ±¸»óÀÚ¸¦ ÀÌ¿ëÇÏ¿© ÄÁÆ®·ÑÀ» ¹èÄ¡ÇÑ´Ù. ÀÚ¼¼ÇÑ ÄÚµå´Â »ùÇÃÄڵ带 Âü°íÇÑ´Ù.

<Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.6*"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>
<Grid Grid.Column="0">


¡¦


</Grid>
</Grid>

 

3.2.2      µÎ ¹ø° Column¿¡ µµ±¸»óÀÚ¿¡¼­ GridSplitterÀ» ²ø¾î´Ù ¹èÄ¡ÇÏ¿© Á¿츦 ±¸ºÐÇÑ´Ù. ¾Æ·¡¿Í °°Àº XAML Äڵ尡 »ý¼ºµÊÀ» ¾Ë ¼ö ÀÖ´Ù..

<Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.6*"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>
<Grid Grid.Column="0">


¡¦



</Grid>
<GridSplitter Grid.Column="1" x:Name="GridSplitter1"/>
</Grid>

3.2.3     Grid ·¹À̾ƿô ³»ºÎ¿¡¼­ ¼¼ ¹ø° Cell¿¡ Grid¸¦ ¹èÄ¡ÇÏ°í µµ±¸»óÀÚ¿¡¼­ WindowFormHost ÄÁÆ®·ÑÀ» ²ø¾î´Ù ¹èÄ¡ÇÑ´Ù. ÀÌ ÄÁÆ®·ÑÀº Window forms¸¦ Hosting ÇØÁÖ´Â °³Ã¼À̸ç Window Forms ControlÀ» »ç¿ëÇÒ ¶§ ÀÌ¿ëµÈ´Ù. (WindowFormIntegration¿Í System.Window.Forms À» ¾î¼Àºí¸®¿¡ ´ëÇÑ ÂüÁ¶ Ãß°¡¸¦ ÇÑ´Ù.)

3.2.4     ¾Õ¼­ Ãß°¡ÇÑ namespace nxMilmap¸¦ ÀÌ¿ëÇÏ¿© NXMilmapViewÄÁÆ®·ÑÀ» ºÒ·¯¿Â´Ù. ÀÌ NXMilmapViewÀÇ À̸§Àº nxMilmapView1À¸·Î ÇÑ´Ù.

NXMilmapView´Â Equal-arc ÁÂÇ¥ ½Ã½ºÅÛ¿¡¼­ CADRG(Compressed ARC digitized Raster Grshpics), CIB(Controlled Image Base)¿Í °°Àº ±º Áö¿ª Áöµµ µ¥ÀÌÅ͸¦ Á¤ÀÇÇϴ Ŭ·¡½º¿Í Á¦¾îÇÔ¼ö¸¦ Æ÷ÇÔÇÑ´Ù.

 

<Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.6*"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="2*"/>
        </Grid.ColumnDefinitions>
<Grid Grid.Column="0">
. 
.
.
. 
. 
</Grid>
<GridSplitter Grid.Column="1" x:Name="GridSplitter1"/>
<Grid Grid.Column="2">
        <WindowsFormsHost>
             <nxMilmap:NXMilmapView x:Name="nxMilmapView1"/>
        </WindowsFormsHost>
 </Grid>
</Grid>

 

¸ðµç ´Ü°è°¡ ³¡³ª¸é ´ÙÀ½°ú °°Àº µðÀÚÀÎÀ» ¾òÀ» ¼ö ÀÖ´Ù.

 

3.3    ±â´É ¹× À̺¥Æ® Ãß°¡

3.3.1     Window¸¦ ¼±ÅÃÇÏ°í [¼Ó¼º] â - [À̺¥Æ® ] ¸Þ´º¸¦ ¼±ÅÃÇÑ µÚ ¡°Loaded¡± À̺¥Æ®¸¦ ´õºí Ŭ¸¯ÇÑ´Ù.

 

 

¡°Loaded¡± À̺¥Æ®¸¦ ´õºí Ŭ¸¯Çϸé, ¡°Window_Loaded¡± ÇÔ¼ö°¡ ÀÚµ¿ÀûÀ¸·Î Ãß°¡µÇ°í ¾Æ·¡¿Í °°ÀÌ Ãß°¡ÀûÀÎ ±â´ÉÀ» ±¸ÇöÇÒ ¼ö ÀÖµµ·Ï MainWindow.xaml.csÀÇ ÄÚµå·Î À̵¿ÇÏ´Â °ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.

 

 

Window_Loaded ÇÔ¼ö¿Í ÇÔ²² ¾Æ·¡¿Í °°ÀÌ Äڵ带 Ãß°¡ÇÑ´Ù.

 

private void Window_Loaded(object sender, RoutedEventArgs e)
{
       // XMilmapConfig.xmlÀ» ÀÌ¿ëÇÏ¿© ±º»çÁöµµ¸¦ À§ÇÑ NXMilmapView ¹×             
// NXMilmapEngineÀ» ÃʱâÈ­ÇÑ´Ù.
       if (!NXMilmapView.m_MapEngine.InitFromXML("c:\\Pixoneer\\Xdl1.2\\Config\\XMilmapConfig.xml"))
       {
           return;
       }

       // ¸¶¿ì½º ÈÙÀ» ²ø°í ´ç±â´Â °ÍÀ» È®´ë/Ãà¼Ò ¿äÀÎÀ¸·Î °è»êÇÏ¿© È­¸éÀ»
// È®´ë/Ãà¼ÒÇÑ´Ù.
      // ÀÌ ¶§, °è»êµÈ °ø°£ ÇØ»óµµ¿Í °¡±î¿î Ãàô(scale)ÀÌ ÀÖ´Â °æ¿ì ÀÚµ¿ÀûÀ¸·Î 
// ÇØ´ç ÃàôÀ¸·Î ¹Ù²î¸é¼­ µµ½ÃµÈ´Ù.
      // ¸¶¿ì½º ÈÙÀ» ²ø°í ´ç±â´Â °ÍÀ¸·Î È­¸éÀÇ ÃàôÀ» º¯°æÇÏ·Á¸é, 
// NXMilmapView.eWheelZoomAction.ByScaleIndexÀ¸·Î ¼³Á¤
       nxMilmapView1.WheelZoomAction = 
NXMilmapView.eWheelZoomAction.ByZoomFactor;

       nxMilmapView1.SetGeoToCenter(0, new XVertex2d(127.0, 36.0));

       // XMilmapConfig.xml¿¡ ¼³Á¤µÈ Áöµµ Áß À¯È¿ÇÑ µ¥ÀÌÅ͸¸À» »ç¿ëÇÑ´Ù.
       // XMilmapConfig.xml¿¡¼­ ·ÎµùÇÑ ½ºÄÉÀÏÀÇ À̸§À» ScaleÀ» À§ÇÑ ComboBox¿¡
// Ãß°¡ÇÑ´Ù.
       int numScale = NXMilmapView.m_MapEngine.GetNumofScale();
       for (int i = 0; i < numScale; i++)
       {
           string scaleName = NXMilmapView.m_MapEngine.GetScaleName(i);
           comboBoxScale.Items.Add(scaleName);
       }
       // ù ¹ø° ½ºÄÉÀÏÀ» ±âº»°ªÀ¸·Î ÇÏ¿© µµ½ÃÇÑ´Ù.
       if (numScale > 0)
           comboBoxScale.SelectedIndex = 0;

       // Mouse À̺¥Æ® ¼Ó¼º
       checkBoxInverseMouseButton.IsChecked = nxMilmapView1.InverseMouseButton;
       checkBoxInverseMouseWheel.IsChecked = nxMilmapView1.InverseMouseWheel;

      // Grid
       if (nxMilmapView1.GridType == NXMilmapView.eGridType.GridNone)
           comboBoxGrid.SelectedIndex = 0;
       else if (nxMilmapView1.GridType == NXMilmapView.eGridType.GridDegrees)
           comboBoxGrid.SelectedIndex = 1;
       else if (nxMilmapView1.GridType == NXMilmapView.eGridType.GridGARS)
           comboBoxGrid.SelectedIndex = 2;
       else
           comboBoxGrid.SelectedIndex = 0;

      // MilmapView ȸÀü ¼³Á¤
      NXMilmapDrawArgs drawArgs = nxMilmapView1.GetDrawArgs();
      if (drawArgs.Rotatable)
      {
           radioButtonRotateNone.IsChecked = false;
           radioButtonRotateMouse.IsChecked = true;
           radioButtonRotateUserInput.IsChecked = false;
      }
      else
      {
           radioButtonRotateNone.IsChecked = true;
           radioButtonRotateMouse.IsChecked = false;
           radioButtonRotateUserInput.IsChecked = false;
      }

      if (nxMilmapView1.ZoomType == NXMilmapView.eZoomType.MousePostion)
      {
           radioButtonZoomMousePosition.IsChecked = true;
           radioButtonZoomViewCenter.IsChecked = false;
      }
      // NXMilmapView.eZoomType.ViewCenterÀÌ °æ¿ì
      else
      {
           radioButtonZoomMousePosition.IsChecked = false;
           radioButtonZoomViewCenter.IsChecked = true;
      }

      // Áö¸í µµ½Ã ¿©ºÎ ¼³Á¤
      checkBoxShowPBP.IsChecked = nxMilmapView1.ShowPlaceName;
      // NXMilmapView´Â ±âº»ÀûÀ¸·Î È­¸é Áß¾Ó¿¡ ºÓÀº ½ÊÀÚ¸¦ Ç¥½ÃÈù´Ù.
      checkBoxShowCross.IsChecked = true;
}

 

3.3.2     Window¸¦ ¼±ÅÃÇÏ°í [¼Ó¼º] â - [À̺¥Æ® ] ¸Þ´º¸¦ ¼±ÅÃÇÑ µÚ ¡°Closed¡± À̺¥Æ®¸¦ ´õºí Ŭ¸¯ÇÑ´Ù.

¾Æ·¡¿Í °°ÀÌ NXMilmapView°ü·Ã ±â´É ÇØÁ¦¸¦ À§Çؼ­ Äڵ带 Ãß°¡ÇÑ´Ù.

private void Window_Closed(object sender, EventArgs e)
{
        Xfn.Close();
}

 

3.3.3     Mouse À̺¥Æ® °ü·ÃÇÑ (1)~(2) ÄÁÆ®·ÑÀ» Windowâ¿¡¼­ ¼±ÅÃÇÑ ÈÄ ´õºí Ŭ¸¯ÇÑ´Ù.

ÄÁÆ®·Ñ¿¡¼­ ¸¶¿ì½º·Î ´õºí Ŭ¸¯ÇÏ¸é ´ëÇ¥ÀûÀÎ À̺¥Æ®¿¡ ´ëÇØ ÀÚµ¿ÀûÀ¸·Î ÇÔ¼ö°¡ Ãß°¡µÈ´Ù.

¾Æ·¡¿Í °°Àº Äڵ带 Ãß°¡ÇÑ´Ù.

private void checkBoxInverseMouseButton_Checked(object sender, RoutedEventArgs e)
{
     // MilmapView´Â ±âº»ÀûÀ¸·Î ¸¶¿ì½º ¿ÞÂÊ ¹öÆ°À¸·Î È­¸é À̵¿À», ¿À¸¥ÂÊ ¹öÆ°À¸·Î
// È­¸é ȸÀüÀ» ÇÑ´Ù.
     // ¸¶¿ì½º ¿ÞÂÊ ¹öÆ°°ú ¿À¸¥ÂÊ ¹öÆ°¿¡ ´ëÇÑ ±â´ÉÀ» ÀüȯÇÏ·Á¸é, 
// NXMilmapViewÀÇ InverseMouseButtonÀ» true·Î ¼³Á¤ÇÏ¸é µÈ´Ù.
     nxMilmapView1.InverseMouseButton = true;
}

private void checkBoxInverseMouseButton_Unchecked(object sender, RoutedEventArgs e)
{
      // MilmapView´Â ±âº»ÀûÀ¸·Î ¸¶¿ì½º ¿ÞÂÊ ¹öÆ°À¸·Î È­¸é À̵¿À», 
// ¿À¸¥ÂÊ ¹öÆ°À¸·Î È­¸é ȸÀüÀ» ÇÑ´Ù.
      // ¸¶¿ì½º ¿ÞÂÊ ¹öÆ°°ú ¿À¸¥ÂÊ ¹öÆ°¿¡ ´ëÇÑ ±â´ÉÀ» Àüȯ ÈÄ ÇØÁ¦ÇÏ·Á¸é,
// NXMilmapViewÀÇ InverseMouseButtonÀ» false·Î ¼³Á¤ÇÏ¸é µÈ´Ù.
      nxMilmapView1.InverseMouseButton = false;
}

private void checkBoxInverseMouseWheel_Checked(object sender, RoutedEventArgs e)
{
// MilmapViewÀÇ WheelZoomAction °ªÀÌ
// NXMilmapView.eWheelZoomAction.ByZoomFactor ÀÎ °æ¿ì 
      // MilmapView´Â ±âº»ÀûÀ¸·Î ¸¶¿ì½º ÈÙÀ» ´ç±â¸é È­¸éÈ®´ë°¡, 
// ¹Ð¸é È­¸éÃà¼Ò°¡ µÈ´Ù.
      // À̸¦ ÀüȯÇÏ·Á¸é MilmapViewÀÇ InverseMouseWheelÀ» true·Î ¼³Á¤ÇÏ¸é µÈ´Ù.
      nxMilmapView1.InverseMouseWheel = true;
}

private void checkBoxInverseMouseWheel_Unchecked(object sender, RoutedEventArgs e)
{
       // MilmapViewÀÇ WheelZoomAction °ªÀÌ 
// NXMilmapView.eWheelZoomAction.ByZoomFactorÀÎ °æ¿ì 
      // MilmapView´Â ±âº»ÀûÀ¸·Î ¸¶¿ì½º ÈÙÀ» ´ç±â¸é È­¸éÈ®´ë°¡, 
// ¹Ð¸é È­¸éÃà¼Ò°¡ µÈ´Ù.
      // À̸¦ Àüȯ ÈÄ ÇØÁ¦ÇÏ·Á¸é MilmapViewÀÇ InverseMouseWheelÀ» 
// false·Î ¼³Á¤ÇÏ¸é µÈ´Ù.
            nxMilmapView1.InverseMouseWheel = false;
}

 

 

3.3.4     ÃàôÀ» º¯°æÇÏ°í ƯÁ¤ À§°æµµ À§Ä¡·Î È­¸é Áß½ÉÀ» º¯°æÇÏ´Â °ÍÀ» ±¸ÇöÇϱâ À§ÇØ (4), (7) ÄÁÆ®·ÑÀ» Window â¿¡¼­ ¼±ÅÃÇÑ ÈÄ ´õºí Ŭ¸¯ÇÑ´Ù.

(3) ÄÁÆ®·ÑÀÎ checkBoxScaleÀ» ¼±ÅÃÇÏ°í (4) ÄÁÆ®·ÑÀÎ comboBoxScaleÀ» º¯°æÇÏ¿© ¼±ÅÃµÈ ÃàôÀ¸·Î È­¸éÀ» µµ½ÃÇÏ°í, (5)~(6)ÀÇ TextBox ÄÁÆ®·Ñ¿¡ À§°æµµ¸¦ ÀÔ·ÂÇÑ µÚ (7) ÄÁÆ®·ÑÀÎ buttonCenterMove¸¦ Ŭ¸¯Çϸé ÇØ´ç À§Ä¡·Î È­¸éÀÇ Áß½ÉÀ» À̵¿ÇÏ·Á ÇÑ´Ù. ÀÌ ¶§, ÀÔ·Â À§Ä¡¿¡ ÇØ´ç ÃàôÀÌ ÀÖ´Â °æ¿ì¿¡¸¸ À̵¿ °¡´ÉÇÏ´Ù. ÄÚµå´Â ¾Æ·¡¿Í °°´Ù.

private void comboBoxScale_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
      // Ãàô(scale)À» ¼±ÅÃÇÏÁö ¾ÊÀº °æ¿ì¿¡´Â Ãàô º¯°æÀ» ÇÏÁö ¾Ê´Â´Ù.
      Nullable<bool> result = checkBoxScale.IsChecked;
      if (result != true) return;

      int numScale = NXMilmapView.m_MapEngine.GetNumofScale();
      int idx = comboBoxScale.SelectedIndex;

      // Ãàô À妽ºÀÇ À¯È¿ÇÔ Ã¼Å©
      if (idx < 0 || idx >= numScale) return;

      NXMilmapDrawArgs drawArgs = nxMilmapView1.GetDrawArgs();

      // ÇöÀç È­¸é Áß½ÉÀ¸·Î Çؼ­ º¯°æµÈ Ãàô À妽º·Î º¯°æ
      nxMilmapView1.SetGeoToCenter(idx, drawArgs.CenterPos);

      // È­¸é °»½Å ¿äû
      nxMilmapView1.RefreshScreen();
}

private void buttonCenterMove_Click(object sender, RoutedEventArgs e)
{
       double posLon = Double.Parse(textBoxCenterLon.Text);
       double posLat = Double.Parse(textBoxCenterLat.Text);

       // ÀÔ·Â È­¸é Á᫐ À§°æµµ ÁÂÇ¥ À¯È¿ üũ
       if (posLon < -180.0 || posLon > 180.0) return;
       if (posLat < -90.0 || posLat > 90.0) return;

       NXMilmapDrawArgs drawArgs = nxMilmapView1.GetDrawArgs();
       // ÇöÀç ¼³Á¤µÈ ÃàôÀ» ±â¹ÝÀ¸·Î È­¸é Áß½ÉÀ» À̵¿ÇÑ´Ù.
       nxMilmapView1.SetGeoToCenter(drawArgs.ScaleIndex, new XVertex2d(posLon, posLat));

       // È­¸é °»½Å ¿äû
        nxMilmapView1.RefreshScreen();
}

 

3.3.5     (8)~(16) ÄÁÆ®·ÑÀ» Window â¿¡¼­ ¼±ÅÃÇÑ ÈÄ ´õºí Ŭ¸¯ÇÑ´Ù.

(8) ÄÁÆ®·ÑÀÎ comboBoxGrid¸¦ ÀÌ¿ëÇÏ¿© GridÀÇ µµ½Ã ¿©ºÎ ¼³Á¤ ¹× Á¾·ù¸¦ ¼³Á¤ÇÏ°í, (9)~(12) ÄÁÆ®·ÑÀ» ÀÌ¿ëÇÏ¿© È­¸é ȸÀüÀ» ¼³Á¤ÇÑ´Ù. (13)~(14) ÄÁÆ®·ÑÀ» ÅëÇØ È­¸é È®´ë/Ãà¼Ò ¹æ¹ýÀ» Á¶Á¤ÇÑ´Ù. (15) ÄÁÆ®·ÑÀ» üũÇÏ¿© È­¸é¿¡ Áö¸íµµ½Ã¸¦ ÇÏ°í, (16) ÄÁÆ®·ÑÀ» ¼±ÅÃÇÏ¿© È­¸é ½ÊÀÚ Ç¥½Ã¸¦ ÇÑ´Ù. ÄÚµå´Â ¾Æ·¡¿Í °°´Ù.

private void comboBoxGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
        int gridIndex = comboBoxGrid.SelectedIndex;
        if (gridIndex == 0) // none
        {
             nxMilmapView1.GridType = NXMilmapView.eGridType.GridNone;
             nxMilmapView1.ShowGrid = false;
        }

        else if (gridIndex == 1)    // Degrees
        {
             nxMilmapView1.GridType = NXMilmapView.eGridType.GridDegrees;
             nxMilmapView1.ShowGrid = true;
        }

        else if (gridIndex == 2)    // GARS
        {
             nxMilmapView1.GridType = NXMilmapView.eGridType.GridGARS;
             nxMilmapView1.ShowGrid = true;
        }

        // È­¸é °»½Å ¿äû
        nxMilmapView1.RefreshScreen();
}


// È­¸éÀÌ È¸ÀüµÇÁö ¾Êµµ·Ï ¼³Á¤
private void radioButtonRotateNone_Checked(object sender, RoutedEventArgs e)
{
        NXMilmapDrawArgs drawArgs = nxMilmapView1.GetDrawArgs();
        drawArgs.Rotatable = false;
}

// È­¸é ȸÀüÀÌ °¡´ÉÇϵµ·Ï ¼³Á¤
private void radioButtonRotateMouse_Checked(object sender, RoutedEventArgs e)
{
        NXMilmapDrawArgs drawArgs = nxMilmapView1.GetDrawArgs();
        drawArgs.Rotatable = true;
}

// È­¸é ȸÀüÀÌ °¡´ÉÇϵµ·Ï ¼³Á¤ÇÏ°í »ç¿ëÀÚ ÀÔ·ÂÇÏ´Â °¢µµ¿¡ µû¶ó È­¸é ȸÀü
private void textBoxRotateUserInput_TextChanged(object sender, TextChangedEventArgs e)
{
        // »ç¿ëÀÚ ÀÔ·ÂÀ» ¼±ÅÃÇÏÁö ¾ÊÀº °æ¿ì ¹Ý¿µÇÏÁö ¾Ê´Â´Ù.
        Nullable<bool> result = radioButtonRotateUserInput.IsChecked;
        if (result != true) return;

        NXMilmapDrawArgs drawArgs = nxMilmapView1.GetDrawArgs();
        double angleRotate = Double.Parse(textBoxRotateUserInput.Text);

        // È­¸é ȸÀü °¢µµ ¼³Á¤
        drawArgs.AzimuthAng = XAngle.FromDegree(angleRotate);
        drawArgs.Rotatable = true;
        nxMilmapView1.RefreshScreen();
}

// È­¸é È®´ë/Ãà¼ÒÀÇ Áß½ÉÀ» È­¸é Áß½ÉÀ¸·Î ¼³Á¤
private void radioButtonZoomViewCenter_Checked(object sender, RoutedEventArgs e)
{
        nxMilmapView1.ZoomType = NXMilmapView.eZoomType.ViewCenter;
}

// È­¸é È®´ë/Ãà¼Ò Áß½ÉÀ» ¸¶¿ì½º À§Ä¡ Áß½ÉÀ¸·Î ¼³Á¤
private void radioButtonZoomMousePosition_Checked(object sender, RoutedEventArgs e)
{
        nxMilmapView1.ZoomType = NXMilmapView.eZoomType.MousePostion;
}

// Áö¸í µµ½Ã ¿©ºÎ¸¦ ¼³Á¤
private void checkBoxShowPBP_Checked(object sender, RoutedEventArgs e)
{
        nxMilmapView1.ShowPlaceName = true;
        nxMilmapView1.RefreshScreen();
 }

private void checkBoxShowPBP_Unchecked(object sender, RoutedEventArgs e)
{
        nxMilmapView1.ShowPlaceName = false;
        nxMilmapView1.RefreshScreen();
}

// È­¸é Á߽ɿ¡ ½ÊÀÚ Ç¥½Ã ¿©ºÎ ¼³Á¤
private void checkBoxShowCross_Checked(object sender, RoutedEventArgs e)
{
        bool result = (bool)checkBoxShowCross.IsChecked;
        nxMilmapView1.ShowCross(result);
        nxMilmapView1.RefreshScreen();
}

private void checkBoxShowCross_Unchecked(object sender, RoutedEventArgs e)
{
        bool result = (bool)checkBoxShowCross.IsChecked;
        nxMilmapView1.ShowCross(result);
        nxMilmapView1.RefreshScreen();
}

 

3.3.6     ¼Ö·ç¼ÇÀ» ºôµåÇÏ°í ½ÇÇàÇÑ´Ù.