I have to create a lot of reports that have pictures of maps on them. I load everything I need into the map control then call getBitmap() to get my images that I use in the reports. I can get the legend to show up on a map control on a web page but the legend is not present in the image returned by the getBitmap() function. I'm wondering if there is something I'm doing wrong or not doing that I should be. This is how I'm loading the legend:
Map1.MapUnit = GeographyUnit.DecimalDegree
Dim layer As New ShapeFileFeatureLayer("C:\Program Files (x86)\ThinkGeo\Map Suite Web Full Edition 5.0\Samples\VB Samples\SampleData\USA\states.shp")
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
layer.Open()
Dim boundingBox As RectangleShape = layer.GetBoundingBox()
layer.Close()
Map1.StaticOverlay.Layers.Add(layer)
Map1.CurrentExtent = boundingBox
Dim blackBrush As New GeoSolidBrush(GeoColor.SimpleColors.Black)
Dim itemFont As New GeoFont("Arial", 8, DrawingFontStyles.Regular)
Dim title As New LegendItem()
title.TextStyle = New TextStyle("High Risk", itemFont, blackBrush)
Dim aaa As New LegendItem()
aaa.TextStyle = New TextStyle("AAA", itemFont, blackBrush)
aaa.ImageStyle = AreaStyles.Evergreen1
Dim bbb As New LegendItem()
bbb.TextStyle = New TextStyle("BBB", itemFont, blackBrush)
bbb.ImageStyle = AreaStyles.Tundra1
Dim legendlayer As New LegendAdornmentLayer()
legendlayer.Title = title
legendlayer.LegendItems.Add(aaa)
legendlayer.LegendItems.Add(bbb)
legendlayer.Location = AdornmentLocation.LowerLeft
legendlayer.Height = 75
legendlayer.Width = 100
Map1.AdornmentOverlay.Layers.Add("legend", legendlayer)