mapinfo中怎样在现有的图层上添加新的点
如果我只有这个点的地址 --------------------编程问答-------------------- 在图层管理器中将图层设为可编辑然后加点就行
如果点多,可以采用mapx编程实现 --------------------编程问答-------------------- 如果知道该点的坐标,mapinfo中有专门的工具来生成点,create point~~~ --------------------编程问答--------------------
CMapXFeatureFactory FeaFac;
CMapXFeature Feature;
CMapXStyle Style;
m_map1.SetCenterX(xcoordinate);
m_map1.SetCenterY(ycoordinate);
CMapXLayer lyr = m_map1.GetLayers().CreateLayer("tempLayer");//第一个是临时图层名字,第二个是存储的图层名字
m_map1.GetLayers().SetAnimationLayer(lyr); //设为动态图层
CMapXLayer Layer=m_map1.GetLayers().Item("tempLayer");
FeaFac=m_map1.GetFeatureFactory();
CMapXStyle style;
style.CreateDispatch(style.GetClsid());
VARIANT varStyle;
varStyle.vt = VT_DISPATCH;
varStyle.pdispVal = style.m_lpDispatch;
//设置MapX不进行自动更新
m_map1.SetAutoRedraw(FALSE);
//设置图层可写
Layer.SetEditable(TRUE);
CMapXPoint point;
point.CreateDispatch(point.GetClsid());
point.Set(xcoordinate, ycoordinate);
VARIANT varPoint;
varPoint.vt = VT_DISPATCH;
varPoint.pdispVal = point.m_lpDispatch;
CMapXFeature feature = FeaFac.CreatePoint(varPoint, varStyle);
Layer.AddFeature(feature); //加入Feature
Layer.Refresh(); //更新图层
//设置MapX进行自动更新
m_map1.SetAutoRedraw(TRUE);
//设置图层不可写
Layer.SetEditable(FALSE);
我手写的代码。不会的话加qq:327343772
补充:企业软件 , 地理信息系统