当前位置:软件学习 > 其它软件 >>

添加图元函数调用问题

在图层中添加图元(C#+MapXtreme 6.6) 
在图层中插入图元是MapXtreme中经常使用的,我这里编写了一个函数,实现向某一图层中插入图元的方法:

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);
        }
    }

参数:

g:图元的几何属性

map:工作地图

layerName:工作图层,向该图层中添加图元

shapeCode:图元的形状码

col:图元颜色

size:图元大小

这样,当图元插入图层后,就可以在地图中显示出来,代码已经在.Nt2005中测试过。至于形状码,可以查看相关资料(实心五角星:35)。
 
请问我已有经纬度,表名,要怎么调用此函数呢????
--------------------编程问答-------------------- 你这个函数哪有经纬度? --------------------编程问答-------------------- 貌似不用经纬度啊。。传入要求的参数就可以了吧。。
补充:企业软件 ,  地理信息系统
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,