登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
- private void LoadLayers()
- {
- layersLegend1.ActiveMapFrame.MapView.LockViewUpdate = true;
- //市区界
- string aFile = Application.StartupPath + @"\Shp\NT_Dist.shp";
- MapLayer aLayer = MapDataManage.OpenLayer(aFile);
-
- aLayer.LegendScheme.breakList[0].Color = Color.WhiteSmoke;
- layersLegend1.ActiveMapFrame.AddLayer(aLayer);
- //乡镇界
- aFile = Application.StartupPath + @"\Shp\NT_County.shp";
- aLayer = MapDataManage.OpenLayer(aFile);
- //aLayer.TransparencyPerc = 1;
- //aLayer.LegendScheme.breakList[0].Color = Color.Aqua;
- //((PolyLineBreak)aLayer.LegendScheme.breakList[0]).Size = 2;
-
- layersLegend1.ActiveMapFrame.AddLayer(aLayer);
- //乡镇名
- aFile = Application.StartupPath + @"\Shp\NT_res3.shp";
- aLayer = MapDataManage.OpenLayer(aFile);
- ((PointBreak)aLayer.LegendScheme.breakList[0]).Color = Color.Red;
- aLayer.Expanded = true;
- layersLegend1.ActiveMapFrame.AddLayer(aLayer);
- //Label city name
- VectorLayer cityLayer = (VectorLayer)aLayer;
- cityLayer.LabelSet.FieldName = "NAME";
- cityLayer.LabelSet.AvoidCollision = true;
- cityLayer.LabelSet.LabelAlignType = MeteoInfoC.Legend.AlignType.Center;
- cityLayer.LabelSet.XOffset = 0;
- cityLayer.LabelSet.YOffset = 0;
- cityLayer.LabelSet.LabelFont = new Font("Arial", 8);
- cityLayer.LabelSet.LabelColor = Color.Red;
- cityLayer.LabelSet.DrawShadow = false;
- cityLayer.LabelSet.ShadowColor = Color.White;
- cityLayer.LabelSet.ColorByLegend = false;
- cityLayer.AddLabels();
- //Set layout map size
- mapLayout1.ActiveLayoutMap.Left = 40;
- mapLayout1.ActiveLayoutMap.Top = 40;
- mapLayout1.ActiveLayoutMap.Width = 600;
- mapLayout1.ActiveLayoutMap.Height = 400;
- //Refresh
- layersLegend1.ActiveMapFrame.MapView.LockViewUpdate = false;
- layersLegend1.ActiveMapFrame.MapView.ZoomToExtent(118, 122,30, 32);
- layersLegend1.Refresh();
- }
最近刚接触meteoinfo,水平比较菜,呵呵,试了半天,不知道如何在二次开发中修改某一图层线条的粗细?上面是加载图层的代码,如果想修改市区界NT_Dist.shp图层线条的粗细,如何编写代码?谢谢! |