b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

mapxtreme_mapxtreme最新版_基于mapxtreme的vs编程

电脑杂谈  发布时间:2017-01-23 20:02:22  来源:网络整理

mapxtreme_mapxtreme最新版_基于mapxtreme的vs编程

在图层中添加图元(C#+MapXtreme 6.6)猛学了一星期的MapXtreme,终于理清了头绪,任务终于可以较差了(狂喜中.......!)

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

private void DrawFeature(FeatureGeometry g, Map map, stringlayerName, short shapeCode, System.Drawing.Color col, intsize)

{

Feature f = new Feature(g, newMapInfo.Styles.SimpleVectorPointStyle(shapeCode, col, size));

MapInfo.Mapping.FeatureLayer workingLayer =(MapInfo.Mapping.FeatureLayer)map.Layers[layerName];

if (workingLayer != null)

{

workingLayer.Table.InsertFeature(f);

}

}

参数:

g:图元的几何属性

map:工作地图

mapxtreme_mapxtreme最新版_基于mapxtreme的vs编程

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

shapeCode:图元的形状码

col:图元颜色

size:图元大小

这样,当图元插入图层后,就可以在地图中显示出来,代码已经在.Nt2005中测试过。mapxtreme至于形状码,可以查看相关资料(实心五角星:35)。mapxtreme

Mapxtreme查看特定几个图层

假定让lyr1和lyr2两个图层充满整个地图窗口:

Table[] ts= new Table[2];

ts[0] = lyr1.Table;

ts[1] = lyr2.Table;

IMapLayerFilter iml =MapLayerFilterFactory.FilterByTable(ts);

MapLayerEnumerator mle =mapControl1.Map.Layers.GetMapLayerEnumerator(iml);

mapControl1.Map.SetView(mle);

基于mapxtreme的vs编程_mapxtreme_mapxtreme最新版

这里很多东西都是从别的网站收集的,比如jetz的blog含金量就很高,有些东西取自,致谢~

1.图层的显示:Layer.Enable = true/false;

2.图层的添加:

Catalog _catalog=MapInfo.Engine.Session.Current.Catalog;

MapInfo.Data.Table _tempTable=null;

Map _map=MapControl1.Map ;

TableInfo ti = TableInfoFactory.CreateTemp('临时');

_tempTable = _catalog.CreateTable(ti);

_map.Layers.Insert(0, new FeatureLayer(_tempTable));

3.图层的Selectable/Editable

WinApp&WebApp:

LayerHelper.SetSelectable( this.mapControl1.Map.Layers[0], true);

LayerHelper.SetEditable( this.mapControl1.Map.Layers[0], true);

WebApp:

mapControl1.SelectableLayers.add( mapControl1.Map.Layers[0].Alias);


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-28345-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...