// ***********************************************************************************
        // * Add barrier lines on the map. This will be taken into a consideration
        // * when the closest facilities are being determined
        // ***********************************************************************************
        private void btnAddBarrier_Click(object sender, RoutedEventArgs e)
        {
            _mapWidget.Map.MouseClick -= Map_MouseClick;

            if (_polylineBarriersGraphicLayer.Graphics.Count > 0)
            {
                _polylineBarriersGraphicLayer.Graphics.Clear();
            }

            // Set up the DrawObject with a draw mode and symbol ready for use when a user chooses it.
            if ((_mapWidget != null) && (_mapWidget.Map != null))
            {
                _drawObject = new client.Draw(_mapWidget.Map)
                {
                    DrawMode   = client.DrawMode.Polyline,
                    LineSymbol = _polylineBarrierSymbol //(LineSymbol)this.FindResource("routeSymbol")
                };
            }

            _drawObject.IsEnabled     = true;
            _drawObject.DrawComplete += DrawComplete;
        }
        public void OnActivated()
        {
            // Set up the DrawObject with a draw mode and symbol ready for use when a user chooses it.
              if ((_mapWidget != null) && (_mapWidget.Map != null))
              {
            _drawObject = new client.Draw(_mapWidget.Map)
            {
              DrawMode = client.DrawMode.Rectangle,
              FillSymbol = new client.Symbols.FillSymbol()
              {
            Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0)),
            BorderBrush = System.Windows.Media.Brushes.DarkGray,
            BorderThickness = 1
              },
            };
              }

              // Install a draw handler on the Map to handle the next action of the user - dragging
              // a rectangle on the map.
              _drawObject.IsEnabled = true;
              _drawObject.DrawComplete += DrawComplete;
              _mapWidget.Map.KeyDown += Map_KeyDown;
        }
        public void OnActivated()
        {
            // Set up the DrawObject with a draw mode and symbol ready for use when a user chooses it.
            if ((_mapWidget != null) && (_mapWidget.Map != null))
            {
                _drawObject = new client.Draw(_mapWidget.Map)
                {
                    DrawMode   = client.DrawMode.Rectangle,
                    FillSymbol = new client.Symbols.FillSymbol()
                    {
                        Fill            = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0)),
                        BorderBrush     = System.Windows.Media.Brushes.DarkGray,
                        BorderThickness = 1
                    },
                };
            }

            // Install a draw handler on the Map to handle the next action of the user - dragging
            // a rectangle on the map.
            _drawObject.IsEnabled     = true;
            _drawObject.DrawComplete += DrawComplete;
            _mapWidget.Map.KeyDown   += Map_KeyDown;
        }
Beispiel #4
0
        private void CreateAreaButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (_mapWidget != null)
                {
                    _mapWidget.Map.MouseClick -= Map_MouseClick;
                }

                targetAreaDraw = new client.Draw(_mapWidget.Map);
                ResourceDictionary mydictionary = new ResourceDictionary();
                mydictionary.Source = new Uri("/AircraftCommunicationCoverageAddin;component/SymbolDictionary.xaml", UriKind.RelativeOrAbsolute);

                targetAreaDraw.FillSymbol    = mydictionary["BasicFillSymbol_Yellow_Trans_6"] as client.Symbols.SimpleFillSymbol;
                targetAreaDraw.DrawMode      = client.DrawMode.Polygon;
                targetAreaDraw.IsEnabled     = true;
                targetAreaDraw.DrawComplete += targetAreaDraw_DrawComplete;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in create area: " + ex.Message);
            }
        }
        // ***********************************************************************************
        // * Add barrier lines on the map. This will be taken into a consideration 
        // * when the closest facilities are being determined
        // ***********************************************************************************
        private void btnAddBarrier_Click(object sender, RoutedEventArgs e)
        {
            _mapWidget.Map.MouseClick -= Map_MouseClick;

            if (_polylineBarriersGraphicLayer.Graphics.Count > 0)
                _polylineBarriersGraphicLayer.Graphics.Clear();

            // Set up the DrawObject with a draw mode and symbol ready for use when a user chooses it.
            if ((_mapWidget != null) && (_mapWidget.Map != null))
            {
                _drawObject = new client.Draw(_mapWidget.Map)
                {
                    DrawMode = client.DrawMode.Polyline,
                    LineSymbol = _polylineBarrierSymbol //(LineSymbol)this.FindResource("routeSymbol")
                };
            }

            _drawObject.IsEnabled = true;
            _drawObject.DrawComplete += DrawComplete;
        }
        private void CreateAreaButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (_mapWidget != null)
                {
                    _mapWidget.Map.MouseClick -= Map_MouseClick;
                }

                targetAreaDraw = new client.Draw(_mapWidget.Map);
                ResourceDictionary mydictionary = new ResourceDictionary();
                mydictionary.Source = new Uri("/AircraftCommunicationCoverageAddin;component/SymbolDictionary.xaml", UriKind.RelativeOrAbsolute);

                targetAreaDraw.FillSymbol = mydictionary["BasicFillSymbol_Yellow_Trans_6"] as client.Symbols.SimpleFillSymbol;
                targetAreaDraw.DrawMode = client.DrawMode.Polygon;
                targetAreaDraw.IsEnabled = true;
                targetAreaDraw.DrawComplete += targetAreaDraw_DrawComplete;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in create area: " + ex.Message);
            }
        }