|
TalMap SDK Libary Reference |
OnClickNotify |
XCtrlMan.SetClickNotify() ¸Þ¼Òµå¿¡ ÀÇÇØ Áöµµ°¡ ¸¶¿ì½º Ŭ¸¯¿¡ ¹ÝÀÀÇÏ¿© ¹ß»ýÇÏ´Â À̺¥Æ®. |
|
void OnClickNotify(LONG Type, LONG X, LONG Y); |
|
|
Parameters
|
Type |
XCtrlMan.SetClickNotiry() ¸Þ¼ÒµåÀÇ ÀÎÀÚ·Î »ç¿ëÇÑ °ª. |
X |
Áöµµ ȸéÀÇ X ÁÂÇ¥. |
Y |
Áöµµ ȸéÀÇ Y ÁÂÇ¥. |
|
|
|
Remarks
|
OnClickNotify À̺¥Æ®´Â TalMapX ControlÀÇ XCtrlMan.SetClickNotify() ¸Þ¼Òµå¸¦ È£ÃâÇßÀ» ¶§¿Í ¿¬°üÀÌ ÀÖ´Â À̺¥Æ®ÀÔ´Ï´Ù.
»ç¿ëÀÚ°¡ XCtrlMan.SetClickNotify() ¸Þ¼Òµå¸¦ È£ÃâÇϸé Áöµµ´Â »ç¿ëÀÚÀÇ ¸¶¿ì½º Ŭ¸¯À» ¹Þ´Â »óŰ¡ µË´Ï´Ù.
ÀÌ ¶§ »ç¿ëÀÚ¿¡ ÀÇÇØ ¸¶¿ì½º°¡ Ŭ¸¯µÇ¸é OnClickNotify À̺¥Æ®°¡ ¹ß»ýÇÕ´Ï´Ù.
»ç¿ëÀÚ´Â OnClickNotify À̺¥Æ®¸¦ ÀÌ¿ëÇÏ¿© ÇÊ¿äÇÑ ÀÛ¾÷À» ¼öÇàÇÒ ¼ö ÀÖ½À´Ï´Ù.
SetNotifyEvnet ¸¦ Ãë¼Ò ÇÒ ¶§´Â, ¸¶¿ì½º ¿À¸¥ÂÊ ¹öư À̳ª Escape Key ¸¦ ´©¸£¸é ÃʱâÈ µË´Ï´Ù.
À̶§, X ¿Í Y °ªÀº -1 ·Î ¹Þ½À´Ï´Ù.
|
|
|
|
Example
|
|
<html>
<head>
<script language="javascript">
<!--
// OnClickNotify À̺¥Æ®¸¦ À§ÇÑ ¼±Çà ó¸®
function CallClickNotify(Type)
{
var ctrlman = m_Map.GetCtrlMan();
ctrlman.SetClickNotify(Type);
}
// ClickNotify À̺¥Æ® ó¸®
function MapEvent_OnClickNotify(Type, X, Y);
{
// alert("ClickNotify : " + Type + "," + X + "," + Y);
if (Type == 1) {
var ctrlman = m_Map.GetCtrlMan();
var ctrlstate = ctrlman.GetControlState();
var lonlat = ctrlstate.DPToLL(X, Y);
// Step 1. Get POI Manger
var poiman = ctrlman.GetPOIMan();
var baseman = poiman.CastToBaseManager();
// Step 2. Make POI Group
var group = poiman.FindGroup(Type);
if (!group) group = poiman.NewGroup(Type);
// Step 3. Make POI Items
var imageman = ctrlman.GetImageMan();
imageman.SetDefaultPath("http://www.talmap.co.kr/tutorial/");
var image = imageman.LoadImage("SPORTSCAR", "image/car_sports_3.png");
if (image.IsValid() != true) alert("Image ÀÌ»ó");
var item = group.NewItem(-1)
item.SetLonLat(lonlat.X, lonlat.Y);
item.SetImage(image);
item.SetShowImage(1)
item.SetImageIndex(1)
item.SetImageOffset(4)
item.SetTextStyle(0x12)
item.SetCaption("[CAPTION] Sports Car")
item.SetContents("[CONTENTS] ClickNotify·Î »ý¼ºÇÑ POI")
item.SetAlpha(100)
}
}
-->
</script>
<script language="javascript" for="m_Map" event="OnClickNotify(Type, X, Y)">
<!--
MapEvent_OnClickNotify(Type, X, Y);
-->
</script>
</head>
<body>
<table>
<tr>
<td>
<OBJECT ID="Map" CLASSID="CLSID:DD9B48AD-EDDC-4D2C-BD68-D1FB4B382024"
codebase='http://localhost/TalMapX_Web.CAB#version=1,0,0,17' width=100% height=80%>
</OBJECT>
</td>
</tr>
</table>
</body>
</html>
|
|
|
#include "CXCtrlMan.h"
#include "CXPOIMan.h"
#include "CXPOIGroup.h"
#include "CXPOIItem.h"
#include "CXBaseMan.h"
#include "CXImageMan.h"
#include "CXMagicImage.h"
#include "CXUtility.h"
#include "CXControlState.h"
#include "CXPoint.h"
BEGIN_EVENTSINK_MAP(CSampleDlg, CDialog)
ON_EVENT(CSampleDlg, IDC_TALMAPXCTRL1, 9, CSampleDlg::OnClickNotifyTalmapxctrl1, VTS_I4 VTS_I4 VTS_I4)
END_EVENTSINK_MAP()
void CSampleDlg::SetNotiEvent()
{
CXCtrlMan ctrlman = m_Map.GetCtrlMan();
// »ç¿ëÀÚ ÁöÁ¤ À̺¥Æ® ¼³Á¤
ctrlman.SetClickNotify(1);
}
void CSampleDlg::OnClickNotifyTalmapxctrl1(long Type, long X, long Y)
{
// TODO: ¿©±â¿¡ ¸Þ½ÃÁö 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
if (Type == 100) {
CXUtility util = m_Map.GetUtility();
CString msg;
msg.Format(_T("Root Director [%s]"), util.GetRootDir());
AfxMessageBox(msg);
} else if (Type == 1) {
CXCtrlMan ctrlman = m_Map.GetCtrlMan();
CXControlState ctrlstate = ctrlman.GetControlState();
CXPoint posLL = ctrlstate.DPToLL(X, Y);
// Step 1. Get POI Manager
CXPOIMan poiman = ctrlman.GetPOIMan();
CXBaseMan baseman = poiman.CastToBaseManager();
// Step 2. Make POI Group
CXPOIGroup group = poiman.FindGroup(Type);
if (group.m_lpDispatch != NULL) {
group = poiman.NewGroup(Type);
}
// Step 3. Make POI Items
CXImageMan imageman = ctrlman.GetImageMan();
imageman.SetDefaultPath(_T("http://www.talmap.co.kr/tutorial/"));
CXMagicImage image = imageman.LoadImage(_T("SPORTCAR"), _T("image/car_sports_3.png"));
if (!image.IsValid()) {
AfxMessageBox(_T("Image ·Îµå¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù"));
}
CXPOIItem item = group.NewItem(-1);
item.SetLonLat(posLL.GetX(), posLL.GetY());
item.SetImage(image);
item.SetImageIndex(1);
item.SetImageOffset(4);
item.SetTextStyle(0x12);
item.SetCaption(_T("[CAPTION] Sports Car"));
item.SetContents(_T("[CONTENTS] ClickNotify·Î »ý¼ºÇÑ POI"));
item.SetAlpha(100);
}
}
|
|
|
|
See Also
|
|
Map Preview
|
|