添加的图元显示不出来
我根据别人的经验写的,在某个图层上添加了一个图元,可就是显示不出来,还请大虾们多指点啊,我刚接触MapXTreme。我用的是MapXTreme 2005 +ASP.Net,开发的Web网站程序。源码如下:private MapInfo.Mapping.Map GetMapObj()
{
// Get the map
MapInfo.Mapping.Map myMap = MapInfo.Engine.Session.Current.MapFactory[MapControl1.MapAlias];
if (myMap == null)
{
myMap = MapInfo.Engine.Session.Current.MapFactory[0];
}
return myMap;
}
private void DrawFeature(FeatureGeometry g, Map map, string layerName, short shapeCode, System.Drawing.Color col, int size)
{
Feature f = new Feature(g, new MapInfo.Styles.SimpleVectorPointStyle(shapeCode, col, size));
MapInfo.Mapping.FeatureLayer workingLayer = (MapInfo.Mapping.FeatureLayer)map.Layers[layerName];
if (workingLayer != null)
{
workingLayer.Table.InsertFeature(f);
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Map map = GetMapObj();
CoordSys coordSys = map.GetDisplayCoordSys();
FeatureGeometry g = new MapInfo.Geometry.Point(coordSys, map.Center.x / 2, map.Center.y / 2);
DrawFeature(g, map, "旅游风景区", 40, System.Drawing.Color.Red, 14);
}
--------------------编程问答-------------------- 没接触过,帮顶! --------------------编程问答-------------------- 俺也是第一次接触,关注一下,学习…… --------------------编程问答-------------------- 学习,帮顶了, 不会 --------------------编程问答-------------------- 没接触
不知道啥问题 --------------------编程问答-------------------- MapXTreme是什么?这个好像不是VS中的呀,第三方开发工具呀。
LZ问错地方了吧
补充:.NET技术 , ASP.NET