public SelectedFeaturesWindow(MgSelectionSet set) { InitializeComponent(); _set = set; cmbLayer.DataSource = _set.LayerNames; cmbLayer.SelectedIndex = 0; }
private void mgLayerSelectionHandler1_SelectionMade(MgSelectionSet selectedFeatures) { if (Array.IndexOf(selectedFeatures.LayerNames, "Parcels") >= 0) { MgFeature[] features = selectedFeatures.GetFeaturesForLayer("Parcels"); MessageBox.Show(features.Length + " parcels selected"); } }
private void btnListSelected_Click(object sender, EventArgs e) { // There's two ways to process a selection // // 1. Iterate through the layers of a MgSelectionSet and process // the feature reader for each layer // // 2. Use an MgSelectionSet helper class // // This example shows the 2nd way, which is the simpler one MgSelectionBase selection = _viewer.GetSelection(); MgMapViewerProvider provider = _viewer.GetProvider(); MgSelectionSet sset = new MgSelectionSet(selection); new SelectedFeaturesWindow(sset).ShowDialog(); }