I am having a problem displaying a CustomStyle in a legend. I am using the last posted sample LegendAdornmentLayer found in this forum.
gis.thinkgeo.com/Support/Dis...fault.aspx
I altered the sample's DrawCore function to account for CustomStyles. The problem being it seems that the CustomStyle.DrawSample() is not drawing the icon I am using and results in a blank bitmap. I know the custom style is good as it draws on the map, just not on the legend.
Code from LegendAdornementLayer.DrawCore
legendBitmap = new Bitmap((int)legendIconWidth, (int)legendIconHeight);
legendCanvas.BeginDrawing(legendBitmap, new RectangleShape(0, legendIconWidth, legendIconHeight, 0), GeographyUnit.DecimalDegree);
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.DrawSample(legendCanvas);
layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.DrawSample(legendCanvas);
layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.DrawSample(legendCanvas);
for (int i = 0; i < layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Count; i++)
{
layer.ZoomLevelSet.ZoomLevel01.CustomStyles.DrawSample(legendCanvas);
}
I create my CustomStyle using the sample RotagedImageStyle Class found in the projects.
RotatedImageStyle rotatedImageStyle = new RotatedImageStyle(new GeoImage(stream), "Angle");
pointLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
pointLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(rotatedImageStyle);
pointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Any reason I can't use custom styles in my legend. Any feedback is greatly appreciated.
Eric