|
|
var ctrlMan = m_Map.GetCtrlMan();
var ctrlstate = ctrlMan.GetControlState();
var layerMan = ctrlMan.GetLayerMan();
var util = m_Map.GetUtility();
var centerLL = ctrlstate.GetLLCenter(); // ÁöµµÀÇ Á᫐ ÁÂÇ¥
var uiman = ctrlMan.GetUIMan();
var poiman = ctrlMan.GetPOIMan();
var gstyle = poiman.FindStyle(21571);
if (!gstyle)
{
gstyle = poiman.NewStyle(21571);
gstyle.SetGDIFont("±¼¸²", 0, 10);
gstyle.SetFontColor(util.RGBColor(255, 255, 255));
gstyle.SetBrush(util.RGBColor(0, 0, 0), 0);
gstyle.SetPen(util.RGBColor(0, 0, 0), 0, 0);
}
var pgroup = poiman.FindGroup(21572);
if (!pgroup)
{
pgroup = poiman.NewGroup(21572);
pgroup.SetStyle(gstyle);
}
// Step 1. Make XLayer Style
var style = layerMan.NewStyle(-1);
style.SetPen(util.RGBColor(255, 0, 0), 0, util.GetConstToValue("PS_SOLID"));
style.SetBrush(util.RGBAColor(0, 0, 255, 100), util.GetConstToValue("BS_SOLID"));
var lDensity = layerMan.NewDensity(2011);
if (!lDensity) {
alert("Layer Density »ý¼º ¿À·ù!!");
return;
}
lDensity.BeginUpdate();
lDensity.SetColor(util.RGBAColor(50, 255, 255, 50), util.RGBAColor(50, 50, 255, 200), util.RGBAColor(255, 0, 0, 200));
for (var i = 0; i < 20; i++) {
var tlon = centerLL.GetX() + (Math.random() * 2000);
var tlat = centerLL.GetY() + (Math.random() * 2000);
var tval = Math.random() * 100;
var valpos = util.GetMapPos();
valpos.SetLon(tlon);
valpos.SetLat(tlat);
var poiitem = pgroup.NewItem(-1);
poiitem.SetLonLat(tlon, tlat);
poiitem.SetCaption("[" + i + "]" + Math.round(tval));
lDensity.AddValue(tlon, tlat, tval);
}
lDensity.AddValue(centerLL.GetX(), centerLL.GetY(), 0);
var poiitem = pgroup.NewItem(-1);
poiitem.SetLonLat(centerLL.GetX(), centerLL.GetY());
poiitem.SetCaption("[" + i + "]" + 0);
lDensity.GenerateDensity(700, 100);
lDensity.SetStyle(style);
lDensity.ClearValue();
lDensity.EndUpdate();
|
|
|
#include "CXCtrlMan.h"
#include "CXUtility.h"
#include "CXControlState.h"
#include "CXPoint.h"
#include "CXLayerMan.h"
#include "CXPoint.h"
#include "CXUIMan.h"
#include "CXPOIMan.h"
#include "CXPOIGroup.h"
void CTestTalMapXDlg::OnBnClickedButton3()
{
CXCtrlMan ctrlMan = m_Map.GetCtrlMan();
CXControlState ctrlstate = ctrlMan.GetControlState();
CXLayerMan layerMan = ctrlMan.GetLayerMan();
CXUtility util = m_Map.GetUtility();
CXPoint centerLL = ctrlstate.GetLLCenter(); // ÁöµµÀÇ Á᫐ ÁÂÇ¥
CXUIMan uiman = ctrlMan.GetUIMan();
CXPOIMan poiman = ctrlMan.GetPOIMan();
CXPOIStyle gstyle = poiman.FindStyle(21571);
if (style.m_lpDispatch == NULL)
{
gstyle = poiman.NewStyle(21571);
gstyle.SetGDIFont("±¼¸²", 0, 10);
gstyle.SetFontColor(util.RGBColor(255, 255, 255));
gstyle.SetBrush(util.RGBColor(0, 0, 0), 0);
gstyle.SetPen(util.RGBColor(0, 0, 0), 0, 0);
}
CXPOIGroup pgroup = poiman.FindGroup(21572);
if (pgroup.m_lpDispatch == NULL)
{
pgroup = poiman.NewGroup(21572);
pgroup.SetStyle(gstyle);
}
// Step 1. Make XLayer Style
CXLayerMan lstyle = layerMan.NewStyle(-1);
if (lstyle.m_lpDispatch == NULL)
{
lstyle.SetPen(util.RGBColor(255, 0, 0), 0, util.GetConstToValue("PS_SOLID"));
lstyle.SetBrush(util.RGBAColor(0, 0, 255, 100), util.GetConstToValue("BS_SOLID"));
}
CXLayerDensity lDensity = layerMan.NewDensity(2011);
if (lDensity.m_lpDispatch == NULL)
{
AfxMessageBox("Layer Density Object Crearte Error!!");
}
lDensity.BeginUpdate();
lDensity.SetColor(util.RGBAColor(50, 255, 255, 50), util.RGBAColor(50, 50, 255, 200), util.RGBAColor(255, 0, 0, 200));
for (int i = 0; i < 20; i++)
{
int tlon = centerLL.GetX() + (Math.random() * 2000);
int tlat = centerLL.GetY() + (Math.random() * 2000);
int tval = Math.random() * 100;
CXMapPos valpos = util.GetMapPos();
valpos.SetLon(tlon);
valpos.SetLat(tlat);
CXPOIItem poiitem = pgroup.NewItem(-1);
poiitem.SetLonLat(tlon, tlat);
poiitem.SetCaption(_T("[" + i + "]" + Math.round(tval)));
lDensity.AddValue(tlon, tlat, tval);
}
lDensity.AddValue(centerLL.GetX(), centerLL.GetY(), 0);
CXPOIItem poiitem = pgroup.NewItem(-1);
poiitem.SetLonLat(centerLL.GetX(), centerLL.GetY());
poiitem.SetCaption(_T("[" + i + "]" + 0));
lDensity.GenerateDensity(700, 100);
lDensity.ClearValue();
lDensity.SetStyle(style);
lDensity.EndUpdate();
}
|
|