After upgrading to version 3.1.299 i get warnings when using InMemoryFeatureLayer
Warning 29 'ThinkGeo.MapSuite.Core.InMemoryFeatureLayer.InternalFeatures' is obsolete: 'You are bypassing the automatic spatial indexing if the modify, add or delete. You need to call BuildIndex method later.
The way i use the layer:
InMemoryFeatureLayer pointLayer = (InMemoryFeatureLayer)winMap.FindFeatureLayer(GetLayerName(LayerNameEnum.WindFarms));
winMap.Overlays[GetLayerName(LayerNameEnum.WindFarms)].Lock.EnterWriteLock();
try
{
InMemoryFeatureLayer pointLayer = (InMemoryFeatureLayer)winMap.FindFeatureLayer(GetLayerName(LayerNameEnum.WindFarms));
foreach (WindFarmItem item in e.Items)
{
GeoCoordinate gc = ConvertFromDecimalDegreeToMeters(item.Longitude, item.Latitude);
Feature feature = new Feature(gc.Longitude, gc.Latitude, item.GetHashCode().ToString());
pointLayer.InternalFeatures.Add(item.GetHashCode().ToString(), feature);
}
}
finally
{
winMap.Overlays[GetLayerName(LayerNameEnum.WindFarms)].Lock.ExitWriteLock();
}
winMap.Refresh();