当前位置: 首页>>代码示例>>C#>>正文


C# MapControl.Refresh方法代码示例

本文整理汇总了C#中MapControl.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# MapControl.Refresh方法的具体用法?C# MapControl.Refresh怎么用?C# MapControl.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MapControl的用法示例。


在下文中一共展示了MapControl.Refresh方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NewNodeToolShouldWorkWithoutSnapRules

        public void NewNodeToolShouldWorkWithoutSnapRules()
        {
            // Create map and map control
            Map map = new Map();
            var nodeList = new List<Node>();

            var nodeLayer = new VectorLayer
                {
                    DataSource = new FeatureCollection(nodeList, typeof (Node)),
                    Visible = true,
                    Style = new VectorStyle
                        {
                            Fill = new SolidBrush(Color.Tomato),
                            Symbol = null,
                            Line = new Pen(Color.Turquoise, 3)
                        }
                };
            map.Layers.Add(nodeLayer);

            var mapControl = new MapControl {Map = map};
            mapControl.Resize += delegate { mapControl.Refresh(); };
            mapControl.Dock = DockStyle.Fill;

            var newNodeTool = new NewNetworkFeatureTool(l => true, "new node");
            mapControl.Tools.Add(newNodeTool);

            var args = new MouseEventArgs(MouseButtons.Left, 1, -1, -1, -1);

            newNodeTool.OnMouseDown(new Coordinate(0, 20), args);
            newNodeTool.OnMouseMove(new Coordinate(0, 20), args);
            newNodeTool.OnMouseUp(new Coordinate(0, 20), args);

            Assert.IsFalse(newNodeTool.IsBusy);
            Assert.AreEqual(1, nodeList.Count);
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:35,代码来源:NewNetworkFeatureToolTest.cs

示例2: MapTestHelper

        public MapTestHelper()
        {
            MapControl = new MapControl();
            MapControl.Dock = DockStyle.Fill;
            // disable dragdrop because it breaks the test runtime
            MapControl.AllowDrop = false;
            
            
            Controls.Add(MapControl);

            coordinateLabel = new Label();
            coordinateLabel.Width = 500;
            coordinateLabel.Location = new Point(5, 5);

            MapControl.Controls.Add(coordinateLabel);
            MapControl.Resize += delegate { MapControl.Refresh(); };
            MapControl.ActivateTool(MapControl.PanZoomTool);

            MapControl.ActivateTool(MapControl.SelectTool);
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:20,代码来源:MapTestHelper.cs

示例3: InitializeControls

        private void InitializeControls()
        {
            geometryEditorForm = new Form();
            // Create map and map control
            Map map = new Map();

            mapControl = new MapControl {Map = map};
            mapControl.Resize += delegate { mapControl.Refresh(); };
            mapControl.ActivateTool(mapControl.PanZoomTool);
            mapControl.Dock = DockStyle.Fill;
            // disable dragdrop because it breaks the test runtime
            mapControl.AllowDrop = false;

            // Create listbox to show all registered tools
            listBoxTools = new ListBox {Dock = DockStyle.Left};
            listBoxTools.SelectedIndexChanged += listBoxTools_SelectedIndexChanged;

            map.ZoomToExtents();

            mapControl.MoveTool.FallOffPolicy = FallOffPolicyRule.Linear;

            geometryEditorForm.Controls.Add(listBoxTools);
            geometryEditorForm.Controls.Add(mapControl);
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:24,代码来源:NewLineToolTest.cs

示例4: RenderSymbol

        public void RenderSymbol()
        {
            VectorLayer layer = new VectorLayer();
            layer.DataSource = new DataTableFeatureProvider("LINESTRING(20 20,40 40)");

            VectorLayer symbolLayer = new VectorLayer("GPS");
            symbolLayer.DataSource = new DataTableFeatureProvider("POINT(30 30)");
            symbolLayer.Style.Symbol = Properties.Resources.NorthArrow;
            symbolLayer.Style.SymbolRotation = 0;
            symbolLayer.Style.SymbolOffset = new PointF(0, 0);
            symbolLayer.Style.SymbolScale = 0.5f;

            //Show layer on form with mapcontrol
            Form form = new Form();
            MapControl mapControl = new MapControl();
            mapControl.Dock = DockStyle.Fill;
            form.Controls.Add(mapControl);
            mapControl.Map = new Map(new Size(600, 600));

            mapControl.Map.Layers.Add(symbolLayer);
            mapControl.Map.Layers.Add(layer);

            form.Show();
            mapControl.Map.ZoomToExtents();
            mapControl.Refresh();
            form.Hide();

            WindowsFormsTestHelper.ShowModal(form);
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:29,代码来源:VectorLayerTest.cs


注:本文中的MapControl.Refresh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。