- 积分
- 46
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-11-29
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2015-2-2 17:18:56
|
显示全部楼层
非常感谢楼主的指教,还有点不懂还望楼主不吝赐教,我按照上面脚本改成c#,代码
public VectorLayer addLary(Graphic g)
{
VectorLayer pLayer = new VectorLayer(ShapeTypes.Polygon);
pLayer.LayerName = "rrrr";
pLayer.Visible = true;
pLayer.EditAddField("ID", typeof(double));
layersLegend1.ActiveMapFrame.MapView.GraphicCollection.GraphicList.Add(g);
Graphic pGraphic = layersLegend1.ActiveMapFrame.MapView.GraphicCollection.GraphicList[0];
Shape pShape = pGraphic.Shape;
int shapeNum = pLayer.ShapeNum;
int i = 1;
if (pLayer.EditInsertShape(pShape, shapeNum))
{
pLayer.EditCellValue("ID", shapeNum, i);
}
i += 1;
pLayer.UpdateLegendScheme(LegendType.SingleSymbol, "ID");
PolygonBreak aPGB = (PolygonBreak)pLayer.LegendScheme.LegendBreaks[0];
aPGB.Color = Color.FromArgb(10, Color.Red);
layersLegend1.ActiveMapFrame.AddLayer(pLayer);
return pLayer;
}
在划线的方法里调用此方法却只能把第一个图形化成图层,剩余的却无法划出 |
|