private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            // If the user cancels the toolbar, clear up the draw object and uninstall this
            // toolbar.
            if (_drawObject != null)
            {
                _drawObject.IsEnabled     = false;
                _drawObject.DrawComplete -= DrawComplete;
                _mapWidget.Map.KeyDown   -= Map_KeyDown;
            }

            _mapWidget.SetToolbar(null);
        }
        /// <summary>
        /// OnActivated is called when the toolbar is installed into the map widget.
        /// </summary>
        public void OnActivated()
        {
            if (ResourceLayers == null || ResourceLayers.Count == 0)
            {
                System.Windows.Forms.MessageBox.Show("You have to configure this tool first!");
                clearTheMap();

                // When the user is finished with the toolbar, revert to the configured toolbar.
                if (_mapWidget != null)
                {
                    _mapWidget.SetToolbar(null);
                }
            }
        }
예제 #3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            // When the user clicks the map tool button, begin installing zoom code.
            // Ensure the tool has a valid map to work with.
            if (ResourcesDatasource == null)
            {
                return;
            }

            if (MapWidget != null && MapWidget.Map != null && ResourcesDatasource != null && ResourceTypeField != null && BarriersDataSources != null)
            {
                // Provide a way for the user to cancel the operation, by installing a temporary toolbar.
                // This also prevents other tools from being used in the meantime.
                _findClosestResourceToolbar = new FindClosestResourceToolbar(MapWidget, ResourcesDatasource, ResourceTypeField, BarriersDataSources);
                MapWidget.SetToolbar(_findClosestResourceToolbar);
            }
            else
            {
                MessageBox.Show("Please configure this tool first!", "Error");
                return;
            }

            // Set the Checked property of the ToggleButton to false after work is complete.
            ToggleButton.IsChecked = false;
        }
예제 #4
0
 /// <summary>
 /// Finished with the toolbar, revert to the default toolbar.
 /// </summary>
 private void Done_Click(object sender, RoutedEventArgs e)
 {
     if (_mapWidget != null)
     {
         _mapWidget.SetToolbar(null);
     }
 }
        //Save edits when clicked
        private void DoneButton_Click(object sender, RoutedEventArgs e)
        {
            //Populate attributes and save only if the graphic was drawn correctly
            if (NewSearchArea != null)
            {
                //Fill out the attributes of the new search area with user's input
                object        attribute;
                List <string> attributeNames = new List <string>(NewSearchArea.Attributes.Keys);
                foreach (string attributeName in attributeNames)
                {
                    if (SearchAreaAttributes.TryGetValue(attributeName, out attribute))
                    {
                        NewSearchArea.Attributes[attributeName] = attribute;
                    }
                }

                //Save the new search area
                SearchAreaLayer.SaveEdits();
            }

            // When the user is finished with the toolbar, revert to the configured toolbar.
            if (MapWidget != null)
            {
                MapWidget.SetToolbar(null);
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            MapWidget.SetToolbar(new BufferMapToolBar(MapWidget, BufferDataSource, Field));

            // Set the Checked property of the ToggleButton to false after work is complete.
            ToggleButton.IsChecked = false;
        }
예제 #7
0
        /// <summary>
        /// Provides the behaviour when the user clicks the map tool.
        /// </summary>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            // Install a custom toolbar
            MapWidget.SetToolbar(new FlickrMapToolbar(MapWidget));

            // Set the Checked property of the ToggleButton to false after work is complete.
            ToggleButton.IsChecked = false;
        }
예제 #8
0
 /// <summary>
 /// Provides the behaviour when the user clicks the map tool.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if ((MapWidget != null) && (MapWidget.Map != null))
     {
         _gccToolbar = new GroundCommCovToolbar(MapWidget, ServiceURL);
         MapWidget.SetToolbar(_gccToolbar);
     }
 }
 /// <summary>
 /// Provides the behaviour when the user clicks the map tool.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if ((MapWidget != null) && (MapWidget.Map != null))
     {
         _accToolbar = new AircraftCoverageToolbar(MapWidget, ServiceURL);
         MapWidget.SetToolbar(_accToolbar);
     }
 }
 /// <summary>
 /// Provides the behaviour when the user clicks the map tool.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if ((MapWidget != null) && (MapWidget.Map != null))
     {
         _segToolbar = new SatelliteEphemerisGenerationToolbar(MapWidget, ServiceURL);
         MapWidget.SetToolbar(_segToolbar);
     }
 }
        /// <summary>
        /// Provides the behaviour when the user clicks the map tool.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            // Provide map tool behaviour, for example, add mouse handling to the Map,
            // or install a custom toolbar using MapWidget.SetToolbar
            MapWidget.SetToolbar(new SketchToolbar(MapWidget));

            // Set the Checked property of the ToggleButton to false after work is complete.
            ToggleButton.IsChecked = false;
        }
예제 #12
0
        private void DoneButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                RunButton.IsEnabled = false;

                // When the user is finished with the toolbar, revert to the configured toolbar.
                if (_mapWidget != null)
                {
                    _mapWidget.Map.MouseClick -= Map_MouseClick;
                    _mapWidget.SetToolbar(null);
                }
                int id  = -1;
                int id2 = -1;
                for (int i = 0; i < _mapWidget.Map.Layers.Count; i++)
                {
                    client.Layer player = _mapWidget.Map.Layers[i];

                    if (player.ID == "AircraftCommunicationCoverageMap")
                    {
                        id = i;
                    }
                    if (player.ID == "AircraftCommunicationGraphics")
                    {
                        id2 = i;
                    }
                }
                if (id != -1)
                {
                    _mapWidget.Map.Layers.RemoveAt(id);
                }

                if (id2 != -1)
                {
                    _mapWidget.Map.Layers.RemoveAt(id2 - 1);
                }

                if (_graphicsLayer != null)
                {
                    _graphicsLayer.Graphics.Clear();
                }

                if (pWin != null)
                {
                    pWin.Close();
                }

                if (_dtLegends != null)
                {
                    _dtLegends.Clear();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }
예제 #13
0
 // ***********************************************************************************
 // * ...User is done using the map tool. close the dialog.
 // ***********************************************************************************
 private void DoneButton_Click(object sender, RoutedEventArgs e)
 {
     clearMapToolParameters();
     // When the user is finished with the toolbar, revert to the configured toolbar.
     if (_mapWidget != null)
     {
         _mapWidget.SetToolbar(null);
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     // When the user clicks the map tool button, begin installing zoom code.
     // Ensure the tool has a valid map to work with.
     if ((MapWidget != null) && (MapWidget.Map != null))
     {
         // Provide a way for the user to cancel the operation, by installing a temporary toolbar.
         // This also prevents other tools from being used in the meantime.
         _cancelToolbar = new CancelationToolbar(MapWidget);
         MapWidget.SetToolbar(_cancelToolbar);
     }
 }
예제 #15
0
        /// <summary>
        /// Provides the behaviour when the user clicks the map tool.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            // Provide map tool behaviour, for example, add mouse handling to the Map,
            // or install a custom toolbar using MapWidget.SetToolbar
            // MapWidget.SetToolbar(new MyMapToolbar(MapWidget));

            // Set the Checked property of the ToggleButton to false after work is complete.
            if ((MapWidget != null) && (MapWidget.Map != null))
            {
                _bombToolbar = new BombThreatToolbar(MapWidget);
                MapWidget.SetToolbar(_bombToolbar);
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            // Provide map tool behaviour, for example, add mouse handling to the Map,
            // or install a custom toolbar using MapWidget.SetToolbar

            if ((MapWidget != null) && (MapWidget.Map != null))
            {
                _ergChemicalToolbar = new ERGChemicalMapToolbar(MapWidget, ERGChemicalURL, ERGPlacardURL, FindNearestWSURL,
                                                                WindDirectionLayerDataSource, WindDirectionFieldName, WindWeatherStationFieldName, WindRecordedDateFieldName, DefaultERGChemicalName, DefaultPlacardName);

                MapWidget.SetToolbar(_ergChemicalToolbar);
            }
            // Set the Checked property of the ToggleButton to false after work is complete.
            ToggleButton.IsChecked = false;
        }
        /// <summary>
        /// Show the draw polygon toolbar when the tool is clicked
        /// </summary>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //Show the draw polygon toolbar if the search area layer is not null
            if (searchAreaLayer == null)
            {
                MessageBox.Show("Search area layer is invalid. Make sure the map has a polygon layer");
            }
            else
            {
                MapWidget.SetToolbar(new DrawPolygonToolbar(MapWidget, searchAreaLayer));
            }

            // Set the Checked property of the ToggleButton to false after work is complete.
            ToggleButton.IsChecked = false;
        }
예제 #18
0
 private void DoneButton_Click(object sender, RoutedEventArgs e)
 {
     // When the user is finished with the toolbar, revert to the configured toolbar.
     if (_mapWidget != null)
     {
         _mapWidget.Map.MouseClick -= Map_MouseClick;
         _mapWidget.SetToolbar(null);
         if (_graphicsLayer != null)
         {
             _graphicsLayer.Graphics.Clear();
         }
         client.GraphicsLayer gLayer = _mapWidget.Map.Layers["ComputedLine"] as client.GraphicsLayer;
         if (gLayer != null)
         {
             gLayer.Graphics.Clear();
         }
         RunButton.IsEnabled = false;
     }
 }
예제 #19
0
 private void DoneButton_Click(object sender, RoutedEventArgs e)
 {
     // When the user is finished with the toolbar, revert to the configured toolbar.
     if (_mapWidget != null)
     {
         _mapWidget.Map.MouseClick -= Map_MouseClick;
         _mapWidget.SetToolbar(null);
         if (_graphicsLayerPoly != null)
         {
             _graphicsLayerPoly.Graphics.Clear();
         }
         if (_graphicsLayerLine != null)
         {
             _graphicsLayerLine.Graphics.Clear();
         }
         if (_graphicsLayerPoint != null)
         {
             _graphicsLayerPoint.Graphics.Clear();
         }
     }
 }
예제 #20
0
        private void DoneButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (_graphicsLayer != null)
                {
                    _graphicsLayer.Graphics.Clear();
                }

                // Find the map layer in the map widget that contains the data source.
                IEnumerable <ESRI.ArcGIS.OperationsDashboard.DataSource> dataSources = OperationsDashboard.Instance.DataSources;
                foreach (ESRI.ArcGIS.OperationsDashboard.DataSource d in dataSources)
                {
                    if (_mapWidget != null && d.IsSelectable == true)
                    {
                        // Get the feature layer in the map for the data source.
                        client.FeatureLayer featureL = _mapWidget.FindFeatureLayer(d);

                        //Clear Selection on Feature Layers in map
                        featureL.ClearSelection();
                    }
                }
                location            = null;
                RunButton.IsEnabled = false;
                txtAddress.Text     = "Enter Address";

                if (_mapWidget != null)
                {
                    _mapWidget.Map.MouseClick -= Map_MouseClick;
                    _mapWidget.SetToolbar(null);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }
 private void btnBack_Click(object sender, RoutedEventArgs e)
 {
     _mapWidget.SetToolbar(_closestFacilityToolbar);
 }