|
|
var ctrlman = m_Map.GetCtrlMan();
var ctrlstate = ctrlman.GetControlState();
var util = m_Map.GetUtility();
var posLL = ctrlstate.GetLLCenter(); // ÁöµµÀÇ Á᫐ ÁÂÇ¥
// Step 1. Get POI Manger
var poiman = ctrlman.GetPOIMan();
var baseman = poiman.CastToBaseManager();
var style = poiman.FindStyle(2);
if (!style) {
style = poiman.NewStyle(2);
style.SetGDIFont("±¼¸²", 0, 8);
style.SetFontColor(util.RGBColor(0, 0, 0));
style.SetFontOutColor(util.RGBColor(255, 255, 255));
style.SetBrush(util.RGBColor(100, 0, 255), 0);
style.SetPen(util.RGBColor(0, 0, 0), 1, 0);
}
// Step 3. Make POI Items
var imageman = ctrlman.GetImageMan();
imageman.SetDefaultPath("http://www.talmap.co.kr/tutorial/");
var image = imageman.LoadImageList("CAR_IMAGE", "image/CAR.png", 64, 64);
if (image.IsValid() != true) alert("Image ÀÌ»ó");
var item = group.NewItem(-1)
item.SetLonLat(posLL._X , posLL._Y )
item.SetShowImage(1)
item.SetImageIndex(14)
item.SetImageOffset(4)
item.SetTextStyle(0x12)
item.SetStyle(style)
item.SetContents("[" + i + "] Contents\nHello")
item.SetCaption("[" + i + "]POI TEST")
item.SetSyncAngle(1)
item.SetAngle(angle)
item.SetAlpha(100);
item.SetScale(70);
item.SetImage(image);
}
|
|
|
CXUtility util = m_Map.GetUtility();
// Step1. ÁöµµÁß½ÉÁÂÇ¥¸¦ ±¸ÇÕ´Ï´Ù.
CXControlState ctrlstate = ctrlman.GetControlState();
CXPoint posLL = ctrlstate.GetLLCenter();
// Step2. POI Group À» »ý¼º ÇÕ´Ï´Ù.
CXPOIMan poiman = ctrlman.GetPOIMan();
CXPOIGroup group = poiman.FindGroup(100);
if (group.m_lpDispatch == NULL)
group = poiman.NewGroup(100);
// Step3. POI Style À» »ý¼º ÇÕ´Ï´Ù.
CXPOIStyle style = poiman.FindStyle(1000);
if (style.m_lpDispatch == NULL) {
style = poiman.NewStyle(1000);
style.SetGDIFont(_T("±¼¸²"), 0, 8);
style.SetFontColor(util.RGBColor(255, 0, 0));
style.SetFontOutColor(util.RGBColor(255, 255, 255));
style.SetBrush(util.RGBColor(100, 0, 255), 0);
style.SetPen(util.RGBColor(0, 0, 0), 1, 0);
}
group.SetStyle(style);
// Step4. POI¿¡ »ç¿ëÇÒ À̹ÌÁö¸¦ ·Îµù ÇÕ´Ï´Ù.
CXImageMan imageman = ctrlman.GetImageMan();
imageman.SetDefaultPath(ctrlman.GetDefaultPath()+_T("\\Theme\\"));
CXMagicImageList image = imageman.LoadImageList(_T("CAR_IMAGE"), _T("Image\\CAR.png"), 64, 64);
// Step5. POI Item À» »ý¼º ÇÕ´Ï´Ù.
CXPOIItem poi = group.NewItem(-1); // ID°¡ -1 ÀÌ¸é ¼øÂ÷Àû ID ÀÚµ¿»ý¼º.
poi.SetLonLat(posLL.GetX(), posLL.GetY()); // POI ÁÂÇ¥ ¼³Á¤
poi.SetImage(image); // POI À̹ÌÁö ¼³Á¤
poi.SetShowImage(1); // POI À̹ÌÁö Ç¥Ãâ (0 À̸é Ç¥Ãâ ÇÏÁö ¾ÊÀ½)
poi.SetImageIndex(0); // ImageList ¸¦ »ç¿ëÇÒ °æ¿ì À̹ÌÁöÀÇ Index
poi.SetImageOffset(3); // À̹ÌÁö offset
poi.SetTextStyle(0x12); // ÅØ½ºÆ® ½ºÅ¸ÀÏ
poi.SetStyle(style); // À§¿¡¼ »ý¼ºÇÑ ½ºÅ¸ÀÏ ÁöÁ¤, group ¿¡¼ ÁöÁ¤ÇßÀ¸¸é »ý·« °¡´É
poi.SetCaption(_T("Caption")); // ĸ¼Ç
poi.SetContents(_T("Contents \r\nContents \r\nContents \r\nContents \r\nContents \r\n"));// ÄÁÅÙÃ÷
poi.SetAnimation(200); // ImageList ¸¦ »ç¿ëÇÑ °æ¿ì ¾Ö´Ï¸ÞÀÌ¼Ç ±â´É.
poi.SetAngle(90); // ȸÀü°¢µµ
poi.SetAlpha(100); // Åõ¸íµµ 0~100
|
|