I have an InMemoryFeatureLayer with various Features representing vehicles. Each feature is made of a PointShape. I add each Feature with a key. Later when I want to access a Feature from the InternalFeatures collection of the InMemoryFeatureLayer, I use the key. I can access the collumn values and change it without a problem but I can't seem to figure out how to do that for the PointShape associated with it. See my code:
InMemoryFeatureLayer inMemoryFeatureLayer = new InMemoryFeatureLayer();
inMemoryFeatureLayer.Open();
inMemoryFeatureLayer.Columns.Add(new FeatureSourceColumn("MyColumn"));
inMemoryFeatureLayer.Close();
Feature newFeature = new Feature(new PointShape(X1,Y1));
newFeature.ColumnValues["MyColumn"] = "Value1";
inMemoryFeatureLayer.InternalFeatures.Add("Point1",newFeature);
Feature newFeature2 = new Feature(new PointShape(X2,Y2));
newFeature2.ColumnValues["MyColumn"] = "Value2";
inMemoryFeatureLayer.InternalFeatures.Add("Point2",newFeature2);
LayerOverlay pointOverLayer = new LayerOverlay();
pointOverLayer.LocalCache = LocalCacheMode.AutomaticCaching;
pointOverLayer.Layers.Add(inMemoryFeatureLayer);
winformsMap1.Overlays.Add("PointsOverlay", pointOverLayer);
Later, I want to change some values of, let's say, "Point1".
I can change the value of the column without a problem:
inMemoryFeatureLayer.InternalFeatures["Vehicle1"].ColumnValues["MyColumn""] = "NewValue1";
But I cannot change the X and Y of the PointShape of the Feature:
inMemoryFeatureLayer.InternalFeatures["Point1"].GetShape() ???