This project has moved and is read-only. For the latest updates, please go here.

Add Feature

Topics: CompactFramework, General Topics
Jul 18, 2014 at 3:23 PM

I migrate my code to Sharpmap last build (v.3.0). GeometryFeatureProvider has removed on this version.

I've fix everything except adding new feature. Here is my code for the last version.
it fires exception on the row "featureData.Features.Add(newFeature)".

What do you think. Is it correct way to add new feature.
var newpole = new Pole
                    Latitude = (float)_rightClickedPoint.X,
                    Longtitude = (float)_rightClickedPoint.Y,
                    Name = "pole",
                var createdPole = LedaRequestReply.CreateBO<IEventBO>().CreatePole(newpole);
                var layer = (VectorLayer)_mapView.mapBox.Map.GetLayerByName("pole");
                //todo point changed as coordinate check
                var featureData = ((FeatureProvider) layer.DataSource);
                using (var newFeature = featureData.Factory.Create())
                    newFeature.Geometry = new NetTopologySuite.Geometries.Point(newpole.Latitude, newpole.Longtitude);
                    newFeature.Attributes["Id"] = createdPole.DevicePoiId;
Thank you
Jul 21, 2014 at 8:06 AM
Created an issue for that bug.