ArcGis实现添加MultiLayerMarkerSymbol(多个符号叠加生成新的符号)

private  void axMapControl1_OnMouseDown( object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
        {
             // 产生一个简单符号
            ISimpleMarkerSymbol pMarkerSymbol =  new SimpleMarkerSymbolClass();
            pMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCross;
            pMarkerSymbol.Color = GetRGBColor( 6010050);
            pMarkerSymbol.Angle =  60;
            pMarkerSymbol.XOffset =  10; // 符号偏移鼠标点击点横坐标的距离
            pMarkerSymbol.YOffset =  10; // 符号偏移鼠标点击点纵坐标的距离
            
// 产生一个箭头符号
            IArrowMarkerSymbol pArrowMarker =  new ArrowMarkerSymbolClass();
            pArrowMarker.Length =  5; // 箭头的顶点到底边的距离
            pArrowMarker.Width =  10; // 箭头的底边的宽度
            pArrowMarker.Color = GetRGBColor( 06090);
            pArrowMarker.XOffset = - 10;
            pArrowMarker.YOffset = - 10;
             // 产生一个叠加符号并把前面的符号加入
            IMultiLayerMarkerSymbol pMulMarker =  new MultiLayerMarkerSymbolClass();
            pMulMarker.AddLayer(pArrowMarker);
            pMulMarker.AddLayer(pMarkerSymbol);
            IPoint pPoint =  new PointClass();
            pPoint.PutCoords(e.mapX, e.mapY);
             object o = ( object)pMulMarker;
            axMapControl1.DrawShape(pPoint,  ref o);
        }
         private IRgbColor GetRGBColor( int red,  int green,  int blue)
        {
            IRgbColor pRgbColor =  new RgbColorClass();
            pRgbColor.Red = red;
            pRgbColor.Green = green;
            pRgbColor.Blue = blue;
             return pRgbColor;
        }

from:http://blog.sina.com.cn/s/blog_71d88f280100mj5z.html 

你可能感兴趣的:(arcgis)