日期:2014-05-18  浏览次数:20806 次

创建专题图及图例 (mapxtreme2008&C#)
    //创建专题图

                        IndividualValueTheme thm = new IndividualValueTheme(MyLayer, "某字段", "xx");
                        MyLayer.Modifiers.Append(thm);

                            //图例
                        FeatureLayer fl = new FeatureLayer(MapInfo.Engine.Session.Current.Catalog.GetTable("MyLayer"));
                        System.Drawing.Size size = new Size(300, 300);
                        MapInfo.Mapping.Legends.LegendFactory lfa = MainMap.Map.Legends;
                        MapInfo.Mapping.Legends.Legend legend = lfa.CreateLegend(size);
                        MapInfo.Mapping.Legends.LegendFrame fra =                                                                                                     MapInfo.Mapping.Legends.LegendFrameFactory.CreateThemeLegendFrame(thm);
                        legend.Frames.Append(fra);
                        legendControl1.Legend = legend;