Articles in this section
Category / Section

How to render the Legend?

1 min read

To render the Legend, follow the given steps.

Step 1

Create a map sample and include the necessary script files.

Step 2

A Legend is a key used on a JavaScript map. It contains symbols with descriptions. It provides valuable information for interpreting what the map is displaying.

For enabling the Legend visibility, set api showLegend to true in the legendSettings.

legendSettings: {
   showLegend: true,
},

 

HTML

<script type="text/javascript">
            jQuery(function ($) {           
            $("#maps").ejMap({              
      layers: [
                        {           .    .    .
            legendSettings: {
                            showLegend:true,
                              mode: "interactive",                        
                                       .    .    .
                                      }
                           }            
                ]
 });
});
        </script>

The following screenshot represents the Legend visibility.

Legend visibility in maps

Sample Links

https://help.syncfusion.com/ug/js/default.htm#!documents/mapelements.htm

https://js.syncfusion.com/demos/web/#!/azure/map/heatmap

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied