private void btnGetAllFeatures_Click(object sender, EventArgs e)
        {
            string[] returningColumns = new string[] { "CNTRY_NAME", "CURR_TYPE", "RECID" };

            FeatureLayer worldLayer = winformsMap1.FindFeatureLayer("WorldLayer");

            worldLayer.Open();
            Collection <Feature> allFeaturs = worldLayer.FeatureSource.GetAllFeatures(returningColumns);

            worldLayer.Close();

            dgridFeatures.DataSource = (DataTable)FeatureSource.ConvertToDataTable(allFeaturs, returningColumns);
        }
        private void btnGetAllFeatures_Click(object sender, RoutedEventArgs e)
        {
            string[]     returningColumns = new string[] { "CNTRY_NAME", "CURR_TYPE", "RECID" };
            FeatureLayer worldLayer       = mapView.FindFeatureLayer("WorldLayer");

            worldLayer.Open();
            Collection <Feature> allFeaturs = worldLayer.FeatureSource.GetAllFeatures(returningColumns);

            worldLayer.Close();

            dgridFeatures.DataContext = (DataTable)FeatureSource.ConvertToDataTable(allFeaturs, returningColumns);
            dgridFeatures.SetBinding(ListView.ItemsSourceProperty, new Binding());
        }
        private void winformsMap1_MapClick(object sender, MapClickWinformsMapEventArgs e)
        {
            FeatureLayer worldLayer = winformsMap1.FindFeatureLayer("WorldLayer");

            worldLayer.Open();
            Collection <Feature> selectedFeatures = worldLayer.QueryTools.GetFeaturesContaining(e.WorldLocation, new string[2] {
                "CNTRY_NAME", "POP_CNTRY"
            });

            worldLayer.Close();

            if (selectedFeatures.Count > 0)
            {
                dgridFeatures.DataSource = (DataTable)FeatureSource.ConvertToDataTable(selectedFeatures, new string[] { "CNTRY_NAME", "POP_CNTRY" });
            }
        }
Exemplo n.º 4
0
        private void btnGetAllFeatures_Click(object sender, EventArgs e)
        {
            Collection <string> returningColumns = new Collection <string>();

            FeatureLayer wfsFeatureLayer = winformsMap1.FindFeatureLayer("WfsFeatureLayer");

            wfsFeatureLayer.Open();
            Collection <FeatureSourceColumn> columns = wfsFeatureLayer.FeatureSource.GetColumns();

            foreach (FeatureSourceColumn item in columns)
            {
                returningColumns.Add(item.ColumnName);
            }
            Collection <Feature> allFeaturs = wfsFeatureLayer.FeatureSource.GetAllFeatures(returningColumns);

            wfsFeatureLayer.Close();

            dgridFeatures.DataSource = (DataTable)FeatureSource.ConvertToDataTable(allFeaturs, returningColumns);
        }