I'm creating a web service that will be passed a list of objects that include the Lat/Long coordinates and some other data such as Speed. When I use the ArcGISRuntime library to add the features to my map service that is running, the Geometry will appear but none of the attributes ever will. Here is my code:
foreach (GPSLocation loc in aLocationsToStore)
var theLatLongPoint = new MapPoint(loc.Longitude, loc.Latitude, SpatialReferences.Wgs84);
var theProjectedPoint = GeometryEngine.Project(theLatLongPoint, theSpatialReference);
var theDateTime = Convert.ToDateTime(loc.DateTime);
//Feature gpsFeature = new GeodatabaseFeature(gpsLocFeatureTable.Schema);
var gpsFeature = gpsLocFeatureTable.CreateNew();
gpsFeature.Geometry = theProjectedPoint;
var attributes = gpsFeature.Attributes;
attributes["SPEED"] = loc.Speed;
var result = await gpsLocFeatureTable.ApplyEditsAsync(true);
After running this, in the map service I can see the MapPoints in the feature layer, but all of the attribute values of the point are 'null' Any idea what I'm doing wrong or how I can get the attributes to sync?
I tried sniffing the network data using WireShark and this is what I get for the adds value:
It seems as though it is overriding all of the attributes that I explicitly define when I call AddAsync. Any ideas on how to get attributes in the attributes object?
Solved! Go to Solution.