MapMaster.getLegendPanel

Syntax

getLegendPanel();

Description

The getLegendPanel method returns the Legend panel of map wizard.

Example

To execute the example the HTML page must contain the MapMaster component named master (see Example of MapMaster and EaxMasterBox Components Layout). Add checkboxeson the page, and selecting or deselecting it panels of the map master will be shown or hidden.

To do this, in the BODY tag add DIV item to store checkboxes:

    <div id = "CB1"></div>

    <div id = "CB2"></div>

    <div id = "CB3"></div>

Within the SCRIPT tag add code that creates checkboxes:

        var checkbox1 = new PP.Ui.CheckBox({//Create an instance of the CheckBox component
            ParentNode: document.getElementById("CB1"),
            Content: "Color indicator"
        });
        checkbox1.CheckedChanged.add(function (sender, args) {//Add handler of the CheckedChanged event
            var cb1 = checkbox1.getChecked(); //Create variable containing value of the Checked property
            if (cb1 === true)//If checkbox is selected,
                master.getAreaVisualPanel().show(); //show the Color indicator panel  
            else
                master.getAreaVisualPanel().hide();
        });
        var checkbox2 = new PP.Ui.CheckBox({//Create an instance of the CheckBox component
            ParentNode: document.getElementById("CB2"),
            Content: "Height indicator"
        });
        checkbox2.CheckedChanged.add(function (sender, args) {//Add handler of the CheckedChanged event
            var cb2 = checkbox1.getChecked(); //Create variable containing value of the Checked property
            if (cb2 === true)//If checkbox is selected,
                master.getVisual3DPanel().show(); //show the Height indicator panel  
            else
                master.getVisual3DPanel().hide(); //else - hide
        });
        var checkbox3 = new PP.Ui.CheckBox({//Create an instance of the CheckBox component
            ParentNode: document.getElementById("CB3"),
            Content: "Legend"
        });
        checkbox3.CheckedChanged.add(function (sender, args) {//Add handler of the CheckedChanged event
            var cb3 = checkbox1.getChecked(); //Create variable containing value of the Checked property
            if (cb3 === true)//If checkbox is selected,
                master.getLegendPanel().show(); //show the Color indicator panel  
            else
                master.getLegendPanel().hide();
        });

After executing the example, there will be layout of the checkboxes named correspondingly to panel names of the map master on the page. On selecting or deselecting checkbox corresponding master panel will be shown or hidden.

See also:

MapMaster