Beispiel #1
0
        private void RouteControl_Load(object sender, EventArgs e)
        {
            // Init map.
            _mapControl = new MapUserControl(new VirtualEarthHybridSource())
            {
                Dock = DockStyle.Fill
            };
            panel1.Controls.Add(_mapControl);

            _map = _mapControl.Map;
            _map.Viewport.Zoom = 1;

            // Create layers.
            _cityLayer = new C1.Win.Map.VectorLayer();
            _cityLayer.LabelVisibility = LabelVisibility.Visible;
            _map.Layers.Add(_cityLayer);

            _routeLayer = new C1.Win.Map.VectorLayer();
            _routeLayer.Style.Stroke.Width = 2;
            _routeLayer.Style.Stroke.Color = Color.Red;
            _routeLayer.Opacity            = 0.6;

            _map.Layers.Add(_routeLayer);

            // Create routes.
            CreateRoutes();
        }
Beispiel #2
0
        private void MarkControl_Load(object sender, EventArgs e)
        {
            // Init map.
            _mapControl = new MapUserControl(new VirtualEarthAerialSource())
            {
                Dock = DockStyle.Fill
            };
            _panel.Controls.Add(_mapControl);

            _map = _mapControl.Map;
            _map.Viewport.Zoom = 1;

            // Create layer.
            _layer = new C1.Win.Map.VectorLayer();
            _map.Layers.Add(_layer);

            // Init table.
            _table.Clear();
            var columns = new List <KeyValuePair <string, string> >()
            {
                new KeyValuePair <string, string>("Number", "№"),
                new KeyValuePair <string, string>("longitude", "Longitude"),
                new KeyValuePair <string, string>("latitude", "Latitude")
            };

            _table.Columns.AddRange(columns.Select(x => new DataColumn()
            {
                ColumnName = x.Key
            }).ToArray());

            _grid.Columns.AddRange(columns.Select(x => new DataGridViewTextBoxColumn()
            {
                HeaderText       = x.Value,
                Width            = x.Key == "Number" ? 30 : 70,
                DataPropertyName = x.Key
            }).ToArray());

            _grid.DataSource = _table;

            // Create marks.
            CreateMarks();
        }