示例#1
0
        public async void AddPoint()
        {
            // get a point from the user
            var mapPoint = await this.mapView.Editor.RequestPointAsync();

            // open the local geodatabase
            var gdb = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(this.GDB);

            // open the table and create a new feature using its schema
            FeatureTable gdbTable;

            foreach (FeatureTable table in gdb.FeatureTables)
            {
                gdbTable = table;

                var newFeature = new Esri.ArcGISRuntime.Data.GeodatabaseFeature(gdbTable.Schema);

                // assign the point from the user as the feature's geometry
                newFeature.Geometry = mapPoint;

                // get the attributes from the feature (a Dictionary<string, object>) and set some values
                var attributes = newFeature.Attributes;
                attributes["POST_ID"] = "123456";

                // add the new feature to the table, the OID of the new feature is returned
                var recNo = await gdbTable.AddAsync(newFeature);

                break;
            }


            await this.mapView.SetViewAsync(mapPoint, this.mapView.Scale + 1);
        }
            public async void AddPoint()
            {
                // get a point from the user
                var mapPoint = await this.mapView.Editor.RequestPointAsync();
                // open the local geodatabase
                var gdb = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(this.GDB);

                // open the table and create a new feature using its schema
                FeatureTable gdbTable;

                foreach (FeatureTable table in gdb.FeatureTables)
                {
                    gdbTable = table;

                    var newFeature = new Esri.ArcGISRuntime.Data.GeodatabaseFeature(gdbTable.Schema);

                    // assign the point from the user as the feature's geometry
                    newFeature.Geometry = mapPoint;

                    // get the attributes from the feature (a Dictionary<string, object>) and set some values
                    var attributes = newFeature.Attributes;
                    attributes["POST_ID"] = "123456"; 
                    
                    // add the new feature to the table, the OID of the new feature is returned
                    var recNo = await gdbTable.AddAsync(newFeature);
                    
                    break;
                }


                await this.mapView.SetViewAsync(mapPoint, this.mapView.Scale + 1);
            }