MapMatrix NetGIS Class Library

MapLegend.InitalizeLegend Method 

Creates a MapLegend from an XML string.

public void InitalizeLegend(
   string xml
);

Parameters

xml
XML data used for the definition of this object

Remarks

This method should be called once from within a web application. The code should be placed in the Page_Load method inside of a test for IsPostBack

Example

This sample shows how to call the InitializeLegend method.

             private void Page_Load(object sender, System.EventArgs e)
             {
               MapImage1.MapSessionCollection.Add(MapSession1);
               MapImage1.Legend = MapLegend1;
               MapImage1.Bind();
                  
               if (!(Page.IsPostBack))
               {
                  StreamReader sr = new StreamReader(@"C:\Clients\OakRidge\support\Legend.xml");
                  string LegendXML = sr.ReadToEnd();
                  sr.Close();
                  MapLegend1.InitalizeLegend(LegendXML);
                  // The rest of initialition code follows...
            

See Also

MapLegend Class | MapMatrix.WebUI.WebControls Namespace