当前位置:编程学习 > C#/ASP.NET >>

求sharpmap高手,怎么根据属性把地图分级颜色填充啊

怎么根据属性把地图分级颜色填充啊?还有sharpmap可以读取shapefile的dbf文件并且修改属性值吗? 地图 sharpmap  gis --------------------编程问答-------------------- private static SharpMap.Styles.VectorStyle GetMyStyle(SharpMap.Data.FeatureDataRow row)
    {
        SharpMap.Styles.VectorStyle style = new SharpMap.Styles.VectorStyle();
        switch (row["TND"].ToString().ToLower())
        {
            case "5023": //If status is interred, fill it with yellow
                style.Fill = Brushes.Green;
                return style;
            case "1023":
                style.Fill = new SolidBrush(Color.FromArgb(180, 178, 178));
                return style;
            case "5213":
                style.Fill = new SolidBrush(Color.FromArgb(178, 255, 178));
                return style;
            case "6103":
                style.Fill = new SolidBrush(Color.FromArgb(102, 178, 255));
                return style;
            case "3003":
                style.Fill = new SolidBrush(Color.FromArgb(255, 255, 178));
                return style;
        }
        return style;
    }

    public static Map LoadMapByOracle(Size size) 
    {
        Map map = new Map(size);
        SharpMap.Rendering.Thematics.CustomTheme iTheme = new SharpMap.Rendering.Thematics.CustomTheme(GetMyStyle);

        //底图层加载
        VectorLayer layBascov = new VectorLayer("Bascov");
        layBascov.DataSource = new SharpMap.Data.Providers.Oracle("us_china_lize", "us_china_lize", "10.250.3.170", "V0#GENE_BASCOV", "SHAPE", "OBJECT_ID");
        layBascov.Style.Outline = Pens.Black;
        layBascov.Style.EnableOutline = true;
        layBascov.Theme = iTheme;
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,