Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 742 Bytes

File metadata and controls

29 lines (21 loc) · 742 Bytes

SharpMap.Rendering.Decorations.Legend

A legend solution for SharpMap

Step 1: Create your map

Step 2: Create your legend for the map

var factory = new SharpMap.Rendering.Decoration.Legend.Factories.LegendFactory
    {
        HeaderFont = new System.Drawing.Font("Times New Roman", 24),
        SymbolSize = new System.Drawing.Size(14, 14);
        Indentation = 7;
        //more properties are ItemSize, ForeColor; Padding
    };
    
var legend = factory.Create(map);
// Get a legend image
var legendImage = legend.GetLegendImage();

// Display the legend image on the map
map.Decorations.Add(legend);
    

Here is an example:

Example image