Articles in this section
Category / Section

How to enable legend position?

2 mins read

To enable the legend position, refer to the following steps.

Step 1

Create a map sample and include the necessary script files.

Step 2

The legend position is used to set the legends at various positions in map and you can enable it by setting the api position in legendSettings.

JS

legendSettings: 
              {
                  position: "bottomright",
               }

Similarly you can set the api position to topleft, topcenter, topright, centerleft, center, bottomleft, centerright and bottomcenter.

JS

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

The following screenshot displays the legend position at bottomright.

Maps with legend position at the bootom right of the maps

Figure 1: Legend position at bottomright

Refer to the following link to know more details about legend position.

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

Online sample is available in the following location.

http://www.syncfusion.com/uploads/user/directTrac/138455/LegendSample2107561313.zip

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