我有一些点的经纬度 要求是在MAPINFO中做一个图层,把这些经纬度坐标点画上去。请问我需要怎么操作 麻烦说详细点谢谢了 我是新手没怎么用过mapinfo 谢谢说下 详细点
------解决方案--------------------
void CJianguandaohangDlg::addjz(double xcoordinate,double ycoordinate,CString str)//在地图上显示基站的图标,传入函数为坐标
{
CMapXFeatureFactory FeaFac;
CMapXFeature Feature;
CMapXStyle Style;
CString mysql;
if (drawnum>=1)
{
CMapXLayer layer = m_map1.GetLayers().Item("tempLayer");
layer.SetEditable(TRUE);
CMapXFeature fea;
CMapXFeatures features;
while(layer.AllFeatures().GetCount()>0)
{
features=layer.AllFeatures();
fea =features.Item(1);
layer.DeleteFeature(fea);
layer.Refresh();
}
}
else
{
CMapXLayer lyr = m_map1.GetLayers().CreateLayer("tempLayer");//第一个是临时图层名字,第二个是存储的图层名字
m_map1.GetLayers().SetAnimationLayer(lyr); //设为动态图层
}
// m_map1.GetLayers().Remove("tempLayer");
//设置地图的中心
m_map1.SetCenterX(xcoordinate);
m_map1.SetCenterY(ycoordinate);
CMapXLayer Layer=m_map1.GetLayers().Item("tempLayer");
FeaFac=m_map1.GetFeatureFactory();
CMapXStyle style;
style.CreateDispatch(style.GetClsid());
//设置样式点风格。(节点式)
//style.SetSymbolType(miSymbolTypeVector); //设置点的显示方式为一些向量
// style.SetSymbolCharacter(39);//设置显示的符号。
//style.SetSymbolVectorSize(10);//设置符号大小。
//style.SetSymbolVectorColor(RGB(0,255,0));//设置符号颜色。
style.SetSymbolType(miSymbolTypeBitmap); //设置点的显示方式为bit格式的图
style.SetSymbolBitmapName("TOWE1-32.BMP") ;
style.SetSymbolBitmapSize(15);
VARIANT varStyle;
varStyle.vt = VT_DISPATCH;
varStyle.pdispVal = style.m_lpDispatch;
//设置MapX不进行自动更新
m_map1.SetAutoRedraw(FALSE);
//设置图层可写
Layer.SetEditable(TRUE);
double current = xcoordinate;
long currTime = GetTickCount();
long oldTime = currTime;
try
{
CMapXPoint point;
point.CreateDispatch(point.GetClsid());
point.Set(current, ycoordinate);
VARIANT varPoint;
varPoint.vt = VT_DISPATCH;
varPoint.pdispVal = point.m_lpDispatch;
CMapXFeature feature = FeaFac.CreateSymbol(varPoint, varStyle);
Layer.AddFeature(feature); //加入Feature