示例#1
0
        protected override void InitDiagram()
        {
            base.InitDiagram();

            // Configure the document
            NDrawing drawing = m_DrawingDocument.Content;

            drawing.ScreenVisibility.ShowGrid = false;

            // Add styles
            AddStyles(m_DrawingDocument);

            // Configure the active page
            NPage page = drawing.ActivePage;

            page.Bounds         = new NRectangle(0, 0, 10000, 10000);
            page.ZoomMode       = ENZoomMode.Fit;
            page.BackgroundFill = new NColorFill(NColor.LightBlue);

            // Create a map importer
            NEsriMapImporter mapImporter = new NEsriMapImporter();

            mapImporter.MapBounds = NMapBounds.World;

            // Add an ESRI shapefile
            NEsriShapefile countries = new NEsriShapefile(Nevron.Nov.Diagram.NResources.RBIN_countries_zip);

            countries.NameColumn         = "name_long";
            countries.TextColumn         = "name_long";
            countries.MinTextZoomPercent = 50;
            countries.FillRule           = new NMapFillRuleValue("mapcolor8", Colors);
            mapImporter.AddShapefile(countries);

            // Read the map data
            mapImporter.Read();

            // Import the map to the drawing document
            mapImporter.Import(m_DrawingDocument, page.Bounds);

            // Size page to content
            page.SizeToContent();
        }
        protected override void InitDiagram()
        {
            base.InitDiagram();

            // Configure the document
            NDrawing drawing = m_DrawingDocument.Content;

            drawing.ScreenVisibility.ShowGrid = false;

            // Add styles
            AddStyles(m_DrawingDocument);

            // Configure the active page
            NPage page = drawing.ActivePage;

            page.ZoomMode       = ENZoomMode.Fit;
            page.BackgroundFill = new NColorFill(NColor.LightBlue);

            // Create a map importer
            m_MapImporter           = new NEsriMapImporter();
            m_MapImporter.MapBounds = NMapBounds.World;

            // Add a shapefile
            NEsriShapefile countries = new NEsriShapefile(Nevron.Nov.Diagram.NResources.RBIN_countries_zip);

            countries.NameColumn         = "name_long";
            countries.TextColumn         = "name_long";
            countries.MinTextZoomPercent = 50;
            countries.FillRule           = new NMapFillRuleRange("pop_est", NColor.White, new NColor(0, 80, 0), 12);
            m_MapImporter.AddShapefile(countries);

            // Set the shape created listener
            m_MapImporter.ShapeCreatedListener = new NCustomShapeCreatedListener();

            // Read the map data
            m_MapImporter.Read();

            // Import the map to the drawing document
            ImportMap();
        }
        protected override void InitDiagram()
        {
            base.InitDiagram();

            // Configure the document
            NDrawing drawing = m_DrawingDocument.Content;

            drawing.ScreenVisibility.ShowGrid = false;

            // Add styles
            AddStyles(m_DrawingDocument);

            // Configure the active page
            NPage page = drawing.ActivePage;

            page.BackgroundFill = new NColorFill(NColor.LightBlue);
            page.Bounds         = new NRectangle(0, 0, 10000, 10000);
            page.ZoomMode       = ENZoomMode.Fit;

            // Create a map importer
            m_MapImporter           = new NEsriMapImporter();
            m_MapImporter.MapBounds = NMapBounds.World;

            m_MapImporter.MeridianSettings.RenderMode = ENArcRenderMode.BelowObjects;
            m_MapImporter.ParallelSettings.RenderMode = ENArcRenderMode.BelowObjects;
            m_MapImporter.Projection = m_Projections[DefaultProjectionIndex];

            // Add an ESRI shapefile
            NEsriShapefile countries = new NEsriShapefile(Nevron.Nov.Diagram.NResources.RBIN_countries_zip);

            countries.NameColumn = "name_long";
            countries.FillRule   = new NMapFillRuleValue("mapcolor8", Colors);
            m_MapImporter.AddShapefile(countries);

            // Read the map data
            m_MapImporter.Read();

            ImportMap();
        }