//------------------------------------------------------------------------------
// POI »ý¼º
//------------------------------------------------------------------------------
function MakePOIs(groupID, itemCount)
{
// alert("MakePOIs("+groupID+","+itemCount+")");
var ctrlMan = m_Map.GetCtrlMan();
var ctrlstate = ctrlMan.GetControlState();
var poiMan = ctrlMan.GetPOIMan();
var util = m_Map.GetUtility();
// Step 1. Make POI Group
var poiGroup = poiMan.FindGroup(groupID);
if (!poiGroup) {
poiGroup = poiMan.NewGroup(groupID);
}
// Step 1-1. Make POI Style
var gstyle = poiMan.NewStyle(-1); // -1: ¾ÆÀ̵ð ÀÚµ¿ »ý¼º
gstyle.SetGDIFont("±¼¸²", 0, 8);
gstyle.SetFontColor(util.RGBColor(255, 0, 0));
gstyle.SetFontOutColor(util.RGBColor(255, 255, 255));
gstyle.SetBrush(util.RGBColor(100, 0, 255), 0);
gstyle.SetPen(util.RGBColor(0, 0, 0), 1, 0);
// Group¿¡ StyleÀ» ÁöÁ¤Çϸé ÇÏÀ§ ItemÀº º°µµÀÇ StyleÀ» °¡ÁöÁö ¾Ê´Â ÇÑ GroupÀÇ StyleÀ» µû¸£°Ô µÈ´Ù.
poiGroup.SetStyle(gstyle);
var style = poiMan.NewStyle(-1);
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 2. Make POI Items
var centerLL = ctrlstate.GetLLCenter(); // ÁöµµÀÇ Á᫐ ÁÂÇ¥
var imageman = ctrlMan.GetImageMan();
imageman.SetDefaultPath("http://www.talmap.co.kr/tutorial/");
var image = imageman.LoadImageList("CAR_IMAGE", "image/CAR.png", 64, 64)
//var path = ctrlMan.ExpandPathFromRoot("Image", "CAR.png");
for (i = 1 ; i <= itemCount ; i++) {
var item = poiGroup.NewItem(i); // -1: ¾ÆÀ̵ð ÀÚµ¿ »ý¼º
item.SetLonLat(centerLL._X + i * 250, centerLL._Y - i * 250)
item.SetShowImage(1);
item.SetImageIndex(1);
item.SetImageOffset(4);
item.SetTextStyle(0x12);
item.SetImage(image);
if (i % 2) {
item.SetStyle(style);
}
item.SetCaption("[" + i + "]Test POI");
item.SetContents("[" + i + "] Contents\nHello");
item.SetAnimation(200); // 1ÃÊ ´ÜÀ§
item.SetAngle(i*10);
item.SetAlpha(50);
}
}
<script language="javascript" for="m_Map" event="OnPOI_Click(XPOIItem, Flag, X, Y)">
<!--
alert(XPOIItem.GetGroup().GetID()); //POI GroupÀÇ ID¸¦ ±¸ÇÕ´Ï´Ù.
MapEvent_OnPOI_Click(XPOIItem, Flag, X, Y);
-->
</script>