XDL Manual (piXoneer XDL Tutorial)
NXMilmapView¸¦ ÀÌ¿ëÇÏ¿© ±º Áöµµ µµ½Ã ¿£ÁøÀÇ ±â´É »ç¿ë¹ýÀ» ÀÍÈ÷°í °£´ÜÇÑ µµ½Ã±â´ÉÀ» Ãß°¡Çغ¸µµ·Ï ÇÕ´Ï´Ù.
2017. 01. ¼öÁ¤ 2019. 02.
|
1 »ç¿ëÇϱâ
1.1 XDL ¿£Áø¼³Ä¡ ÇÁ·Î±×·¥À¸·Î ¹èÆ÷µÇ´Â XDL ¿£ÁøÀº Visual Studio 2010 x86 Release ¹öÀüÀ¸·Î, Visual Studio 2010 ÀÌ»óÀÇ ¹öÀü¿¡¼ »ç¿ë°¡´ÉÇÏ´Ù. ¾Æ·¡ÀÇ ¼³¸íÀº Visual Studio 2010À» ±âÁØÀ¸·Î ÇϰڴÙ. 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 2010À» ½ÇÇàÇÑ´Ù.3.1.2 ¸Þ´º [ÆÄÀÏ]-[»õ·Î ¸¸µé±â]-[ÇÁ·ÎÁ§Æ®]¸¦ ¼±ÅÃÇÑ´Ù.3.1.3 [»õ ÇÁ·ÎÁ§Æ®] ´ëÈ»óÀÚ¿¡¼ ¿ÞÂÊÀÇ ÅÛÇø´ â¿¡¼ ¡°Visual C#¡±À» ¼±ÅÃÇϰí, ´ëÈ»óÀÚ Áß°£ÀÇ ¸ñ·Ï¿¡¼ ¡°Windows Forms ÀÀ¿ë ÇÁ·Î±×·¥¡±À» ¼±ÅÃÇÑ´Ù. ÇÁ·ÎÁ§Æ®ÀÇ À̸§(XDL_MilmapView1)À» ÀÔ·ÂÇϰí [»õ ÇÁ·ÎÁ§Æ®] ´ëÈ»óÀÚÀÇ ¡°È®ÀΡ± ¹öưÀ» Ŭ¸¯ÇÑ´Ù.¡°È®ÀΡ± ¹öưÀ» ´©¸£¸é ÇÁ·ÎÁ§Æ®°¡ ±âº»ÀûÀ¸·Î »ý¼ºµÇ°í, ȸ鿡 FormÀ» µðÀÚÀÎÇÒ ¼ö Àִ ȸéÀÌ »ý¼ºµÈ´Ù. ¸¸¾à ¾Æ·¡¿Í °°ÀÌ Form µðÀÚÀΠȸéÀÌ »ý¼ºµÇÁö ¾ÊÀ¸¸é, [¼Ö·ç¼Ç Ž»ö±â] â¿¡¼ ¡°Form1.cs¡±¸¦ ¸¶¿ì½º ´õºí Ŭ¸¯ÇÏ¿© µðÀÚÀÎȸéÀ» ¿¬´Ù.
3.1.4 [µµ±¸»óÀÚ]ÀÇ [Ç׸ñ¼±ÅÃ]À» ¼±ÅÃÇÑ´Ù.[µµ±¸ »óÀÚ] âÀÇ ¡°ÀϹݡ±¿¡¼ ¸¶¿ì½º ¿À¸¥ÂÊ ¹öưÀ» Ŭ¸¯ÇÏ¿© »ý¼ºµÇ´Â ÆË¾÷¸Þ´º¿¡¼ ¡°Ç׸ñ ¼±Åá± ¸Þ´º¸¦ ¼±ÅÃÇÑ´Ù.
¸Þ´º¸¦ ¼±ÅÃÇÏ¸é ¾Æ·¡¿Í °°ÀÌ [µµ±¸ »óÀÚ Ç׸ñ ¼±ÅÃ] ´ëÈ»óÀÚ°¡ ³ªÅ¸³ª¸ç, ´ëÈ»óÀÚ ¾Æ·¡ÂÊ¿¡ ÀÖ´Â ¡°Ã£¾Æº¸±â¡± ¹öưÀ» Ŭ¸¯ÇÑ´Ù.
¿±â ´ëÈ»óÀÚ¿¡¼ ¡°C:\Pixoneer\XDL1.2\bin\NXMilmap.dll¡± ÆÄÀÏÀ» ¼±ÅÃÇÑ ÈÄ ¡°¿±â¡±¸¦ Ŭ¸¯Çϰí, [µµ±¸ »óÀÚ Ç׸ñ ¼±ÅÃ] ´ëÈ»óÀÚÀÇ ¡°È®ÀΡ± ¹öưÀ» Ŭ¸¯ÇÑ´Ù.
.Net Framework ±¸¼º¿ä¼Ò ÅÇ¿¡ ´Ù¾çÇÑ ·¹À̾î¿Í NXMilmapView°¡ ¼³Á¤µÈ´Ù. ¡°È®ÀΡ±¹öưÀ» Ŭ¸¯ÇÑ´Ù. [µµ±¸»óÀÚ]¿¡ ´Ù¾çÇÑ MilmapLayerµé°ú NXMilmapView°¡ Ãß°¡µÊÀ» È®ÀÎÇÑ´Ù.
3.1.5 ¼Ö·ç¼Ç Ž»ö±âÀÇ ÇÁ·ÎÁ§Æ® ÇϺÎÀÇ [ÂüÁ¶]ÀÇ ¿À¸¥ÂÊ ¸¶¿ì½º Ŭ¸¯À» ÅëÇØ [ÂüÁ¶Ãß°¡]¸¦ ¼±ÅÃÇÑ´Ù.3.1.6 [ã¾Æº¸±â]ÅÇÀ¸·Î À̵¿ÇÑ ÈÄ ¡°C:\Pixoneer\XDL1.2\bin\¡±°æ·Î·Î À̵¿ÇÑ´Ù. Ctrl۸¦ ´©¸¥ ä ¡°NXDL.dll¡±, ¡°NXDLgr.dll¡±, ¡°NXMilmap.dll¡±À» ¼±ÅÃÇÑ ÈÄ ¡°È®ÀΡ±¹öưÀ» ¼±ÅÃÇÑ´Ù.3.1.7 ¼Ö·ç¼Ç Ž»ö±âÀÇ ÇÁ·ÎÁ§Æ® ÇϺÎÀÇ [ÂüÁ¶]Ç׿¡ NXDL, NXDLgr, NXMilmapÀÌ Ãß°¡µÇ¾úÀ½À» È®ÀÎÇÑ´Ù.
3.2 ÇÁ·Î±×·¥ µðÀÚÀÎ
3.2.1 [µµ±¸ »óÀÚ]ÀÇ ¡°SplitContainer¡±¸¦ ¼±ÅÃÇϰí Form1¿¡ ²ø¾î´Ù°¡ ³õ´Â´Ù.
Form1¿¡ splitContainer1ÀÌ Ãß°¡µÇ¸ç ¾Æ·¡¿Í °°ÀÌ ¡°Panel1¡±°ú ¡°Panel2¡±°¡ »ý±ä´Ù. Panel1¿¡´Â (1)~(16)ÀÇ ÄÁÆ®·ÑÀ» Ãß°¡ÇÏ¿© µðÀÚÀÎÇϰí, Panel2¿¡´Â (17) ÄÁÆ®·ÑÀ» Ãß°¡ÇÑ´Ù. Panel1ÀÇ µðÀÚÀÎÀº À§ÀÇ Ç¥¸¦ Âü°í·Î ±¸¼ºÇϵµ·Ï ÇÏ¸ç ¿©±â¿¡¼´Â »ý·«Çϵµ·Ï ÇÑ´Ù. 3.2.2 [µµ±¸ »óÀÚ]ÀÇ NXMilmapView¸¦ ¼±ÅÃÇÑ µÚ µå·¡±×ÇÏ¿© Form1ÀÇ Panel2¿¡ ³õ´Â´Ù. Form1 À§¿¡ NXMilmapView ÄÁÆ®·ÑÀÌ »ý¼ºµÈ´Ù.
3.2.3 »ý¼ºµÈ NXMilmapView ÄÁÆ®·ÑÀÇ ¿À¸¥ÂÊ »ó´Ü¿¡ ¡°►¡± ±âÈ£¸¦ Ŭ¸¯ÇÏ¸é ¡°ºÎ¸ð ÄÁÅ×À̳ʿ¡¼ µµÅ·¡± ¹öưÀÌ »ý¼ºµÇ´Âµ¥ ÀÌ ¹öưÀ» Ŭ¸¯ÇÑ´Ù.
NXMilmapview ÄÁÆ®·ÑÀÌ Form1¿¡ µµÅ·µÇ¾î ÀüüÄÁÆ®·Ñ ¿µ¿ªÀ¸·Î È®´ëµÈ´Ù. Form1.Designer.cs¿¡¼ º¸¸é ÄÁÆ®·Ñ nxMilmapView1 ¸â¹öº¯¼ö°¡ Ãß°¡µÊÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù. NXMilmapView´Â ´Ù¾çÇÑ NXMilmapLayerXXXµéÀ» ´ãÀ» ¼ö ÀÖ´Â ÄÁÅ×À̳ÊÀÌ´Ù. Áï, NXMilmapView´Â ´Ù¾çÇÑ °èÃøÀÇ ·¹À̾î·Î ±¸¼ºÇÏ¿© ±¸ ±â¹Ý ±â´ÉÀ» ´Ù¾çÇÏ°Ô ±¸ÇöÇÒ ¼ö ÀÖ´Ù.
3.2.4 NXMilmapView ÄÁÆ®·ÑÀÌ Form1¿¡ µµÅ·µÇ¾î ÀüüÄÁÆ®·Ñ ¿µ¿ªÀ¸·Î È®´ëµÈ´Ù.
3.3 ±â´É ¹× À̺¥Æ® Ãß°¡3.3.1
Form1À» ¼±ÅÃÇϰí [¼Ó¼º] â - [À̺¥Æ®
|
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { Xfn.Close(); } |
ÄÁÆ®·Ñ¿¡¼ ¸¶¿ì½º·Î ´õºí Ŭ¸¯ÇÏ¸é ´ëÇ¥ÀûÀÎ À̺¥Æ®¿¡ ´ëÇØ ÀÚµ¿ÀûÀ¸·Î ÇÔ¼ö°¡ Ãß°¡µÈ´Ù.
¾Æ·¡¿Í °°ÀÌ Äڵ带 Ãß°¡ÇÑ´Ù.
(3) ÄÁÆ®·ÑÀÎ checkBoxScaleÀ» ¼±ÅÃÇϰí (4) ÄÁÆ®·ÑÀÎ comboBoxScaleÀ» º¯°æÇÏ¿© ¼±ÅÃµÈ ÃàôÀ¸·Î ȸéÀ» µµ½ÃÇϰí, (5)~(6)ÀÇ TextBox ÄÁÆ®·Ñ¿¡ À§°æµµ¸¦ ÀÔ·ÂÇÑ µÚ (7) ÄÁÆ®·ÑÀÎ buttonCenterMove¸¦ Ŭ¸¯Çϸé ÇØ´ç À§Ä¡·Î ȸéÀÇ Áß½ÉÀ» À̵¿ÇÏ·Á ÇÑ´Ù. ÀÌ ¶§, ÀÔ·Â À§Ä¡¿¡ ÇØ´ç ÃàôÀÌ ÀÖ´Â °æ¿ì¿¡¸¸ À̵¿°¡´ÉÇÏ´Ù.
ÄÚµå´Â ¾Æ·¡¿Í °°´Ù.
private void comboBoxScale_SelectedIndexChanged(object sender, EventArgs e) { // Ãàô(scale)À» ¼±ÅÃÇÏÁö ¾ÊÀº °æ¿ì¿¡´Â Ãàô º¯°æÀ» ÇÏÁö ¾Ê´Â´Ù. if (!checkBoxScale.Checked) 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, EventArgs 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(); } |
(8) ÄÁÆ®·ÑÀÎ comboBoxGrid¸¦ ÀÌ¿ëÇÏ¿© GridÀÇ µµ½Ã ¿©ºÎ ¼³Á¤ ¹× Á¾·ù¸¦ ¼³Á¤Çϰí, (9)~(12) ÄÁÆ®·ÑÀ» ÀÌ¿ëÇÏ¿© ȸé ȸÀüÀ» ¼³Á¤ÇÑ´Ù. (13)~(14) ÄÁÆ®·ÑÀ» ÅëÇØ ȸé È®´ë/Ãà¼Ò ¹æ¹ýÀ» Á¶Á¤ÇÑ´Ù. (15) ÄÁÆ®·ÑÀ» üũÇÏ¿© ȸ鿡 Áö¸íµµ½Ã¸¦ Çϰí, (16) ÄÁÆ®·ÑÀ» ¼±ÅÃÇÏ¿© È¸é ½ÊÀÚ Ç¥½Ã¸¦ ÇÑ´Ù.
ÄÚµå´Â ¾Æ·¡¿Í °°´Ù.
private void comboBoxGrid_SelectedIndexChanged(object sender, EventArgs 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_CheckedChanged(object sender, EventArgs e) { NXMilmapDrawArgs drawArgs = nxMilmapView1.GetDrawArgs(); drawArgs.Rotatable = false; }
// ȸé ȸÀüÀÌ °¡´ÉÇϵµ·Ï ¼³Á¤ private void radioButtonRotateMouse_CheckedChanged(object sender, EventArgs e) { NXMilmapDrawArgs drawArgs = nxMilmapView1.GetDrawArgs(); drawArgs.Rotatable = true; }
// ȸé ȸÀüÀÌ °¡´ÉÇϵµ·Ï ¼³Á¤ÇÏ°í »ç¿ëÀÚ ÀÔ·ÂÇÏ´Â °¢µµ¿¡ µû¶ó ȸé ȸÀü private void textBoxRotateUserInput_TextChanged(object sender, EventArgs e) { // »ç¿ëÀÚ ÀÔ·ÂÀ» ¼±ÅÃÇÏÁö ¾ÊÀº °æ¿ì ¹Ý¿µÇÏÁö ¾Ê´Â´Ù. if (!radioButtonRotateUserInput.Checked) return;
NXMilmapDrawArgs drawArgs = nxMilmapView1.GetDrawArgs(); double angleRotate = Double.Parse(textBoxRotateUserInput.Text); // ȸé ȸÀü °¢µµ ¼³Á¤ drawArgs.AzimuthAng = XAngle.FromDegree(angleRotate); drawArgs.Rotatable = true; nxMilmapView1.RefreshScreen(); }
// ȸé È®´ë/Ãà¼ÒÀÇ Áß½ÉÀ» ȸéÁß½ÉÀ¸·Î ¼³Á¤ private void radioButtonZoomViewCenter_CheckedChanged(object sender, EventArgs e) { nxMilmapView1.ZoomType = NXMilmapView.eZoomType.ViewCenter; }
// ȸé È®´ë/Ãà¼Ò Áß½ÉÀ» ¸¶¿ì½º À§Ä¡ Áß½ÉÀ¸·Î ¼³Á¤ private void radioButtonZoomMousePosition_CheckedChanged(object sender, EventArgs e) { nxMilmapView1.ZoomType = NXMilmapView.eZoomType.MousePostion; }
// Áö¸í µµ½Ã ¿©ºÎ¸¦ ¼³Á¤ private void checkBoxShowPBP_CheckedChanged(object sender, EventArgs e) { nxMilmapView1.ShowPlaceName = checkBoxShowPBP.Checked; nxMilmapView1.RefreshScreen(); }
// ȸé Á߽ɿ¡ ½ÊÀÚ Ç¥½Ã ¿©ºÎ ¼³Á¤ private void checkBoxShowCross_CheckedChanged(object sender, EventArgs e) { nxMilmapView1.ShowCross(checkBoxShowCross.Checked); nxMilmapView1.RefreshScreen(); } |