I have a map application in which I make a series of modification to an overlay, exporting the overlay using the getBtimap function each iteration. My problem is when I remove an overlay and add it back after updating it moves to the top of the map, while I have other static overlays I would like to keep on top of the modified overlay. How can I preserve the ordering/sequence of my overlays??
case "buildvid":
Map1.CustomOverlays.Remove("PenetrationOverlay");
Map1.CustomOverlays.Remove("ContributionOverlay");
Map1.CustomOverlays.Remove("ChangeOverlay");
DataTable[] dt = new DataTable[12];
Map1.CurrentExtent = new RectangleShape(Convert.ToDouble(args[2]), Convert.ToDouble(args[5]), Convert.ToDouble(args[4]), Convert.ToDouble(args[3]));
ShapeFileFeatureLayer BaseMapFile = new ShapeFileFeatureLayer(statepath + @"zips\zips.shp");
for (int i = 0; i < 12; i++)
{
dt = OverlayClass.getziplist(OverlayClass.GetExtent(sessionidvar), statepath, sessionidvar, i);
Map1.CustomOverlays.Add(OverlayClass.buildheatlayers(BaseMapFile, dt, 3));
Bitmap mapbitmap = Map1.GetBitmap();
mapbitmap.Save(@"C:\test\" + i + ".png", System.Drawing.Imaging.ImageFormat.Png);
Map1.CustomOverlays.Remove("ChangeOverlay");
}
CBResult = "startmovie";
break;