our soil layer was working fine till yesterday but today the soil layer now creates mutiples of itself, the image below shows the problem, also the code is attached
private void mAddSoilLayer()
{
if (!Map1.CustomOverlays.Contains(SessionHandler.SoilLocation))
{
string wMapFileLoct = SessionHandler.SoilLocation;
ShapeFileFeatureSource.BuildIndexFile(SessionHandler.SoilLocation);
ShapeFileFeatureLayer lyrSoilLayer = new ShapeFileFeatureLayer(SessionHandler.SoilLocation);
lyrSoilLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Tan, GeoColor.StandardColors.Black);
lyrSoilLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
lyrSoilLayer.Transparency = 75;
ShapeFileFeatureLayer lyrSoilLabels = new ShapeFileFeatureLayer(wMapFileLoct);
lyrSoilLabels.ZoomLevelSet.ZoomLevel10.DefaultTextStyle = TextStyles.CreateSimpleTextStyle(“musym”, “Arial”, 8, DrawingFontStyles.Bold, GeoColor.StandardColors.Black, 6, 2);
lyrSoilLabels.ZoomLevelSet.ZoomLevel10.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
//lyrSoilLabels.DrawingMarginPercentage = 50;
Proj4Projection proj4 = new Proj4Projection();
int projkey = Convert.ToInt32(SessionHandler.WebProjection);
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(projkey);
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
proj4.Open();
lyrSoilLayer.Open();
lyrSoilLayer.FeatureSource.Projection = proj4;
lyrSoilLabels.FeatureSource.Projection = proj4;
LayerOverlay ovlSoil = new LayerOverlay(SessionHandler.SoilName, false, TileType.MultipleTile);
ovlSoil.ServerCache = new ServerCache(“C:/AMI_Map_Files/KS/KS_WL/KS_WL_ServerCache”);
ovlSoil.Layers.Add(lyrSoilLayer);
ovlSoil.Layers.Add(lyrSoilLabels);
ovlSoil.IsVisible = false;
Map1.CustomOverlays.Add(ovlSoil);
}
}