Ejemplo n.º 1
0
        public MapObjects2.ClassBreaksRenderer GetClassBreaksRender(MapObjects2.MapLayer layer, string renderFieldName, int breaksCount, Color startColor, Color endColor)
        {
            MapObjects2.ClassBreaksRenderer oClassBreakRender = new MapObjects2.ClassBreaksRendererClass();

            if (layer.shapeType == ShapeTypeConstants.moShapeTypePoint)
                oClassBreakRender.SymbolType = SymbolTypeConstants.moPointSymbol;
            else if (layer.shapeType == ShapeTypeConstants.moShapeTypeLine)
                oClassBreakRender.SymbolType = SymbolTypeConstants.moLineSymbol;
            else if (layer.shapeType == ShapeTypeConstants.moShapeTypePolygon)
                oClassBreakRender.SymbolType = SymbolTypeConstants.moFillSymbol;

            oClassBreakRender.Field = renderFieldName;
            oClassBreakRender.BreakCount = (short)breaksCount;

            MapObjects2.Statistics oStatistic = layer.Records.CalculateStatistics(renderFieldName);
            double dInterval = (oStatistic.Max - oStatistic.Min) / breaksCount;

            for (short i = 0; i < breaksCount; i++)
            {
                oClassBreakRender.set_Break(i, oStatistic.Min + dInterval * i);
            }

            oClassBreakRender.RampColors((uint)Utilities.Converter.ConvertSystemtoIntegerColor(startColor), (uint)Utilities.Converter.ConvertSystemtoIntegerColor(endColor));

            return oClassBreakRender;
        }
Ejemplo n.º 2
0
        public MapObjects2.ClassBreaksRenderer GetClassBreaksRender(MapObjects2.MapLayer layer, string renderFieldName, int breaksCount, Color startColor, Color endColor)
        {
            MapObjects2.ClassBreaksRenderer oClassBreakRender = new MapObjects2.ClassBreaksRendererClass();

            if (layer.shapeType == ShapeTypeConstants.moShapeTypePoint)
            {
                oClassBreakRender.SymbolType = SymbolTypeConstants.moPointSymbol;
            }
            else if (layer.shapeType == ShapeTypeConstants.moShapeTypeLine)
            {
                oClassBreakRender.SymbolType = SymbolTypeConstants.moLineSymbol;
            }
            else if (layer.shapeType == ShapeTypeConstants.moShapeTypePolygon)
            {
                oClassBreakRender.SymbolType = SymbolTypeConstants.moFillSymbol;
            }

            oClassBreakRender.Field      = renderFieldName;
            oClassBreakRender.BreakCount = (short)breaksCount;

            MapObjects2.Statistics oStatistic = layer.Records.CalculateStatistics(renderFieldName);
            double dInterval = (oStatistic.Max - oStatistic.Min) / breaksCount;

            for (short i = 0; i < breaksCount; i++)
            {
                oClassBreakRender.set_Break(i, oStatistic.Min + dInterval * i);
            }

            oClassBreakRender.RampColors((uint)Utilities.Converter.ConvertSystemtoIntegerColor(startColor), (uint)Utilities.Converter.ConvertSystemtoIntegerColor(endColor));

            return(oClassBreakRender);
        }